All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] restore the fake x2apic value for cpuid
@ 2018-11-22  7:18 Xin Li
  2018-12-03  7:00 ` Juergen Gross
  0 siblings, 1 reply; 5+ messages in thread
From: Xin Li @ 2018-11-22  7:18 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Talons Lee, Sergey Dyasli, Andrew Cooper,
	Igor Druzhinin

From: Talons Lee <xin.li@citrix.com>

Commit e657fcc clears cpu x2apic capability bit instead of using fake
cpuid value. However, with cpuid x2apic bit on, xen_read_msr_safe() will
not clear the EXTD bit, which leads to uncessary msr write trying to
disable x2apic in __x2apic_disable(). So restore the fake x2apic value.

Signed-off-by: Talons Lee <xin.li@citrix.com>

---
CC: Igor Druzhinin <igor.druzhinin@citrix.com>
CC: Sergey Dyasli <sergey.dyasli@citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Juergen Gross <jgross@suse.com>

---
 arch/x86/xen/enlighten_pv.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 4b20082..156c408 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -165,12 +165,17 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		      unsigned int *cx, unsigned int *dx)
 {
 	unsigned maskebx = ~0;
+	unsigned maskecx = ~0;
 
 	/*
 	 * Mask out inconvenient features, to try and disable as many
 	 * unsupported kernel subsystems as possible.
 	 */
 	switch (*ax) {
+	case 1:
+		maskecx &= ~(1 << (X86_FEATURE_X2APIC % 32));
+		break;
+
 	case CPUID_MWAIT_LEAF:
 		/* Synthesize the values.. */
 		*ax = 0;
@@ -193,6 +198,7 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
 		: "0" (*ax), "2" (*cx));
 
 	*bx &= maskebx;
+	*cx &= maskecx;
 }
 STACK_FRAME_NON_STANDARD(xen_cpuid); /* XEN_EMULATE_PREFIX */
 
-- 
1.8.3.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-12-03 11:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-22  7:18 [PATCH v1] restore the fake x2apic value for cpuid Xin Li
2018-12-03  7:00 ` Juergen Gross
2018-12-03  7:03   ` Juergen Gross
2018-12-03 11:15     ` Xin Li (Talons)
2018-12-03 11:40       ` Juergen Gross

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.