Re: [PATCH v3 1/7] KVM: x86: Make APIC_VERSION capture only the magic 0x14UL.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 13, 2022 at 11:22 AM Jue Wang <juew@xxxxxxxxxx> wrote:
>
> This series adds the Corrected Machine Check Interrupt (CMCI) and
> Uncorrectable Error No Action required (UCNA) emulation to KVM. The
> former is implemented as a LVT CMCI vector. The emulation of UCNA share
> the MCE emulation infrastructure.
>
> This is the first of 3 patches that clean up KVM APIC LVT logic.

The change log should explain what a patch does and why. With the
current change log it's not clear what is being cleaned up in the KVM
APIC logic, and it's not clear what that has to do with CMCI/UNCA
emulation. This is important for reviewing (I can't tell if this patch
is correct since I can't tell what it's trying to accomplish) and for
future reference (e.g. people reading the git history).

>
> Suggested-by: Sean Christopherson <seanjc@xxxxxxxxxx>
> Signed-off-by: Jue Wang <juew@xxxxxxxxxx>
> ---
>  arch/x86/kvm/lapic.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index 9322e6340a74..73b94e312f97 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -54,7 +54,7 @@
>  #define PRIo64 "o"
>
>  /* 14 is the version for Xeon and Pentium 8.4.8*/
> -#define APIC_VERSION                   (0x14UL | ((KVM_APIC_LVT_NUM - 1) << 16))
> +#define APIC_VERSION                   0x14UL
>  #define LAPIC_MMIO_LENGTH              (1 << 12)
>  /* followed define is not in apicdef.h */
>  #define MAX_APIC_VECTOR                        256
> @@ -367,7 +367,7 @@ static inline int apic_lvt_nmi_mode(u32 lvt_val)
>  void kvm_apic_set_version(struct kvm_vcpu *vcpu)
>  {
>         struct kvm_lapic *apic = vcpu->arch.apic;
> -       u32 v = APIC_VERSION;
> +       u32 v = APIC_VERSION | ((KVM_APIC_LVT_NUM - 1) << 16);

This change looks redundant with the change to APIC_VERSION above.

>
>         if (!lapic_in_kernel(vcpu))
>                 return;
> --
> 2.36.0.550.gb090851708-goog
>



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux