lkml.org 
[lkml]   [2023]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v5 23/34] x86/fred: update MSR_IA32_FRED_RSP0 during task switch
Date
> > -	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

\
 
 \ /
  Last update: 2023-03-27 01:10    [W:0.063 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site