Re: [PATCH v13 09/35] KVM: Add KVM_EXIT_MEMORY_FAULT exit to report faults to userspace

From: Huang, Kai
Date: Thu Nov 02 2023 - 14:35:39 EST


On Thu, 2023-11-02 at 08:44 -0700, Sean Christopherson wrote:
> On Thu, Nov 02, 2023, Paolo Bonzini wrote:
> > On 11/2/23 10:35, Huang, Kai wrote:
> > > IIUC KVM can already handle the case of poisoned
> > > page by sending signal to user app:
> > >
> > >   static int kvm_handle_error_pfn(struct kvm_vcpu *vcpu,  struct
> > > kvm_page_fault *fault)                                                {
> > >   ...
> > >
> > >          if (fault->pfn == KVM_PFN_ERR_HWPOISON) {
> > >                 kvm_send_hwpoison_signal(fault->slot, fault->gfn);
>
> No, this doesn't work, because that signals the host virtual address

Ah, right :-)