[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <579af34a-acea-3aed-ca2c-38fe9fa7da76@redhat.com>
Date: Thu, 8 Jun 2017 14:48:08 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Wanpeng Li <kernellwp@...il.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
kvm <kvm@...r.kernel.org>,
Radim Krčmář <rkrcmar@...hat.com>,
Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection
On 08/06/2017 14:32, Wanpeng Li wrote:
>>> I change the
>>> condition to "nr == PF_VECTOR && error_code == 0" to intercept async_pf, however,
>>> the below bug will be splatted:
>> Right, because error_code == 0 is a valid error code.
>>
>> For stable releases, this should be enough:
>
> We should also take care PAGE_READY async_pfs injection. I will send a
> patch to avoid async pf injection stuff in guest mode for stable
> release.
Right, the simplest thing to do here is another is_guest_mode check in
kvm_arch_can_inject_async_page_present. That would delay the signaling
of ready pages while L2 runs, but hopefully we're under memory pressure
so L2 will get a page fault too.
In fact, kvm_arch_can_inject_async_page_present should just be
if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED))
return true;
else
return can_do_async_pf(vcpu);
where can_do_async_pf becomes nonstatic.
Paolo
Powered by blists - more mailing lists