From: Paolo Bonzini <pbonzini@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
kvm <kvm@vger.kernel.org>, "Radim Krčmář" <rkrcmar@redhat.com>,
"Wanpeng Li" <wanpeng.li@hotmail.com>
Subject: Re: [PATCH RFC] KVM: async_pf: fix async_pf exception injection
Date: Thu, 8 Jun 2017 14:48:08 +0200 [thread overview]
Message-ID: <579af34a-acea-3aed-ca2c-38fe9fa7da76@redhat.com> (raw)
In-Reply-To: <CANRm+CzJMRAKiqrDr1_L_erSC92F2cAerBKnqm7VM1PQeS5Drg@mail.gmail.com>
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
next prev parent reply other threads:[~2017-06-08 12:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 9:30 Wanpeng Li
2017-06-08 11:52 ` Paolo Bonzini
2017-06-08 12:32 ` Wanpeng Li
2017-06-08 12:48 ` Paolo Bonzini [this message]
2017-06-09 5:30 ` Wanpeng Li
2017-06-09 11:32 ` Paolo Bonzini
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=579af34a-acea-3aed-ca2c-38fe9fa7da76@redhat.com \
--to=pbonzini@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=wanpeng.li@hotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®