[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZrPtOTHBfZ2e6RfV@google.com>
Date: Wed, 7 Aug 2024 14:55:05 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: "Xin Li (Intel)" <xin@...or.com>, linux-kernel@...r.kernel.org, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
peterz@...radead.org, andrew.cooper3@...rix.com
Subject: Re: [PATCH v1 3/3] x86/entry: Set FRED RSP0 on return to userspace
instead of context switch
On Wed, Aug 07, 2024, Thomas Gleixner wrote:
> Though I wonder if this should not have a per CPU cache for that.
>
> if (cpu_feature_enabled(X86_FEATURE_FRED) {
> unsigned long rsp0 = (unsigned long) task_stack_page(current) + THREAD_SIZE;
>
> if (__this_cpu_read(cpu_fred_rsp0) != rsp0) {
> wrmsrns(MSR_IA32_FRED_RSP0, fred_rsp0);
> this_cpu_write(cpu_fred_rsp0, rsp0);
> }
> }
>
> Hmm?
A per-CPU cache would work for KVM too, KVM would just need to stuff the cache
with the guest's value instead of setting _TIF_LOAD_USER_STATES.
Powered by blists - more mailing lists