From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: KVM: MMU: handle invalid root_hpa at __direct_map Date: Fri, 20 Dec 2013 17:15:02 +0800 Message-ID: <52B40A96.7070809@linux.vnet.ibm.com> References: <20131219172850.GA22588@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Paolo Bonzini To: Marcelo Tosatti , kvm-devel Return-path: Received: from e23smtp01.au.ibm.com ([202.81.31.143]:53545 "EHLO e23smtp01.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755651Ab3LTJPL (ORCPT ); Fri, 20 Dec 2013 04:15:11 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Dec 2013 19:15:09 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 9F8883578054 for ; Fri, 20 Dec 2013 20:15:05 +1100 (EST) Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rBK9Er8a64618500 for ; Fri, 20 Dec 2013 20:14:53 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rBK9F4G6025603 for ; Fri, 20 Dec 2013 20:15:05 +1100 In-Reply-To: <20131219172850.GA22588@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: 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.