Re: [PATCH v2 12/49] KVM: x86: Reject disabling of MWAIT/HLT interception when not allowed

From: Sean Christopherson
Date: Tue May 28 2024 - 14:57:10 EST


On Wed, May 22, 2024, Binbin Wu wrote:
> On 5/18/2024 1:38 AM, Sean Christopherson wrote:
> > @@ -4726,15 +4740,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> > r = KVM_CLOCK_VALID_FLAGS;
> > break;
> > case KVM_CAP_X86_DISABLE_EXITS:
> > - r = KVM_X86_DISABLE_EXITS_PAUSE;
> > -
> > - if (!mitigate_smt_rsb) {
> > - r |= KVM_X86_DISABLE_EXITS_HLT |
> > - KVM_X86_DISABLE_EXITS_CSTATE;
> > -
> > - if (kvm_can_mwait_in_guest())
> > - r |= KVM_X86_DISABLE_EXITS_MWAIT;
> > - }
> > + r |= kvm_get_allowed_disable_exits();
>
> Nit: Just use "=".

Yowsers, that's more than a nit, that's downright bad code, it just happens to be
functionally ok. Thanks again for the reviews!