]> git.baikalelectronics.ru Git - kernel.git/commit
x86/hyperv: Make vapic support x2apic mode
authorRoman Kagan <rkagan@virtuozzo.com>
Thu, 10 Oct 2019 12:33:05 +0000 (12:33 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 15 Oct 2019 08:57:09 +0000 (10:57 +0200)
commit1a9d1fa23e6dc740ea518be81ae5bfb47fc6b10e
treeea69ba8d1b056a0fbae6647504cd3eba4fde8a3f
parent3b3128e71e1fb7e19e656fb009d05bff7d2019eb
x86/hyperv: Make vapic support x2apic mode

Now that there's Hyper-V IOMMU driver, Linux can switch to x2apic mode
when supported by the vcpus.

However, the apic access functions for Hyper-V enlightened apic assume
xapic mode only.

As a result, Linux fails to bring up secondary cpus when run as a guest
in QEMU/KVM with both hv_apic and x2apic enabled.

According to Michael Kelley, when in x2apic mode, the Hyper-V synthetic
apic MSRs behave exactly the same as the corresponding architectural
x2apic MSRs, so there's no need to override the apic accessors.  The
only exception is hv_apic_eoi_write, which benefits from lazy EOI when
available; however, its implementation works for both xapic and x2apic
modes.

Fixes: 9103c58ddcfa ("iommu/hyper-v: Add Hyper-V stub IOMMU driver")
Fixes: 2c545572a6ec ("X86/Hyper-V: Enlighten APIC access")
Suggested-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20191010123258.16919-1-rkagan@virtuozzo.com
arch/x86/hyperv/hv_apic.c