public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mayuresh Chitale <mchitale@ventanamicro.com>
To: Will Deacon <will@kernel.org>,
	Julien Thierry <julien.thierry.kdev@gmail.com>
Cc: Mayuresh Chitale <mchitale@ventanamicro.com>,
	kvm@vger.kernel.org, Anup Patel <anup@brainfault.org>
Subject: [PATCH kvmtool 1/1] riscv: Add zihintpause extension support
Date: Fri, 16 Sep 2022 12:13:24 +0530	[thread overview]
Message-ID: <20220916064324.28229-2-mchitale@ventanamicro.com> (raw)
In-Reply-To: <20220916064324.28229-1-mchitale@ventanamicro.com>

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 <mchitale@ventanamicro.com>
---
 riscv/fdt.c             | 2 ++
 riscv/include/asm/kvm.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/riscv/fdt.c b/riscv/fdt.c
index e3d7717..7997edc 100644
--- a/riscv/fdt.c
+++ b/riscv/fdt.c
@@ -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)
diff --git a/riscv/include/asm/kvm.h b/riscv/include/asm/kvm.h
index 7351417..f6f7963 100644
--- a/riscv/include/asm/kvm.h
+++ b/riscv/include/asm/kvm.h
@@ -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,
 };
 
-- 
2.34.1


  reply	other threads:[~2022-09-16  6:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  6:43 [PATCH kvmtool 0/1] riscv: Add zihintpause extension support Mayuresh Chitale
2022-09-16  6:43 ` Mayuresh Chitale [this message]
2022-09-16  8:21   ` [PATCH kvmtool 1/1] " Andrew Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220916064324.28229-2-mchitale@ventanamicro.com \
    --to=mchitale@ventanamicro.com \
    --cc=anup@brainfault.org \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox