[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/2] target/arm: change default pauth algorithm to impdef
From: |
Pierrick Bouvier |
Subject: |
[PATCH 2/2] target/arm: change default pauth algorithm to impdef |
Date: |
Wed, 4 Dec 2024 13:12:34 -0800 |
Pointer authentication on aarch64 is pretty expensive (up to 50% of
execution time) when running a virtual machine with tcg and -cpu max
(which enables pauth=on).
The advice is always: use pauth-impdef=on.
Our documentation even mentions it "by default" in
docs/system/introduction.rst.
Thus, we change the default to use impdef by default. This does not
affect kvm or hvf acceleration, since pauth algorithm used is the one
from host cpu.
This change is retro compatible, in terms of cli, with previous
versions, as the semantic of using -cpu max,pauth-impdef=on, and -cpu
max,pauth-qarma3=on is preserved.
The new option introduced in previous patch and matching old default is
-cpu max,pauth-qarma5=on.
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
---
docs/system/arm/cpu-features.rst | 2 +-
docs/system/introduction.rst | 2 +-
target/arm/cpu64.c | 12 ++++++------
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/system/arm/cpu-features.rst b/docs/system/arm/cpu-features.rst
index d69ebc2b852..37d5dfd15b3 100644
--- a/docs/system/arm/cpu-features.rst
+++ b/docs/system/arm/cpu-features.rst
@@ -223,7 +223,7 @@ Below is the list of TCG VCPU features and their
descriptions.
When ``pauth`` is enabled, select the architected QARMA5 algorithm.
Without ``pauth-impdef``, ``pauth-qarma3`` or ``pauth-qarma5`` enabled,
-the architected QARMA5 algorithm is used. The architected QARMA5
+the QEMU impdef algorithm is used. The architected QARMA5
and QARMA3 algorithms have good cryptographic properties, but can
be quite slow to emulate. The impdef algorithm used by QEMU is
non-cryptographic but significantly faster.
diff --git a/docs/system/introduction.rst b/docs/system/introduction.rst
index 746707eb00e..338d3745c3c 100644
--- a/docs/system/introduction.rst
+++ b/docs/system/introduction.rst
@@ -169,7 +169,7 @@ would default to it anyway.
.. code::
- -cpu max,pauth-impdef=on \
+ -cpu max \
-smp 4 \
-accel tcg \
diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c
index 34ef46d148f..8b1f26a9664 100644
--- a/target/arm/cpu64.c
+++ b/target/arm/cpu64.c
@@ -529,15 +529,15 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp)
return;
}
- if (cpu->prop_pauth_impdef) {
- isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, API, features);
- isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, GPI, 1);
+ if (cpu->prop_pauth_qarma5) {
+ isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, APA, features);
+ isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, GPA, 1);
} else if (cpu->prop_pauth_qarma3) {
isar2 = FIELD_DP64(isar2, ID_AA64ISAR2, APA3, features);
isar2 = FIELD_DP64(isar2, ID_AA64ISAR2, GPA3, 1);
- } else { /* default is pauth-qarma5 */
- isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, APA, features);
- isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, GPA, 1);
+ } else { /* default is pauth-impdef */
+ isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, API, features);
+ isar1 = FIELD_DP64(isar1, ID_AA64ISAR1, GPI, 1);
}
} else if (cpu->prop_pauth_impdef ||
cpu->prop_pauth_qarma3 ||
--
2.39.5
- [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/04
- [PATCH 1/2] target/arm: add new property to select pauth-qarma5, Pierrick Bouvier, 2024/12/04
- [PATCH 2/2] target/arm: change default pauth algorithm to impdef,
Pierrick Bouvier <=
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/16
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Richard Henderson, 2024/12/16
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/16
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Richard Henderson, 2024/12/16
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/16
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Alex Bennée, 2024/12/17
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Peter Maydell, 2024/12/17
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/17
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Alex Bennée, 2024/12/18
- Re: [PATCH 0/2] Change default pointer authentication algorithm on aarch64 to impdef, Pierrick Bouvier, 2024/12/18