[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZTHL9NQ87LNdB8qk@google.com>
Date: Thu, 19 Oct 2023 17:38:12 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: isaku.yamahata@...el.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
isaku.yamahata@...il.com, Michael Roth <michael.roth@....com>,
Paolo Bonzini <pbonzini@...hat.com>,
linux-coco@...ts.linux.dev, Chao Peng <chao.p.peng@...ux.intel.com>
Subject: Re: [PATCH 09/12] KVM: X86: Add debugfs to inject machine check on VM exit
On Tue, Oct 10, 2023, isaku.yamahata@...el.com wrote:
> From: Isaku Yamahata <isaku.yamahata@...el.com>
>
> The KVM/x86 handles machine-check in the guest specially. It sets up the
> guest so that vcpu exits from running guests, checks the exit reason and,
> manually raises the machine check by calling do_machine_check().
>
> To test the KVM machine check execution path, KVM wants to inject the
> machine check in the context of vcpu instead of the context of the process
> of MCE injection. Wire up the MCE injection framework for KVM to trigger
> MCE in the vcpu context. Add a kvm vcpu debugfs entry for an operator to
> tell KVM to inject MCE.
But this isn't "injecting" a #MC, it's just having KVM call do_machine_check()
before enabling IRQs after a VM-Exit. I don't see how that is interesting enough
to warrant a dedicated knob and code in KVM's run loop.
> @@ -10814,6 +10823,11 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
> fpu_sync_guest_vmexit_xfd_state();
>
> static_call(kvm_x86_handle_exit_irqoff)(vcpu);
> + if (unlikely(req_mce_inject)) {
> + mce_call_atomic_injector_chain(smp_processor_id());
> + kvm_machine_check();
> + mce_inject_unlock();
> + }
>
> if (vcpu->arch.guest_fpu.xfd_err)
> wrmsrl(MSR_IA32_XFD_ERR, 0);
> --
> 2.25.1
>
Powered by blists - more mailing lists