2021-04-03 09:23:18

by Zengtao (B)

[permalink] [raw]
Subject: [PATCH] tools/kvm_stat: fix out of date aarch64 kvm_exit reason definations

Aarch64 kvm exit reason defination is out of date for some time, so in
this patch:
1. Sync some newly introduced or missing EC definations.
2. Change the WFI to WFx.
3. Fix the comment.

Not all the definations are used or usable for aarch64 kvm, but it's
better to keep align across the whole kernel.

Signed-off-by: Zeng Tao <[email protected]>
---
tools/kvm/kvm_stat/kvm_stat | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
index b0bf56c..63d87fd 100755
--- a/tools/kvm/kvm_stat/kvm_stat
+++ b/tools/kvm/kvm_stat/kvm_stat
@@ -154,17 +154,19 @@ SVM_EXIT_REASONS = {
'NPF': 0x400,
}

-# EC definition of HSR (from arch/arm64/include/asm/kvm_arm.h)
+# EC definition of HSR (from arch/arm64/include/asm/esr.h)
AARCH64_EXIT_REASONS = {
'UNKNOWN': 0x00,
- 'WFI': 0x01,
+ 'WFx': 0x01,
'CP15_32': 0x03,
'CP15_64': 0x04,
'CP14_MR': 0x05,
'CP14_LS': 0x06,
'FP_ASIMD': 0x07,
'CP10_ID': 0x08,
+ 'PAC': 0x09,
'CP14_64': 0x0C,
+ 'BTI': 0x0D,
'ILL_ISS': 0x0E,
'SVC32': 0x11,
'HVC32': 0x12,
@@ -173,6 +175,10 @@ AARCH64_EXIT_REASONS = {
'HVC64': 0x16,
'SMC64': 0x17,
'SYS64': 0x18,
+ 'SVE': 0x19,
+ 'ERET': 0x1a,
+ 'FPAC': 0x1c,
+ 'IMP_DEF': 0x1f,
'IABT': 0x20,
'IABT_HYP': 0x21,
'PC_ALIGN': 0x22,
--
2.8.1


2021-04-05 08:50:53

by Stefan Raspl

[permalink] [raw]
Subject: Re: [PATCH] tools/kvm_stat: fix out of date aarch64 kvm_exit reason definations

On 4/3/21 11:17 AM, Zeng Tao wrote:
> Aarch64 kvm exit reason defination is out of date for some time, so in
> this patch:
> 1. Sync some newly introduced or missing EC definations.
> 2. Change the WFI to WFx.
> 3. Fix the comment.
>
> Not all the definations are used or usable for aarch64 kvm, but it's
> better to keep align across the whole kernel.
>
> Signed-off-by: Zeng Tao <[email protected]>
> ---
> tools/kvm/kvm_stat/kvm_stat | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tools/kvm/kvm_stat/kvm_stat b/tools/kvm/kvm_stat/kvm_stat
> index b0bf56c..63d87fd 100755
> --- a/tools/kvm/kvm_stat/kvm_stat
> +++ b/tools/kvm/kvm_stat/kvm_stat
> @@ -154,17 +154,19 @@ SVM_EXIT_REASONS = {
> 'NPF': 0x400,
> }
>
> -# EC definition of HSR (from arch/arm64/include/asm/kvm_arm.h)
> +# EC definition of HSR (from arch/arm64/include/asm/esr.h)
> AARCH64_EXIT_REASONS = {
> 'UNKNOWN': 0x00,
> - 'WFI': 0x01,
> + 'WFx': 0x01,
> 'CP15_32': 0x03,
> 'CP15_64': 0x04,
> 'CP14_MR': 0x05,
> 'CP14_LS': 0x06,
> 'FP_ASIMD': 0x07,
> 'CP10_ID': 0x08,
> + 'PAC': 0x09,
> 'CP14_64': 0x0C,
> + 'BTI': 0x0D,
> 'ILL_ISS': 0x0E,
> 'SVC32': 0x11,
> 'HVC32': 0x12,
> @@ -173,6 +175,10 @@ AARCH64_EXIT_REASONS = {
> 'HVC64': 0x16,
> 'SMC64': 0x17,
> 'SYS64': 0x18,
> + 'SVE': 0x19,
> + 'ERET': 0x1a,
> + 'FPAC': 0x1c,
> + 'IMP_DEF': 0x1f,
> 'IABT': 0x20,
> 'IABT_HYP': 0x21,
> 'PC_ALIGN': 0x22,
>

Reviewed-by: Stefan Raspl <[email protected]>


--

Mit freundlichen Grüßen / Kind regards

Stefan Raspl


Linux on Z
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland
Schoenaicher Str. 220
71032 Boeblingen
Phone: +49-7031-16-2177
E-Mail: [email protected]
-------------------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH / Vorsitzender des Aufsichtsrats:
Gregor Pillen
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB
243294