Re: [PATCH] KVM: allow compiling out SMM support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux