[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yk4LUqpQQxYNkaer@google.com>
Date: Wed, 6 Apr 2022 21:51:14 +0000
From: Sean Christopherson <seanjc@...gle.com>
To: Chenyi Qiang <chenyi.qiang@...el.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Xiaoyao Li <xiaoyao.li@...el.com>, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 1/3] KVM: X86: Save&restore the triple fault request
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.
Powered by blists - more mailing lists