From: Sean Christopherson <seanjc@google.com>
To: Chenyi Qiang <chenyi.qiang@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Xiaoyao Li <xiaoyao.li@intel.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] KVM: X86: Save&restore the triple fault request
Date: Wed, 6 Apr 2022 21:51:14 +0000 [thread overview]
Message-ID: <Yk4LUqpQQxYNkaer@google.com> (raw)
In-Reply-To: <YkzRSHHDMaVBQrxd@google.com>
On Tue, Apr 05, 2022, Sean Christopherson wrote:
> On Fri, Mar 18, 2022, Chenyi Qiang wrote:
> > @@ -4903,7 +4906,8 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
> > | KVM_VCPUEVENT_VALID_SIPI_VECTOR
> > | KVM_VCPUEVENT_VALID_SHADOW
> > | KVM_VCPUEVENT_VALID_SMM
> > - | KVM_VCPUEVENT_VALID_PAYLOAD))
> > + | KVM_VCPUEVENT_VALID_PAYLOAD
> > + | KVM_VCPUEVENT_TRIPLE_FAULT))
> > return -EINVAL;
> >
> > if (events->flags & KVM_VCPUEVENT_VALID_PAYLOAD) {
> > @@ -4976,6 +4980,9 @@ static int kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu,
> > }
> > }
> >
> > + if (events->flags & KVM_VCPUEVENT_TRIPLE_FAULT)
> > + kvm_make_request(KVM_REQ_TRIPLE_FAULT, vcpu);
> > +
> > kvm_make_request(KVM_REQ_EVENT, vcpu);
>
> Looks correct, but this really needs a selftest, at least for the SET path since
> the intent is to use that for the NOTIFY handling. Doesn't need to be super fancy,
> e.g. do port I/O from L2, inject a triple fault, and verify L1 sees the appropriate
> exit.
It finally dawned on me why all the other events use two "flags", i.e. an actual
flags entry of KVM_VCPUEVENT_VALID_* and then the value itself. Userspace needs
to be able to _clear_ the request, not just set the request. So this needs to
follow the existing pattern of adding a VALID flag and then yet another field to
specify whether or not a triple fault is pending.
next prev parent reply other threads:[~2022-04-06 21:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-18 7:49 [PATCH v5 0/3] Introduce Notify VM exit Chenyi Qiang
2022-03-18 7:49 ` [PATCH v5 1/3] KVM: X86: Save&restore the triple fault request Chenyi Qiang
2022-04-05 23:31 ` Sean Christopherson
2022-04-05 23:44 ` Sean Christopherson
2022-04-06 21:15 ` Sean Christopherson
2022-04-07 6:12 ` Chenyi Qiang
2022-04-08 2:48 ` Sean Christopherson
2022-04-06 21:25 ` Sean Christopherson
2022-04-06 6:46 ` Chenyi Qiang
2022-04-06 21:51 ` Sean Christopherson [this message]
2022-03-18 7:49 ` [PATCH v5 2/3] KVM: VMX: Enable Notify VM exit Chenyi Qiang
2022-04-06 0:34 ` Sean Christopherson
2022-04-06 18:54 ` Sean Christopherson
2022-03-18 7:49 ` [PATCH v5 3/3] KVM: Add document for KVM_CAP_X86_NOTIFY_VMEXIT and KVM_EXIT_NOTIFY Chenyi Qiang
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=Yk4LUqpQQxYNkaer@google.com \
--to=seanjc@google.com \
--cc=chenyi.qiang@intel.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=xiaoyao.li@intel.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.