public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Mathias Krause <minipli@grsecurity.net>
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 3/4] x86/access: Forced emulation support
Date: Fri, 31 Mar 2023 09:24:06 -0700	[thread overview]
Message-ID: <ZCcJJoe2OhReyV7X@google.com> (raw)
In-Reply-To: <20230331135709.132713-4-minipli@grsecurity.net>

On Fri, Mar 31, 2023, Mathias Krause wrote:
> Add support to enforce access tests to be handled by the emulator, if
> supported by KVM. Exclude it from the ac_test_exec() test, though, to
> not slow it down too much.

/enthusiastic high five

I was going to ask if you could extend the test to utilize FEP, and woke up this
morning to see it already done.  Thanks!!!!!

> Signed-off-by: Mathias Krause <minipli@grsecurity.net>
> ---

...

> @@ -152,6 +161,7 @@ const char *ac_names[] = {
>  	[AC_CPU_CR0_WP_BIT] = "cr0.wp",
>  	[AC_CPU_CR4_SMEP_BIT] = "cr4.smep",
>  	[AC_CPU_CR4_PKE_BIT] = "cr4.pke",
> +	[AC_FEP_BIT] = "fep",
>  };
>  
>  static inline void *va(pt_element_t phys)
> @@ -190,6 +200,7 @@ typedef struct {
>  
>  static void ac_test_show(ac_test_t *at);
>  
> +static bool fep_available;

I don't think fep_available needs to be captured in a global bool, the usage in
the CR0_WP test can do

	if (invalid_mask & AC_FEP_MASK)
		<skip>

  reply	other threads:[~2023-03-31 16:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 13:57 [kvm-unit-tests PATCH v2 0/4] Tests for CR0.WP=0/1 r/o write access Mathias Krause
2023-03-31 13:57 ` [kvm-unit-tests PATCH v2 1/4] x86: Use existing CR0.WP / CR4.SMEP bit definitions Mathias Krause
2023-03-31 16:02   ` Sean Christopherson
2023-03-31 13:57 ` [kvm-unit-tests PATCH v2 2/4] x86/access: CR0.WP toggling write to r/o data test Mathias Krause
2023-03-31 16:20   ` Sean Christopherson
2023-04-03  9:01     ` Mathias Krause
2023-04-03 17:09       ` Sean Christopherson
2023-03-31 13:57 ` [kvm-unit-tests PATCH v2 3/4] x86/access: Forced emulation support Mathias Krause
2023-03-31 16:24   ` Sean Christopherson [this message]
2023-04-03  9:08     ` Mathias Krause
2023-03-31 13:57 ` [kvm-unit-tests PATCH v2 4/4] x86/access: Try emulation for CR0.WP test as well Mathias Krause
2023-03-31 16:24   ` Sean Christopherson

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=ZCcJJoe2OhReyV7X@google.com \
    --to=seanjc@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=minipli@grsecurity.net \
    /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