From: "Radim Krčmář" <rkrcmar@redhat.com>
To: Wanpeng Li <kernellwp@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Wanpeng Li <wanpeng.li@hotmail.com>
Subject: Re: [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler
Date: Fri, 14 Jul 2017 14:39:33 +0200 [thread overview]
Message-ID: <20170714123933.GI3442@potion> (raw)
In-Reply-To: <1499995842-92976-3-git-send-email-wanpeng.li@hotmail.com>
2017-07-13 18:30-0700, Wanpeng Li:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> This patch adds the L1 guest async page fault #PF vmexit handler, such
> by L1 similar to ordinary async page fault.
>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Radim Krčmář <rkrcmar@redhat.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
> ---
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> @@ -3780,6 +3781,37 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn,
> return false;
> }
>
> +int kvm_handle_page_fault(struct kvm_vcpu *vcpu, u64 error_code,
> + u64 fault_address, char *insn, int insn_len,
> + bool need_unprotect)
> +{
> + int r = 1;
> +
> + switch (vcpu->arch.apf.host_apf_reason) {
> + default:
> + trace_kvm_page_fault(fault_address, error_code);
> +
> + if (need_unprotect && kvm_event_needs_reinjection(vcpu))
> + kvm_mmu_unprotect_page_virt(vcpu, fault_address);
> + r = kvm_mmu_page_fault(vcpu, fault_address, error_code, NULL, 0);
I changed this when applying (my patch was crappy), the arguments
shouldn't be lost:
kvm_mmu_page_fault(vcpu, fault_address, error_code, insn, insn_len);
It will be in the second merge window pull request if nothing goes bad,
thanks.
next prev parent reply other threads:[~2017-07-14 12:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-14 1:30 [PATCH v8 0/4] KVM: async_pf: Fix async pf exception injection Wanpeng Li
2017-07-14 1:30 ` [PATCH v8 1/4] KVM: x86: Simplify kvm_x86_ops->queue_exception parameter list Wanpeng Li
2017-07-14 1:30 ` [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler Wanpeng Li
2017-07-14 12:39 ` Radim Krčmář [this message]
2017-07-14 1:30 ` [PATCH v8 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf Wanpeng Li
2017-07-14 1:30 ` [PATCH v8 4/4] KVM: async_pf: Let guest support delivery of async_pf from guest mode Wanpeng Li
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=20170714123933.GI3442@potion \
--to=rkrcmar@redhat.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@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