Re: [PATCH 03/22] KVM: x86: Support IBPB_BRTYPE and SBPB

From: Sean Christopherson
Date: Mon Aug 21 2023 - 12:51:06 EST


On Mon, Aug 21, 2023, Nikolay Borisov wrote:
>
> On 21.08.23 г. 19:35 ч., Sean Christopherson wrote:
> > On Mon, Aug 21, 2023, Josh Poimboeuf wrote:
> > + if (!boot_cpu_has(X86_FEATURE_IBPB))
> > + reserved_bits |= PRED_CMD_IBPB;
> > +
> > + if (!boot_cpu_has(X86_FEATURE_SBPB))
> > + reserved_bits |= PRED_CMD_SBPB;
> > - if (!boot_cpu_has(X86_FEATURE_IBPB) || (data & ~PRED_CMD_IBPB))
> > - return 1;
>
> Surely data must be sanitized against reserved_bit before this if is
> executed?

Heh, yeah, I missed that minor detail in my quick write-up.