From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION? Date: Wed, 03 Dec 2014 11:24:49 +0100 Message-ID: <547EE4F1.4070701@redhat.com> References: <201412031750333199219@sangfor.com>, <20141203095601.GJ18509@cloudius-systems.com> <201412031812064379324@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=gbk Content-Transfer-Encoding: 7bit Cc: kvm , "Michael S.Tsirkin" To: Zhang Haoyu , Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33921 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751061AbaLCKY6 (ORCPT ); Wed, 3 Dec 2014 05:24:58 -0500 In-Reply-To: <201412031812064379324@sangfor.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/12/2014 11:12, Zhang Haoyu wrote: >> > EXIT_REASON_EPT_VIOLATION is similar to a "page not present" pagefault >> > EXIT_REASON_EPT_MISCONFIG is similar to a "reserved bit set" pagefault. >> > handle_ept_misconfig() handles mmio pagefault because KVM has an >> > optimization that uses reserved bits to mark mmio regions. >> > > Thanks, Gleb, > where does kvm use the reserved bits to mark mmio regions? ept_set_mmio_spte_mask is where KVM tells mmu.c how to mark MMIO regions. You can search mmu.c for shadow_mmio_mask and is_mmio_spte in order to find out more about this optimization, you'll also get to the mark_mmio_spte function that Gleb mentioned. Paolo