lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 17 Mar 2022 14:21:08 +0100
From:   Joerg Roedel <jroedel@...e.de>
To:     Vasant Karasulli <vkarasulli@...e.de>
Cc:     linux-kernel@...r.kernel.org, bp@...en8.de, kvm@...r.kernel.org,
        x86@...nel.org, thomas.lendacky@....com,
        Varad Gautam <varad.gautam@...e.com>
Subject: Re: [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@...e.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@...e.com>
> Signed-off-by: Vasant Karasulli <vkarasulli@...e.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@...e.de

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ