From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: KVM: MMU: handle invalid root_hpa at __direct_map Date: Fri, 20 Dec 2013 10:59:09 -0200 Message-ID: <20131220125908.GA3996@amt.cnet> References: <20131219172850.GA22588@amt.cnet> <52B40A96.7070809@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm-devel , Paolo Bonzini To: Xiao Guangrong Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35707 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932320Ab3LTM7Z (ORCPT ); Fri, 20 Dec 2013 07:59:25 -0500 Content-Disposition: inline In-Reply-To: <52B40A96.7070809@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Dec 20, 2013 at 05:15:02PM +0800, Xiao Guangrong wrote: > On 12/20/2013 01:28 AM, Marcelo Tosatti wrote: > > > > It is possible for __direct_map to be called on invalid root_hpa > > (-1), two examples: > > > > 1) try_async_pf -> can_do_async_pf > > -> vmx_interrupt_allowed -> nested_vmx_vmexit > > 2) vmx_handle_exit -> vmx_interrupt_allowed -> nested_vmx_vmexit > > > > Then to load_vmcs12_host_state and kvm_mmu_reset_context. > > > > Check for this possibility, let fault exception be regenerated. > > > > BZ: https://bugzilla.redhat.com/show_bug.cgi?id=924916 > > > > Nice catch, Marcelo! > Isn't it better to do kvm_mmu_reload() before calling page_fault handler? > Then a #PF can be avoided. try_async_pf can be called from within the page fault handler.