KVM Archive on lore.kernel.org
 help / color / Atom feed
From: Liran Alon <liran.alon@oracle.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"kvm list" <kvm@vger.kernel.org>,
	"Jim Mattson" <jmattson@google.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	"Joao Martins" <joao.m.martins@oracle.com>
Subject: Re: [PATCH 2/2] KVM: x86: Fix INIT signal handling in various CPU states
Date: Sun, 10 Nov 2019 14:23:17 +0200
Message-ID: <1ACF3DBE-DD34-4BE9-B25E-10805EB8C720@oracle.com> (raw)
In-Reply-To: <199dac11-d79b-356f-ae52-91653087cc49@redhat.com>

Sorry in the delay of handling this.
Now preparing a bunch of KVM commits to submit. :)

> On 11 Sep 2019, at 19:21, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 26/08/19 20:26, Liran Alon wrote:
>> An alternative could be to just add a flag to events->flags that modifies
>> behaviour to treat events->smi.latched_init as just events->latched_init.
>> But I prefer the previous option.
> Why would you even need the flag?  I think you only need to move the "if
> (lapic_in_kernel(vcpu)) outside, under "if (events->flags &

Without an additional flag, the events->smi.latched_init field will be evaluated
by kvm_vcpu_ioctl_x86_set_vcpu_events() even when userspace haven’t
specified KVM_VCPUEVENT_VALID_SMM. Which in theory should break
compatibility to userspace that don’t specify this flag.

If you are ok with breaking this compatibility, I will avoid adding an opt-in flag
that specifies this field should be evaluated even when KVM_VCPUEVENT_VALID_SMM
is not specified.

Because we are lucky and “latched_init" was last field in “struct smi” inside “struct kvm_vcpu_events”,
I will just move “latched_init” field outside of “struct smi” just before the “reserved” field.
Which would keep binary format compatibility while allowing making KVM code more clear.

> In fact, I think it would make sense anyway to clear KVM_APIC_SIPI in
> kvm_vcpu_ioctl_x86_set_vcpu_events (i.e. clear apic->pending_events and
> then possibly set KVM_APIC_INIT if events->smi.latched_init is true).

Agree. Will do this as-well.


> Paolo

  reply index

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-26 10:24 [PATCH 0/2]: " Liran Alon
2019-08-26 10:24 ` [PATCH 1/2] KVM: VMX: Introduce exit reason for receiving INIT signal on guest-mode Liran Alon
2019-08-26 16:37   ` Jim Mattson
2019-08-26 10:24 ` [PATCH 2/2] KVM: x86: Fix INIT signal handling in various CPU states Liran Alon
2019-08-26 16:03   ` Sean Christopherson
2019-08-26 18:26     ` Liran Alon
2019-09-11 16:21       ` Paolo Bonzini
2019-11-10 12:23         ` Liran Alon [this message]
2019-11-10 12:57           ` Liran Alon
2019-08-26 21:17   ` Jim Mattson
2019-08-26 22:04     ` Liran Alon
2019-08-26 22:38       ` Jim Mattson
2019-09-11 16:23   ` Paolo Bonzini
2019-09-11 16:42     ` Liran Alon
2019-09-11 16:48       ` Paolo Bonzini

Reply instructions:

You may reply publically 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:

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

  git send-email \
    --in-reply-to=1ACF3DBE-DD34-4BE9-B25E-10805EB8C720@oracle.com \
    --to=liran.alon@oracle.com \
    --cc=jmattson@google.com \
    --cc=joao.m.martins@oracle.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    --cc=vkuznets@redhat.com \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
	public-inbox-index kvm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git