Re: [PATCH v2] x86/hyperv: Remove BUG_ON() for kmap_local_page()

From: Wei Liu
Date: Thu Oct 27 2022 - 07:19:15 EST


On Thu, Oct 27, 2022 at 06:05:48PM +0800, Zhao Liu wrote:
> On Wed, Oct 26, 2022 at 03:17:18PM +0000, Wei Liu wrote:
> > Date: Wed, 26 Oct 2022 15:17:18 +0000
> > From: Wei Liu <wei.liu@xxxxxxxxxx>
> > Subject: Re: [PATCH v2] x86/hyperv: Remove BUG_ON() for kmap_local_page()
> >
> > On Thu, Oct 20, 2022 at 04:38:20PM +0800, Zhao Liu wrote:
> > > From: Zhao Liu <zhao1.liu@xxxxxxxxx>
> > >
> > > The commit 154fb14df7a3c ("x86/hyperv: Replace kmap() with
> > > kmap_local_page()") keeps the BUG_ON() to check if kmap_local_page()
> > > fails.
> > >
> > > But in fact, kmap_local_page() always returns a valid kernel address
> > > and won't return NULL here. It will BUG on its own if it fails. [1]
> > >
> > > So directly use memcpy_to_page() which creates local mapping to copy.
> > >
> > > [1]: https://lore.kernel.org/lkml/YztFEyUA48et0yTt@iweiny-mobl/
> > >
> > > Suggested-by: Fabio M. De Francesco <fmdefrancesco@xxxxxxxxx>
> > > Suggested-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> > > Reviewed-by: Ira Weiny <ira.weiny@xxxxxxxxx>
> > > Signed-off-by: Zhao Liu <zhao1.liu@xxxxxxxxx>
> >
> > Applied to hyperv-fixes. Thanks.
>
> Sorry Wei, I appology for not deleting unused variables, which caused
> the next tree break. Do I need to send another v3 to make up for my
> carelessness?

There is no need to send v3. I've dealt with it.

Thanks,
Wei.