kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Elisei <alexandru.elisei@arm.com>
To: Joey Gouly <joey.gouly@arm.com>
Cc: kvm@vger.kernel.org, andrew.jones@linux.dev,
	kvmarm@lists.linux.dev, Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>
Subject: Re: [kvm-unit-tests PATCH v2 0/9] arm64: support EL2
Date: Mon, 16 Jun 2025 13:34:17 +0100	[thread overview]
Message-ID: <aFAPSSHJunx1Ecz2@arm.com> (raw)
In-Reply-To: <20250529135557.2439500-1-joey.gouly@arm.com>

Hi Joey,

On Thu, May 29, 2025 at 02:55:48PM +0100, Joey Gouly wrote:
> Hi all,
> 
> This series is for adding support to running the kvm-unit-tests at EL2. These
> have been tested with Marc Zyngier's Linux kvm-arm64/nv-next branch [1] and
> kvmtool branch arm64/nv-6.13 [2]
> 
> The goal is to later extend and add new tests for Nested Virtualisation,
> however they should also work with bare metal as well.
> 
> Changes since v1[3]:
> 	- Authorship fixed on 2 patches
> 	- Tested and fixed EFI support
> 	- Recactored assembly and added init_el macro
> 	- Clear trap registers, trying to avoid relying on default register
> 	  state
> 	- Cleaned up PMU changes
> 
> The debug tests fail with --nested, but pass with --nested --e2h0, I
> need to investigate this.

That's because the code does not check for the absence of FEAT_E2H0, and it sets
HCR_EL2.E2H to 0 when writing INIT_HCR_EL2_EL1_ONLY even if KVM doesn't support
that.

Have you considered using parts of el2_setup.h as-is instead of rolling out your
own EL2 init code? When I was looking at the init_el macro I was comparing it
with el2_setup.h, and having some of the code shared would make things easier
with updates and fixes too.

Either way, not a deal breaker if you want to write your own init code.

Thanks,
Alex

> 
> Thanks,
> Joey
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms.git kvm-arm64/nv-next (commit a35d752b17f4)
> [2] https://git.kernel.org/pub/scm/linux/kernel/git/maz/kvmtool.git arm64/nv-6.13 (commit 5b6fe295ea7)
> [3] https://lore.kernel.org/kvmarm/20250220141354.2565567-1-joey.gouly@arm.com/
> 
> Alexandru Elisei (2):
>   arm64: micro-bench: use smc when at EL2
>   arm64: selftest: update test for running at EL2
> 
> Joey Gouly (7):
>   arm64: drop to EL1 if booted at EL2
>   arm64: efi: initialise SCTLR_ELx fully
>   arm64: efi: initialise the EL
>   arm64: timer: use hypervisor timers when at EL2
>   arm64: micro-bench: fix timer IRQ
>   arm64: pmu: count EL2 cycles
>   arm64: run at EL2 if supported
> 
>  arm/cstart64.S             | 56 ++++++++++++++++++++++++++++++++++++--
>  arm/efi/crt0-efi-aarch64.S |  5 ++++
>  arm/micro-bench.c          | 26 ++++++++++++++++--
>  arm/pmu.c                  | 13 ++++++---
>  arm/selftest.c             | 18 ++++++++----
>  arm/timer.c                | 10 +++++--
>  lib/acpi.h                 |  2 ++
>  lib/arm/asm/setup.h        |  1 +
>  lib/arm/asm/timer.h        | 11 ++++++++
>  lib/arm/setup.c            |  6 ++++
>  lib/arm/timer.c            | 19 +++++++++++--
>  lib/arm64/asm/sysreg.h     | 19 +++++++++++++
>  12 files changed, 167 insertions(+), 19 deletions(-)
> 
> -- 
> 2.25.1
> 

  parent reply	other threads:[~2025-06-16 12:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-29 13:55 [kvm-unit-tests PATCH v2 0/9] arm64: support EL2 Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 1/9] arm64: drop to EL1 if booted at EL2 Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 2/9] arm64: efi: initialise SCTLR_ELx fully Joey Gouly
2025-06-06 10:17   ` Suzuki K Poulose
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 3/9] arm64: efi: initialise the EL Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 4/9] arm64: timer: use hypervisor timers when at EL2 Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 5/9] arm64: micro-bench: fix timer IRQ Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 6/9] arm64: micro-bench: use smc when at EL2 Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 7/9] arm64: selftest: update test for running " Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 8/9] arm64: pmu: count EL2 cycles Joey Gouly
2025-05-29 13:55 ` [kvm-unit-tests PATCH v2 9/9] arm64: run at EL2 if supported Joey Gouly
2025-06-16 12:34 ` Alexandru Elisei [this message]
2025-06-17 12:49   ` [kvm-unit-tests PATCH v2 0/9] arm64: support EL2 Joey Gouly

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=aFAPSSHJunx1Ecz2@arm.com \
    --to=alexandru.elisei@arm.com \
    --cc=andrew.jones@linux.dev \
    --cc=joey.gouly@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    /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;
as well as URLs for NNTP newsgroup(s).