Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1687340

Re: [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler

From Radim Krčmář <rkrcmar@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler
Date 2017-07-14 14:40 +0200
Message-ID <u382Z-3qu-17@gated-at.bofh.it> (permalink)
References <u2XKi-4Ps-9@gated-at.bofh.it> <u2XKi-4Ps-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 0/4] KVM: async_pf: Fix async pf exception injection Wanpeng Li <kernellwp@gmail.com> - 2017-07-14 03:40 +0200
  [PATCH v8 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf Wanpeng Li <kernellwp@gmail.com> - 2017-07-14 03:40 +0200
  [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler Wanpeng Li <kernellwp@gmail.com> - 2017-07-14 03:40 +0200
    Re: [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit  handler Radim Krčmář <rkrcmar@redhat.com> - 2017-07-14 14:40 +0200
  [PATCH v8 4/4] KVM: async_pf: Let guest support delivery of async_pf from guest mode Wanpeng Li <kernellwp@gmail.com> - 2017-07-14 03:40 +0200

csiph-web