riscv: Add zihintpause extension support
cover riscv: Add zihintpause extension support
This patch exports the zihintpause extension to the guest if it is available on the host. It depends on the following tree from Anup:
https://github.com/avpatel/kvmtool/tree/riscv_svpbmt_sstc_v1
Mayuresh Chitale (1):
riscv: Add zihintpause extension support
riscv/fdt.c | 2 ++ riscv/include/asm/kvm.h | 1 + 2 files changed, 3 insertions(+)
Signature · 1 line
2.34.1
PATCH 1/1 riscv: Add zihintpause extension support
The zihintpause extension allows software to use the PAUSE instruction to reduce energy consumption while executing spin-wait code sequences. Add the zihintpause extension to the device tree if it is supported by the host.
--- riscv/fdt.c | 2 ++ riscv/include/asm/kvm.h | 1 + 2 files changed, 3 insertions(+)
riscv/fdt.c +2 -0
@@ -19,6 +19,8 @@ struct isa_ext_info {struct isa_ext_info isa_info_arr[] = { {"svpbmt" ,KVM_RISCV_ISA_EXT_SVPBMT }, {"sstc" ,KVM_RISCV_ISA_EXT_SSTC }, + {"Zihintpause" ,KVM_RISCV_ISA_EXT_ZIHINTPAUSE }, + };static void dump_fdt (const char *dtb_file,void *fdt)
riscv/include/asm/kvm.h +1 -0
@@ -98,6 +98,7 @@ enum KVM_RISCV_ISA_EXT_ID {KVM_RISCV_ISA_EXT_M ,KVM_RISCV_ISA_EXT_SVPBMT ,KVM_RISCV_ISA_EXT_SSTC , +KVM_RISCV_ISA_EXT_ZIHINTPAUSE , KVM_RISCV_ISA_EXT_MAX, };
Signature · 1 line
2.34.1
Quoted 15 lines · Mayuresh Chitale
The zihintpause extension allows software to use the PAUSE instruction to reduce energy consumption while executing spin-wait code sequences. Add the zihintpause extension to the device tree if it is supported by the host.
Signed-off-by Mayuresh Chitale <[email protected]>--- riscv/fdt.c | 2 ++ riscv/include/asm/kvm.h | 1 + 2 files changed, 3 insertions(+)riscv/fdt.c +0
-0
riscv/fdt.c struct isa_ext_info { · line 22
Quoted 4 lines
riscv/fdt.c +1
-0@@ -19,6 +19,8 @@ struct isa_ext_info {struct isa_ext_info isa_info_arr[] = { {"svpbmt" ,KVM_RISCV_ISA_EXT_SVPBMT }, {"sstc" ,KVM_RISCV_ISA_EXT_SSTC }, + {"Zihintpause" ,KVM_RISCV_ISA_EXT_ZIHINTPAUSE },
We don't capitalize the first S in 'Sstc' above, so I don't think we want to capitalize this Z either.
riscv/fdt.c struct isa_ext_info { · line 23
Quoted 1 line
riscv/fdt.c +1
-0+
extra blank line
riscv/include/asm/kvm.h enum KVM_RISCV_ISA_EXT_ID { · line 101
Quoted 12 lines
riscv/fdt.c +0
-0};static void dump_fdt (const char *dtb_file,void *fdt)riscv/include/asm/kvm.h +1
-0@@ -98,6 +98,7 @@ enum KVM_RISCV_ISA_EXT_ID {KVM_RISCV_ISA_EXT_M ,KVM_RISCV_ISA_EXT_SVPBMT ,KVM_RISCV_ISA_EXT_SSTC , + KVM_RISCV_ISA_EXT_ZIHINTPAUSE,
This should be updated with a uapi header update using util/update_headers.sh
Quoted 6 lines
riscv/include/asm/kvm.h +0
-0KVM_RISCV_ISA_EXT_MAX, };Signature · 1 line
2.34.1
Thanks,
drew