From: Will Deacon <will@kernel.org>
To: "João Peixoto" <jpeixoto@osyx.tech>
Cc: gregkh@linuxfoundation.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, jose@osyx.tech, davidmcerdeira@osyx.tech,
corbet@lwn.net, skhan@linuxfoundation.org,
catalin.marinas@arm.com, linux@armlinux.org.uk, pjw@kernel.org,
palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
andrew.jones@oss.qualcomm.com, rdunlap@infradead.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-riscv@lists.infradead.org
Subject: Re: [RFC PATCH v3 4/6] virt: bao: add I/O dispatcher driver
Date: Tue, 11 Aug 2026 10:29:35 +0100 [thread overview]
Message-ID: <anrrf0J9C9zSrAgF@willie-the-truck> (raw)
In-Reply-To: <2190b6e083a2f2e0485b27e5e203647189bb1d1d.1786010512.git.jpeixoto@osyx.tech>
On Fri, Aug 07, 2026 at 08:39:31AM +0100, João Peixoto wrote:
> Add the Bao I/O dispatcher, used by backend VMs to service I/O on behalf
> of frontend guests. It bridges Bao's Remote I/O mechanism to userspace
> VirtIO backend device models.
>
> Each backend device has a contiguous shared-memory region for exchanging
> I/O buffers with its frontend and an interrupt the hypervisor uses to
> signal pending requests. Userspace drives the dispatcher through a set of
> ioctls on a misc character device.
>
> Co-developed-by: José Martins <jose@osyx.tech>
> Signed-off-by: José Martins <jose@osyx.tech>
> Co-developed-by: David Cerdeira <davidmcerdeira@osyx.tech>
> Signed-off-by: David Cerdeira <davidmcerdeira@osyx.tech>
> Signed-off-by: João Peixoto <jpeixoto@osyx.tech>
> ---
> diff --git a/arch/arm64/include/asm/bao.h b/arch/arm64/include/asm/bao.h
> index ab9b283168e3..1dc09a2c261b 100644
> --- a/arch/arm64/include/asm/bao.h
> +++ b/arch/arm64/include/asm/bao.h
> @@ -14,6 +14,7 @@
> #define __ASM_ARM64_BAO_H
>
> #include <linux/arm-smccc.h>
> +#include <linux/bao.h>
>
> static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id,
> unsigned long ipcshmem_id)
> @@ -28,4 +29,33 @@ static inline unsigned long bao_ipcshmem_hypercall(unsigned long hypercall_id,
> return res.a0;
> }
>
> +static inline unsigned long
> +bao_remio_hypercall(struct bao_remio_hypercall_ctx *ctx)
> +{
> + register int x0 asm("x0") =
> + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_64,
> + ARM_SMCCC_OWNER_VENDOR_HYP, BAO_REMIO_HYPERCALL_ID);
> + register u64 x1 asm("x1") = ctx->dm_id;
> + register u64 x2 asm("x2") = ctx->addr;
> + register u64 x3 asm("x3") = ctx->op;
> + register u64 x4 asm("x4") = ctx->value;
> + register u64 x5 asm("x5") = ctx->request_id;
> + register u64 x6 asm("x6") = 0;
> +
> + asm volatile("hvc 0\n\t"
> + : "=r"(x0), "=r"(x1), "=r"(x2), "=r"(x3), "=r"(x4),
> + "=r"(x5), "=r"(x6)
> + : "r"(x0), "r"(x1), "r"(x2), "r"(x3), "r"(x4), "r"(x5)
> + : "memory");
> +
> + ctx->addr = x1;
> + ctx->op = x2;
> + ctx->value = x3;
> + ctx->access_width = x4;
> + ctx->request_id = x5;
> + ctx->npend_req = x6;
> +
> + return x0;
> +}
Why aren't you using SMCCC for this? You should be able to use that (like
you did for bao_ipcshmem_hypercall()) and then there would be no need to
add any code to arch/arm64/.
Will
next prev parent reply other threads:[~2026-08-11 9:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 7:39 [RFC PATCH v3 0/6] virt: bao: Add Bao hypervisor IPC and I/O dispatcher drivers João Peixoto
2026-08-07 7:39 ` [RFC PATCH v3 1/6] dt-bindings: bao: add IPC shared-memory device João Peixoto
2026-08-07 7:39 ` [RFC PATCH v3 2/6] virt: bao: add IPC shared-memory driver João Peixoto
2026-08-07 7:39 ` [RFC PATCH v3 3/6] dt-bindings: bao: add I/O dispatcher device João Peixoto
2026-08-07 7:39 ` [RFC PATCH v3 4/6] virt: bao: add I/O dispatcher driver João Peixoto
2026-08-11 9:29 ` Will Deacon [this message]
2026-08-07 7:39 ` [RFC PATCH v3 5/6] virt: bao: consolidate the IPC hypercall ID in include/linux/bao.h João Peixoto
2026-08-07 7:39 ` [RFC PATCH v3 6/6] MAINTAINERS: add Bao hypervisor entry João Peixoto
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=anrrf0J9C9zSrAgF@willie-the-truck \
--to=will@kernel.org \
--cc=alex@ghiti.fr \
--cc=andrew.jones@oss.qualcomm.com \
--cc=aou@eecs.berkeley.edu \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=davidmcerdeira@osyx.tech \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=jose@osyx.tech \
--cc=jpeixoto@osyx.tech \
--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=linux@armlinux.org.uk \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.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