All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: allow compiling out SMM support
Date: Wed, 28 Sep 2022 14:59:27 +0000	[thread overview]
Message-ID: <YzRhT6DzgDfGU7NC@google.com> (raw)
In-Reply-To: <f708d769-5d93-351f-ea24-8fa7deb9f689@redhat.com>

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)

  reply	other threads:[~2022-09-28 14:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 15:22 [PATCH] KVM: allow compiling out SMM support Paolo Bonzini
2022-09-27 17:59 ` Sean Christopherson
2022-09-28 11:41   ` Paolo Bonzini
2022-09-28 14:59     ` Sean Christopherson [this message]
2022-09-28 16:05       ` Paolo Bonzini
2022-09-29 15:49 ` Maciej S. Szmigiero
2022-09-29 16:47   ` Paolo Bonzini
2022-09-29 20:38     ` Sean Christopherson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YzRhT6DzgDfGU7NC@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.