From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [kvm-unit-tests PATCH] x86: fix ept_access_test_paddr exit qualifications Date: Sat, 6 May 2017 10:54:41 +0200 Message-ID: <321c8daf-c0f7-64dd-838c-30f1bdb13fea@redhat.com> References: <20170505205723.39601-1-dmatlack@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit To: David Matlack , kvm@vger.kernel.org Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:36205 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754897AbdEFIyw (ORCPT ); Sat, 6 May 2017 04:54:52 -0400 Received: by mail-wm0-f66.google.com with SMTP id u65so5384098wmu.3 for ; Sat, 06 May 2017 01:54:52 -0700 (PDT) In-Reply-To: <20170505205723.39601-1-dmatlack@google.com> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 05/05/2017 22:57, David Matlack wrote: > SDM Volume 3, Section 28.2.3.2 EPT Violations: > Reads by the logical processor of guest paging structures to translate a > linear address are considered to be data reads. This is for A/D bits disabled. > SDM Volume 3, Table 27-7, Footnote 1: > If A/D flags for EPT are enabled, accesses to guest paging-structure > entries are treated as writes with regard to EPT Violations. If such an > access causes an EPT violation, the processor sets both bit 0 and bit 1 > of the exit qualification. This is for A/D enabled. > static void ept_access_test_paddr_read_only_ad_disabled(void) > { > - u64 qual = EPT_VLT_WR | EPT_VLT_PERM_RD; > + u64 qual = EPT_VLT_WR | EPT_VLT_RD | EPT_VLT_PERM_RD; > > ept_access_test_setup(); > ept_disable_ad_bits(); > @@ -2754,7 +2756,7 @@ static void ept_access_test_paddr_read_write_execute(void) > > static void ept_access_test_paddr_read_execute_ad_disabled(void) > { > - u64 qual = EPT_VLT_WR | EPT_VLT_PERM_RD | EPT_VLT_PERM_EX; > + u64 qual = EPT_VLT_WR | EPT_VLT_RD | EPT_VLT_PERM_RD | EPT_VLT_PERM_EX; > > ept_access_test_setup(); > ept_disable_ad_bits(); So I think these should use EPT_VLT_RD only. Paolo