lkml.org 
[lkml]   [2022]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 1/1] x86/test: Add a test for AMD SEV-ES #VC handling
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

\
 
 \ /
  Last update: 2022-03-17 14:22    [W:0.038 / U:22.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site