From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: What's the difference between EPT_MISCONFIG and EPT_VIOLATION? Date: Wed, 3 Dec 2014 11:56:01 +0200 Message-ID: <20141203095601.GJ18509@cloudius-systems.com> References: <201412031750333199219@sangfor.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm , Paolo Bonzini , "Michael S.Tsirkin" To: Zhang Haoyu Return-path: Received: from mail-wi0-f178.google.com ([209.85.212.178]:49929 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751053AbaLCJ4H (ORCPT ); Wed, 3 Dec 2014 04:56:07 -0500 Received: by mail-wi0-f178.google.com with SMTP id em10so4259286wid.5 for ; Wed, 03 Dec 2014 01:56:05 -0800 (PST) Content-Disposition: inline In-Reply-To: <201412031750333199219@sangfor.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Dec 03, 2014 at 05:50:33PM +0800, Zhang Haoyu wrote: > Hi, > > EXIT_REASON_EPT_VIOLATION's corresponding handle is handle_ept_violation(), > and EXIT_REASON_EPT_MISCONFIG's corresponding handle is handle_ept_misconfig(), > what's the difference between them? > > I read the SDM-3C 28.2.3 EPT-Induced VM Exits, and found below description, > "An EPT misconfiguration occurs when, in the course of translating > a guest-physical address, the logical processor encounters an EPT > paging-structure entry that contains an unsupported value. An EPT > violation occurs when there is no EPT misconfiguration but the EPT > paging-structure entries disallow an access using the guest physical > address." > > According to above description, EPT-MISCONFIG is from error settings , > but from the its exit-handle handle_ept_misconfig(), > it seems that handle_ept_misconfig() handles mmio pagefault, > I'm really confused, I think I'm missing something, > any advices? > 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. -- Gleb.