lkml.org 
[lkml]   [2022]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: allow compiling out SMM support
On Wed, Sep 28, 2022, Paolo Bonzini wrote:
> On 9/27/22 19:59, Sean Christopherson wrote:
> > > static int kvm_vcpu_ioctl_smi(struct kvm_vcpu *vcpu)
> > > {
> > > - kvm_make_request(KVM_REQ_SMI, vcpu);
> > > -
> > > + if (IS_ENABLED(CONFIG_KVM_SMM))
> > > + kvm_make_request(KVM_REQ_SMI, vcpu);
> > > return 0;
> >
> > This should return -EINVAL, not 0.
>
> I'm a bit wary of changing this in case userspace is relying on it not
> failing, because the paths that lead to the failing ioctl are most likely
> controlled by the guest.

But with CONFIG_KVM_SMM=n, KVM is now reporting that KVM_CAP_X86_SMM is unsupported,
so it's firmly a VMM bug if userspace is blindly firing KVM_SMI. As long as the
Kconfig is on by default, I don't see any reason to fudge KVM's ABI to try to avoid
breaking buggy userspace.

/* Available with KVM_CAP_X86_SMM */
#define KVM_SMI _IO(KVMIO, 0xb7)

\
 
 \ /
  Last update: 2022-09-28 17:00    [W:0.041 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site