Skip to contentSkip to conversation

Documentation: Update the behaviour of "kvm-arm.mode"

PATCH Superseded Mostafa Saleh 2 participants 4 messages Oct 23, 2024 – Oct 24, 2024 Documentation

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation: Update the behaviour of "kvm-arm.mode"

Commit 5053c3f0519c ("KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support") modified the behaviour of "kvm-arm.mode=protected" without the updating the kernel parameters doc.

Update it to match the current implementation.

Cc Will Deacon <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/admin-guide/kernel-parameters.txt +5 -1
index bb48ae24ae69..59a0dd7e2de6 100644
@@ -2723,8 +2723,12 @@
 			nvhe: Standard nVHE-based mode, without support for
 			      protected guests.
 
-			protected: nVHE-based mode with support for guests whose
+			protected: hVHE-based mode with support for guests whose
 				   state is kept private from the host.
+				   In case hVHE is not supported in hardware, it will
+				   boot with protected nVHE.
+				   nVHE protected mode can still be forced on VHE systems
+				   using "kvm_arm.mode=protected arm64_sw.hvhe=0 id_aa64mmfr1.vh=0"
 
 			nested: VHE-based mode with support for nested
 				virtualization. Requires at least ARMv8.3
Signature · 1 line
2.47.0.105.g07ac214952-goog
#1 lore raw

Hi Mostafa,

Quoted 20 lines · Mostafa Saleh

Commit 5053c3f0519c ("KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support") modified the behaviour of "kvm-arm.mode=protected" without the updating the kernel parameters doc.

Update it to match the current implementation.

Cc Will Deacon <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index bb48ae24ae69..59a0dd7e2de6 100644

Documentation/admin-guide/kernel-parameters.txt line 2728

Quoted 7 lines
Documentation/admin-guide/kernel-parameters.txt +2 -1
@@ -2723,8 +2723,12 @@
 			nvhe: Standard nVHE-based mode, without support for
 			      protected guests.
 
-			protected: nVHE-based mode with support for guests whose
+			protected: hVHE-based mode with support for guests whose
 				   state is kept private from the host.
+				   In case hVHE is not supported in hardware, it will

nit: it is VHE that is supported or not, hVHE is only a SW concept.

Documentation/admin-guide/kernel-parameters.txt line 2731

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +3 -0
+				   boot with protected nVHE.
+				   nVHE protected mode can still be forced on VHE systems
+				   using "kvm_arm.mode=protected arm64_sw.hvhe=0 id_aa64mmfr1.vh=0"

This opens another question: none of the arm_sw.*, nor any of the id_aa64* parameters are described (basically, anything that's in arch/arm64/kernel/pi/id_override.c). What should we do about these?

Documentation/admin-guide/kernel-parameters.txt line 2734

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
 			nested: VHE-based mode with support for nested
 				virtualization. Requires at least ARMv8.3

Huh, another nit to fix. We only support nested with ARMv8.4 (with FEAT_NV2), as the ARMv8.3 version (the original FEAT_NV) is too ugly for words.

Mind addressing this?

Thanks!

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
#2 lore raw

Hi Marc,

Quoted 34 lines · Marc Zyngier

Hi Mostafa,

Quoted 20 lines · Mostafa Saleh

Commit 5053c3f0519c ("KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support") modified the behaviour of "kvm-arm.mode=protected" without the updating the kernel parameters doc.

Update it to match the current implementation.

Cc Will Deacon <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index bb48ae24ae69..59a0dd7e2de6 100644

Documentation/admin-guide/kernel-parameters.txt line 2728

Quoted 7 lines
Documentation/admin-guide/kernel-parameters.txt +2 -1
@@ -2723,8 +2723,12 @@
 			nvhe: Standard nVHE-based mode, without support for
 			      protected guests.
 
-			protected: nVHE-based mode with support for guests whose
+			protected: hVHE-based mode with support for guests whose
 				   state is kept private from the host.
+				   In case hVHE is not supported in hardware, it will

nit: it is VHE that is supported or not, hVHE is only a SW concept.

Quoted 7 lines

Documentation/admin-guide/kernel-parameters.txt line 2731

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +3 -0
+				   boot with protected nVHE.
+				   nVHE protected mode can still be forced on VHE systems
+				   using "kvm_arm.mode=protected arm64_sw.hvhe=0 id_aa64mmfr1.vh=0"

This opens another question: none of the arm_sw.*, nor any of the id_aa64* parameters are described (basically, anything that's in arch/arm64/kernel/pi/id_override.c). What should we do about these?

Yes, I mainly added this, to make it easier if someone wants to boot to protected nVHE so they don't have to go through the code, but I can remove it if it's confusing.

Quoted 4 lines
Quoted 4 lines
Quoted 8 lines

Documentation/admin-guide/kernel-parameters.txt line 2734

Quoted 2 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
 			nested: VHE-based mode with support for nested
 				virtualization. Requires at least ARMv8.3

Huh, another nit to fix. We only support nested with ARMv8.4 (with FEAT_NV2), as the ARMv8.3 version (the original FEAT_NV) is too ugly for words.

Mind addressing this?

Sure, I will update it in v2.

Thanks,
Mostafa

Quoted 7 lines

Thanks!

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.
#3 lore raw
Quoted 46 lines · Mostafa Saleh

Hi Marc,

Quoted 34 lines · Marc Zyngier

Hi Mostafa,

Quoted 20 lines · Mostafa Saleh

Commit 5053c3f0519c ("KVM: arm64: Use hVHE in pKVM by default on CPUs with VHE support") modified the behaviour of "kvm-arm.mode=protected" without the updating the kernel parameters doc.

Update it to match the current implementation.

Cc Will Deacon <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Documentation/admin-guide/kernel-parameters.txt +0 -0
index bb48ae24ae69..59a0dd7e2de6 100644

Documentation/admin-guide/kernel-parameters.txt line 2728

Quoted 7 lines
Documentation/admin-guide/kernel-parameters.txt +2 -1
@@ -2723,8 +2723,12 @@
 			nvhe: Standard nVHE-based mode, without support for
 			      protected guests.
 
-			protected: nVHE-based mode with support for guests whose
+			protected: hVHE-based mode with support for guests whose
 				   state is kept private from the host.
+				   In case hVHE is not supported in hardware, it will

nit: it is VHE that is supported or not, hVHE is only a SW concept.

Quoted 7 lines

Documentation/admin-guide/kernel-parameters.txt line 2731

Quoted 3 lines
Documentation/admin-guide/kernel-parameters.txt +3 -0
+				   boot with protected nVHE.
+				   nVHE protected mode can still be forced on VHE systems
+				   using "kvm_arm.mode=protected arm64_sw.hvhe=0 id_aa64mmfr1.vh=0"

This opens another question: none of the arm_sw.*, nor any of the id_aa64* parameters are described (basically, anything that's in arch/arm64/kernel/pi/id_override.c). What should we do about these?

Quoted 3 lines

Yes, I mainly added this, to make it easier if someone wants to boot to protected nVHE so they don't have to go through the code, but I can remove it if it's confusing.

No, I think it is good to capture that sort of information somewhere, specially given that it is non-trivial to convince the kernel to do what you want.

But maybe at some point we should document the rest of the options, as they keep growing, and people are starting to rely on them for one thing or the other. Not now though.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Documentation/admin-guide/kernel-parameters.txt +0 -0
 			nested: VHE-based mode with support for nested
 				virtualization. Requires at least ARMv8.3
Quoted 7 lines
Quoted 5 lines

Huh, another nit to fix. We only support nested with ARMv8.4 (with FEAT_NV2), as the ARMv8.3 version (the original FEAT_NV) is too ugly for words.

Mind addressing this?

Sure, I will update it in v2.

Thank you!

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.