public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: David Matlack <dmatlack@google.com>, kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH] x86: fix ept_access_test_paddr exit qualifications
Date: Sat, 6 May 2017 10:54:41 +0200	[thread overview]
Message-ID: <321c8daf-c0f7-64dd-838c-30f1bdb13fea@redhat.com> (raw)
In-Reply-To: <20170505205723.39601-1-dmatlack@google.com>



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

  reply	other threads:[~2017-05-06  8:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05 20:57 [kvm-unit-tests PATCH] x86: fix ept_access_test_paddr exit qualifications David Matlack
2017-05-06  8:54 ` Paolo Bonzini [this message]
2017-05-11 18:41   ` David Matlack
2017-05-12  8:43 ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=321c8daf-c0f7-64dd-838c-30f1bdb13fea@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox