[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN6PR1101MB2161DD8F4F587C6FBFCA18EFA82B9@BN6PR1101MB2161.namprd11.prod.outlook.com>
Date: Wed, 19 Oct 2022 17:45:07 +0000
From: "Li, Xin3" <xin3.li@...el.com>
To: "Gross, Jurgen" <jgross@...e.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>
CC: "tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"hpa@...or.com" <hpa@...or.com>,
"peterz@...radead.org" <peterz@...radead.org>,
"brgerst@...il.com" <brgerst@...il.com>,
"Bae, Chang Seok" <chang.seok.bae@...el.com>
Subject: RE: [PATCH v4 5/5] x86/gsseg: use the LKGS instruction if available
for load_gs_index()
> > +static inline void __init lkgs_init(void) { #ifdef
> > +CONFIG_PARAVIRT_XXL #ifdef CONFIG_X86_64
> > + if (cpu_feature_enabled(X86_FEATURE_LKGS))
> > + pv_ops.cpu.load_gs_index = native_lkgs;
>
> For this to work correctly when running as a Xen PV guest, you need to add
>
> setup_clear_cpu_cap(X86_FEATURE_LKGS);
>
> to xen_init_capabilities() in arch/x86/xen/enlighten_pv.c, as otherwise the Xen
> specific .load_gs_index vector will be overwritten.
Yeah, we definitely should add it to disable LKGS in a Xen PV guest.
So does it mean that the Xen PV uses a black list during feature detection?
If yes then new features are often required to be masked with an explicit
call to setup_clear_cpu_cap.
Wouldn't a white list be better?
Then the job is more just on the Xen PV side, and it can selectively enable
a new feature, sometimes with Xen PV specific handling code added.
Xin
>
>
> Juergen
Powered by blists - more mailing lists