Commit dbf563ee authored by Michael Kelley's avatar Michael Kelley Committed by Wei Liu
Browse files

x86/hyperv: Clarify comment on x2apic mode



The comment about Hyper-V accessors is unclear regarding their
potential use in x2apic mode, as is the associated commit message
in e211288b.  Clarify that while the architectural and
synthetic MSRs are equivalent in x2apic mode, the full set of xapic
accessors cannot be used because of register layout differences.

Fixes: e211288b ("x86/hyperv: Make vapic support x2apic mode")
Signed-off-by: default avatarMichael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1603723972-81303-1-git-send-email-mikelley@microsoft.com


Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
parent 2c3bd2a5
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -273,11 +273,15 @@ void __init hv_apic_init(void)
		pr_info("Hyper-V: Using enlightened APIC (%s mode)",
		pr_info("Hyper-V: Using enlightened APIC (%s mode)",
			x2apic_enabled() ? "x2apic" : "xapic");
			x2apic_enabled() ? "x2apic" : "xapic");
		/*
		/*
		 * With x2apic, architectural x2apic MSRs are equivalent to the
		 * When in x2apic mode, don't use the Hyper-V specific APIC
		 * respective synthetic MSRs, so there's no need to override
		 * accessors since the field layout in the ICR register is
		 * the apic accessors.  The only exception is
		 * different in x2apic mode. Furthermore, the architectural
		 * hv_apic_eoi_write, because it benefits from lazy EOI when
		 * x2apic MSRs function just as well as the Hyper-V
		 * available, but it works for both xapic and x2apic modes.
		 * synthetic APIC MSRs, so there's no benefit in having
		 * separate Hyper-V accessors for x2apic mode. The only
		 * exception is hv_apic_eoi_write, because it benefits from
		 * lazy EOI when available, but the same accessor works for
		 * both xapic and x2apic because the field layout is the same.
		 */
		 */
		apic_set_eoi_write(hv_apic_eoi_write);
		apic_set_eoi_write(hv_apic_eoi_write);
		if (!x2apic_enabled()) {
		if (!x2apic_enabled()) {