lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170714123933.GI3442@potion>
Date:   Fri, 14 Jul 2017 14:39:33 +0200
From:   Radim Krčmář <rkrcmar@...hat.com>
To:     Wanpeng Li <kernellwp@...il.com>
Cc:     linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>,
        Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH v8 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit
 handler

2017-07-13 18:30-0700, Wanpeng Li:
> From: Wanpeng Li <wanpeng.li@...mail.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@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.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.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ