mbox series

[0/2] Tweaks to the kvm-arm.mode= early cmdline parsing

Message ID 20240501163400.15838-1-will@kernel.org (mailing list archive)
Headers show
Series Tweaks to the kvm-arm.mode= early cmdline parsing | expand

Message

Will Deacon May 1, 2024, 4:33 p.m. UTC
Hi folks,

Here are a couple of tweaks to the early parsing of the 'kvm-arm.mode='
cmdline option so that:

  1. kvm-arm.mode=nvhe overrides an earlier arm64_sw.hvhe=1 option
  2. Protected KVM initialises in hVHE if VH is available in the CPU

This is useful for Android, where we'd like the default cmdline to work
on all CPUs (i.e. with and without VH) but using hVHE by default where
available and finally allowing nVHE to be forced by the bootloader
appending additional arguments.

The patches could probably be squashed, but I kept them separate because
they're doing different things and this code is quite fiddly when you
start reasoning about the possible interactions between all of the
options.

Cheers,

Will

Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>

--->8

Will Deacon (2):
  KVM: arm64: Fix hvhe/nvhe early alias parsing
  KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support

 arch/arm64/kernel/pi/idreg-override.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Marc Zyngier May 8, 2024, 6:14 a.m. UTC | #1
On Wed, 01 May 2024 17:33:58 +0100, Will Deacon wrote:
> Here are a couple of tweaks to the early parsing of the 'kvm-arm.mode='
> cmdline option so that:
> 
>   1. kvm-arm.mode=nvhe overrides an earlier arm64_sw.hvhe=1 option
>   2. Protected KVM initialises in hVHE if VH is available in the CPU
> 
> This is useful for Android, where we'd like the default cmdline to work
> on all CPUs (i.e. with and without VH) but using hVHE by default where
> available and finally allowing nVHE to be forced by the bootloader
> appending additional arguments.
> 
> [...]

Applied to next, thanks!

[1/2] KVM: arm64: Fix hvhe/nvhe early alias parsing
      commit: 3c142f9d02b992aec5d96b82917e4cc07850c4df
[2/2] KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support
      commit: 5053c3f0519cd4c746577e3a6a7756f7c04b03dd

Cheers,

	M.