On 22/11/2018 08:18, Xin Li wrote: > From: Talons Lee <xin...@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...@citrix.com>
Wouldn't it be easier to use just rdmsr_safe() in __x2apic_disable() instead? Juergen > > --- > CC: Igor Druzhinin <igor.druzhi...@citrix.com> > CC: Sergey Dyasli <sergey.dya...@citrix.com> > CC: Andrew Cooper <andrew.coop...@citrix.com> > CC: Juergen Gross <jgr...@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 */ > > _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel