From: joaopeixoto@osyx.tech
To: linux-kernel@vger.kernel.org
Cc: ajd@linux.ibm.com, alex@ghiti.fr, aou@eecs.berkeley.edu,
bagasdotme@gmail.com, catalin.marinas@arm.com,
conor+dt@kernel.org, corbet@lwn.net, dan.j.williams@intel.com,
davidmcerdeira@osyx.tech, devicetree@vger.kernel.org,
dev@kael-k.io, gregkh@linuxfoundation.org, haren@linux.ibm.com,
heiko@sntech.de, joaopeixoto@osyx.tech, jose@osyx.tech,
kever.yang@rock-chips.com, krzk+dt@kernel.org,
linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
linux-riscv@lists.infradead.org, maddy@linux.ibm.com,
mani@kernel.org, nathan@kernel.org, neil.armstrong@linaro.org,
palmer@dabbelt.com, pjw@kernel.org,
prabhakar.mahadev-lad.rj@bp.renesas.com, robh@kernel.org,
will@kernel.org
Subject: [PATCH 5/6] virt: bao: Move BAO_IPCSHMEM_HYPERCALL_ID to common header
Date: Wed, 7 Jan 2026 16:28:28 +0000 [thread overview]
Message-ID: <20260107162829.416885-6-joaopeixoto@osyx.tech> (raw)
In-Reply-To: <20260107162829.416885-1-joaopeixoto@osyx.tech>
From: João Peixoto <joaopeixoto@osyx.tech>
Move the IPC shared-memory hypercall ID from architecture-specific
headers into include/linux/bao.h.
Signed-off-by: João Peixoto <joaopeixoto@osyx.tech>
---
arch/arm/include/asm/bao.h | 5 ++---
arch/arm64/include/asm/bao.h | 5 ++---
arch/riscv/include/asm/bao.h | 7 +++----
drivers/virt/bao/ipcshmem/ipcshmem.c | 5 +----
include/linux/bao.h | 3 +++
5 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/arch/arm/include/asm/bao.h b/arch/arm/include/asm/bao.h
index 5ece9ecb1455..7d13591fe669 100644
--- a/arch/arm/include/asm/bao.h
+++ b/arch/arm/include/asm/bao.h
@@ -16,14 +16,13 @@
#include <linux/arm-smccc.h>
#include <linux/bao.h>
-static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id,
- unsigned long ipcshmem_id)
+static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id)
{
struct arm_smccc_res res;
arm_smccc_hvc(ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_32,
ARM_SMCCC_OWNER_VENDOR_HYP,
- hypercall_id),
+ BAO_IPCSHMEM_HYPERCALL_ID),
ipcshmem_id, 0, 0, 0, 0, 0, 0, &res);
return res.a0;
diff --git a/arch/arm64/include/asm/bao.h b/arch/arm64/include/asm/bao.h
index c7b7ec60c042..409f4058d56e 100644
--- a/arch/arm64/include/asm/bao.h
+++ b/arch/arm64/include/asm/bao.h
@@ -16,14 +16,13 @@
#include <linux/arm-smccc.h>
#include <linux/bao.h>
-static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id,
- unsigned long ipcshmem_id)
+static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id)
{
struct arm_smccc_res res;
arm_smccc_hvc(ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64,
ARM_SMCCC_OWNER_VENDOR_HYP,
- hypercall_id),
+ BAO_IPCSHMEM_HYPERCALL_ID),
ipcshmem_id, 0, 0, 0, 0, 0, 0, &res);
return res.a0;
diff --git a/arch/riscv/include/asm/bao.h b/arch/riscv/include/asm/bao.h
index f04e6cd33fa9..d168aba7d8ec 100644
--- a/arch/riscv/include/asm/bao.h
+++ b/arch/riscv/include/asm/bao.h
@@ -18,13 +18,12 @@
#define BAO_SBI_EXT_ID 0x08000ba0
-static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id,
- unsigned long ipcshmem_id)
+static inline unsigned long bao_ipcshmem_hypercall(unsigned long ipcshmem_id)
{
struct sbiret ret;
- ret = sbi_ecall(BAO_SBI_EXT_ID, hypercall_id, ipcshmem_id, 0, 0, 0, 0,
- 0);
+ ret = sbi_ecall(BAO_SBI_EXT_ID, BAO_IPCSHMEM_HYPERCALL_ID, ipcshmem_id,
+ 0, 0, 0, 0, 0);
return ret.error;
}
diff --git a/drivers/virt/bao/ipcshmem/ipcshmem.c b/drivers/virt/bao/ipcshmem/ipcshmem.c
index f3892d41248c..593e89cb76bd 100644
--- a/drivers/virt/bao/ipcshmem/ipcshmem.c
+++ b/drivers/virt/bao/ipcshmem/ipcshmem.c
@@ -14,9 +14,6 @@
#define BAO_IPCSHMEM_NAME_LEN 16
-/* IPC through shared-memory hypercall ID */
-#define BAO_IPCSHMEM_HYPERCALL_ID 0x1
-
struct bao_ipcshmem {
struct miscdevice miscdev;
int id;
@@ -90,7 +87,7 @@ static ssize_t bao_ipcshmem_write(struct file *filp, const char __user *buf,
*ppos += count;
/* Notify Bao hypervisor */
- bao_ipcshmem_hypercall(BAO_IPCSHMEM_HYPERCALL_ID, bao->id);
+ bao_ipcshmem_hypercall(bao->id);
return count;
}
diff --git a/include/linux/bao.h b/include/linux/bao.h
index 5b06d2a17d21..b29830374788 100644
--- a/include/linux/bao.h
+++ b/include/linux/bao.h
@@ -15,6 +15,9 @@
#include <linux/types.h>
+/* IPC through shared-memory hypercall ID */
+#define BAO_IPCSHMEM_HYPERCALL_ID 0x1
+
/* Remote I/O Hypercall ID */
#define BAO_REMIO_HYPERCALL_ID 0x2
--
2.43.0
next prev parent reply other threads:[~2026-01-07 16:29 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-24 13:52 [PATCH 0/5] virt: Add Bao hypervisor IPC and I/O dispatcher drivers joaopeixoto
2025-12-24 13:52 ` [PATCH 1/5] dt-bindings: Add Bao IPC shared memory driver binding joaopeixoto
2025-12-24 16:18 ` Rob Herring (Arm)
2025-12-25 8:57 ` Krzysztof Kozlowski
2025-12-24 13:52 ` [PATCH 2/5] virt: add Bao IPC shared memory driver joaopeixoto
2025-12-24 15:53 ` Greg KH
2025-12-24 15:54 ` Greg KH
2025-12-25 9:02 ` Krzysztof Kozlowski
2025-12-24 13:52 ` [PATCH 3/5] dt-bindings: Add Bao I/O dispatcher driver binding joaopeixoto
2025-12-24 16:18 ` Rob Herring (Arm)
2025-12-25 8:58 ` Krzysztof Kozlowski
2025-12-24 13:52 ` [PATCH 5/5] MAINTAINERS: Add entries for Bao hypervisor drivers, headers, and DT bindings joaopeixoto
2025-12-25 8:52 ` Krzysztof Kozlowski
2025-12-25 8:51 ` [PATCH 0/5] virt: Add Bao hypervisor IPC and I/O dispatcher drivers Krzysztof Kozlowski
[not found] ` <20251224135217.25350-5-joaopeixoto@osyx.tech>
2025-12-25 9:12 ` [PATCH 4/5] virt: add Bao I/O dispatcher driver Krzysztof Kozlowski
2026-01-07 16:28 ` [PATCH v2 0/6] virt: Add Bao hypervisor IPC and I/O dispatcher drivers joaopeixoto
2026-01-07 16:28 ` [PATCH 1/6] dt-bindings: Add Bao IPC shared memory driver binding joaopeixoto
2026-01-07 16:46 ` Krzysztof Kozlowski
2026-01-07 16:28 ` [PATCH 2/6] virt: bao: Add Bao IPC shared memory driver joaopeixoto
2026-01-07 18:54 ` Randy Dunlap
2026-01-14 20:37 ` Andrew Jones
2026-01-07 16:28 ` [PATCH 3/6] dt-bindings: Add Bao I/O dispatcher driver binding joaopeixoto
2026-01-07 16:47 ` Krzysztof Kozlowski
2026-01-07 16:28 ` [PATCH 4/6] virt: bao: Add Bao I/O dispatcher driver joaopeixoto
2026-01-14 20:32 ` Andrew Jones
2026-01-07 16:28 ` joaopeixoto [this message]
2026-01-07 19:36 ` [PATCH 5/6] virt: bao: Move BAO_IPCSHMEM_HYPERCALL_ID to common header Greg KH
2026-01-14 20:34 ` Andrew Jones
2026-01-07 16:28 ` [PATCH 6/6] MAINTAINERS: Add entries for Bao hypervisor drivers, headers, and DT bindings joaopeixoto
2026-01-07 19:37 ` [PATCH v2 0/6] virt: Add Bao hypervisor IPC and I/O dispatcher drivers Greg KH
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=20260107162829.416885-6-joaopeixoto@osyx.tech \
--to=joaopeixoto@osyx.tech \
--cc=ajd@linux.ibm.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=bagasdotme@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=dan.j.williams@intel.com \
--cc=davidmcerdeira@osyx.tech \
--cc=dev@kael-k.io \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=haren@linux.ibm.com \
--cc=heiko@sntech.de \
--cc=jose@osyx.tech \
--cc=kever.yang@rock-chips.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=maddy@linux.ibm.com \
--cc=mani@kernel.org \
--cc=nathan@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=robh@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