Re: [PATCH 2/2] drivers: hv: Create a consistent pattern for checking Hyper-V hypercall status

From: Wei Liu
Date: Wed Apr 21 2021 - 05:47:38 EST


On Tue, Apr 20, 2021 at 09:30:08PM +0000, Michael Kelley wrote:
> From: Joseph Salisbury <joseph.salisbury@xxxxxxxxxxxxxxxxxxx> Sent: Friday, April 16, 2021 5:43 PM
> >
> > There is not a consistent pattern for checking Hyper-V hypercall status.
> > Existing code uses a number of variants. The variants work, but a consistent
> > pattern would improve the readability of the code, and be more conformant
> > to what the Hyper-V TLFS says about hypercall status.
> >
> > Implemented new helper functions hv_result(), hv_result_success(), and
> > hv_repcomp(). Changed the places where hv_do_hypercall() and related variants
> > are used to use the helper functions.
> >
> > Signed-off-by: Joseph Salisbury <joseph.salisbury@xxxxxxxxxxxxx>
> > ---
> > arch/x86/hyperv/hv_apic.c | 16 +++++++++-------
> > arch/x86/hyperv/hv_init.c | 2 +-
> > arch/x86/hyperv/hv_proc.c | 25 ++++++++++---------------
> > arch/x86/hyperv/irqdomain.c | 6 +++---
> > arch/x86/hyperv/mmu.c | 8 ++++----
> > arch/x86/hyperv/nested.c | 8 ++++----
> > arch/x86/include/asm/mshyperv.h | 1 +
> > drivers/hv/hv.c | 2 +-
> > drivers/pci/controller/pci-hyperv.c | 2 +-
> > include/asm-generic/mshyperv.h | 25 ++++++++++++++++++++-----
> > 10 files changed, 54 insertions(+), 41 deletions(-)
>
> Wei -- I have gone through these changes reasonably carefully, but
> your review of the Linux-in-the-root-partition changes would be a good
> double-check. It's too easy to get the sense of the tests backwards. :-(

The code looks correct to me.

>
> Reviewed-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>

Thanks. I will apply this series to hyperv-next shortly.

Wei.