[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SA1PR11MB6734A6ED3EDA2525A28C951DA8809@SA1PR11MB6734.namprd11.prod.outlook.com>
Date: Mon, 20 Mar 2023 23:54:31 +0000
From: "Li, Xin3" <xin3.li@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"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>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"Christopherson,, Sean" <seanjc@...gle.com>,
"pbonzini@...hat.com" <pbonzini@...hat.com>,
"Shankar, Ravi V" <ravi.v.shankar@...el.com>
Subject: RE: [PATCH v5 23/34] x86/fred: update MSR_IA32_FRED_RSP0 during task
switch
> > - if (cpu_feature_enabled(X86_FEATURE_XENPV))
> > + if (cpu_feature_enabled(X86_FEATURE_FRED)) {
> > + /*
> > + * Will use WRMSRNS/WRMSRLIST for performance once it's
> upstreamed.
> > + */
> > + wrmsrl(MSR_IA32_FRED_RSP0,
> > + task_top_of_stack(task) +
> TOP_OF_KERNEL_STACK_PADDING);
> > + } else if (cpu_feature_enabled(X86_FEATURE_XENPV)) {
>
> Whee, so hardware will really only ever look at this when RSP0? I don't need to
> worry about exceptions during context switch?
You're right, we don't.
RSP0 is only used in ring3. Exceptions from ring0 just keep using the current
kernel stack unless a higher stack level needs to be used, e.g., RSP3 for #DF.
Thanks!
Xin
Powered by blists - more mailing lists