public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joerg Roedel <jroedel@suse.de>
To: Vasant Karasulli <vkarasulli@suse.de>
Cc: linux-kernel@vger.kernel.org, bp@alien8.de, kvm@vger.kernel.org,
	x86@kernel.org, thomas.lendacky@amd.com,
	Varad Gautam <varad.gautam@suse.com>
Subject: Re: [PATCH v5 1/1] x86/test: Add a test for AMD SEV-ES #VC handling
Date: Thu, 17 Mar 2022 14:21:08 +0100	[thread overview]
Message-ID: <YjM1xOzRVRjtnNvP@suse.de> (raw)
In-Reply-To: <20220208162623.18368-2-vkarasulli@suse.de>

Hi Vasant,

thanks for submitting this.

On Tue, Feb 08, 2022 at 05:26:23PM +0100, Vasant Karasulli wrote:
> From: Varad Gautam <varad.gautam@suse.com>
> 
> Add a KUnit based test to validate Linux's VC handling, and introduce
> a new CONFIG_X86_TESTS to cover such tests. The test:
> 1. installs a kretprobe on the #VC handler (sev_es_ghcb_hv_call, to
>    access GHCB before/after the resulting VMGEXIT).
> 2. triggers an NAE.
> 3. checks that the kretprobe was hit with the right exit_code available
>    in GHCB.
> 
> Since relying on kprobes, the test does not cover NMI contexts.
> 
> Signed-off-by: Varad Gautam <varad.gautam@suse.com>
> Signed-off-by: Vasant Karasulli <vkarasulli@suse.de>
> ---
>  arch/x86/Kbuild              |   2 +
>  arch/x86/Kconfig.debug       |  16 ++++
>  arch/x86/kernel/Makefile     |   7 ++
>  arch/x86/tests/Makefile      |   3 +
>  arch/x86/tests/sev-test-vc.c | 154 +++++++++++++++++++++++++++++++++++
>  5 files changed, 182 insertions(+)
>  create mode 100644 arch/x86/tests/Makefile
>  create mode 100644 arch/x86/tests/sev-test-vc.c

Can we split this up a bit? Say into an initial patch which adds
arch/x86/tests/ and the Kconfig option and then three patches adding the
tests:

	1. Infrastructure and instruction-based tests (cpuid, wbinvd)
	2. Register access tests (MSR, DR7)
	3. IO tests (mmio, ioio)

> +static void sev_es_nae_mmio(struct kunit *test)
> +{
> +	unsigned long lapic_ver_pa = 0xfee00030; /* APIC_DEFAULT_PHYS_BASE + APIC_LVR */

Instead of the comment, please use the values directly to assign the
variable.

Regards,

-- 
Jörg Rödel
jroedel@suse.de

SUSE Software Solutions Germany GmbH
Maxfeldstr. 5
90409 Nürnberg
Germany
 
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


      reply	other threads:[~2022-03-17 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 16:26 [PATCH v5 0/1] x86/test: Add a test for AMD SEV-ES #VC handling Vasant Karasulli
2022-02-08 16:26 ` [PATCH v5 1/1] " Vasant Karasulli
2022-03-17 13:21   ` Joerg Roedel [this message]

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=YjM1xOzRVRjtnNvP@suse.de \
    --to=jroedel@suse.de \
    --cc=bp@alien8.de \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.lendacky@amd.com \
    --cc=varad.gautam@suse.com \
    --cc=vkarasulli@suse.de \
    --cc=x86@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