lkml.org 
[lkml]   [2022]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] x86/speculation: Support Automatic IBRS under virtualization
On 11/4/22 5:00 PM, Jim Mattson wrote:
> On Fri, Nov 4, 2022 at 2:38 PM Kim Phillips <kim.phillips@amd.com> wrote:
>>
>> VM Guests may want to use Auto IBRS, so propagate the CPUID to them.
>>
>> Co-developed-by: Babu Moger <Babu.Moger@amd.com>
>> Signed-off-by: Kim Phillips <kim.phillips@amd.com>
>
> The APM says that, under AutoIBRS, CPL0 processes "have IBRS
> protection." I'm taking this to mean only that indirect branches in
> CPL0 are not subject to steering from a less privileged predictor
> mode. This would imply that indirect branches executed at CPL0 in L1
> could potentially be subject to steering by code running at CPL0 in
> L2, since L1 and L2 share hardware predictor modes.

That's true for AMD processors that don't support Same Mode IBRS, also
documented in the APM.

Processors that support AutoIBRS also support Same Mode IBRS (see
CPUID Fn8000_0008_EBX[IbrsSameMode] (bit 19)).

> Fortunately, there is an IBPB when switching VMCBs in svm_vcpu_load().
> But it might be worth noting that this is necessary for AutoIBRS to
> work (unless it actually isn't).

It is needed, but not for kernel/CPL0 code, rather to protect one
guest's user-space code from another's.

Kim

\
 
 \ /
  Last update: 2022-11-07 23:30    [W:0.094 / U:0.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site