mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@ventanamicro.com>
To: "Andrew Jones" <ajones@ventanamicro.com>,
	"Milan Đokić" <milandjokic1995@gmail.com>
Cc: <linux-riscv@lists.infradead.org>, <jgross@suse.com>,
	<aou@eecs.berkeley.edu>, <Milan.Djokic@rt-rk.com>,
	<rafael.j.wysocki@intel.com>, <linux-kernel@vger.kernel.org>,
	<oleksandr_tyshchenko@epam.com>, <iommu@lists.linux.dev>,
	<sstabellini@kernel.org>, <palmer@dabbelt.com>,
	<paul.walmsley@sifive.com>, <xen-devel@lists.xenproject.org>,
	<Slavisa.Petrovic@rt-rk.com>, <takakura@valinux.co.jp>,
	"linux-riscv" <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH] riscv: Add initial Xen guest support for RISC-V
Date: Thu, 16 Jan 2025 11:22:59 +0100	[thread overview]
Message-ID: <D73F98QBJ4S9.3CN2ZUQ0GSMT6@ventanamicro.com> (raw)
In-Reply-To: <20250116-aa9eadde9279e66dbc01c705@orel>

2025-01-16T09:51:25+01:00, Andrew Jones <ajones@ventanamicro.com>:
> On Wed, Jan 15, 2025 at 08:04:05PM +0100, Milan Đokić wrote:
>> On Tue, Jan 14, 2025 at 7:18 PM Andrew Jones <ajones@ventanamicro.com> wrote:
>> > On Tue, Jan 14, 2025 at 05:09:36PM +0100, Milan Djokic wrote:
>> > > +#define SBI_ECALL 0xE
>> >
>> > Shouldn't this be 0xA000007, i.e. the SBI firmware specific extension
>> > for Xen. Otherwise why refer to SBI? Note, '0xE' is an invalid, legacy
>> > extension ID in SBI.
>> >
>> Hypercall is triggered through SBI and we defined 0xE just as an
>> SBI_ECALL ID on Xen side for hypercall handling (among other operation
>> IDs), so we're not referring to some standard /legacy ID here, just
>> utilizing SBI for hypercall handling.
>
> If the SBI specified EIDs and binary encoding aren't used, then the
> hypercalls aren't "triggered through SBI", Xen is just doing its own
> thing on an ecall. Xen doesn't have to implement SBI at all, but if
> it wants to provide SBI services, as well as its own hypercalls, then
> the hypercalls should be encoded in the same way as SBI functions and
> an EID allowed by the SBI specification for hypervisor-specific
> functions should be used. For Xen, that EID is already specified and
> it's 0xA000007.

SBI specifies a complete calling convention, but it's not necessary for
binary compatibility.  SBI also aims to simplify caller API.

Linux maintainers will want a good reason for introducing separate Xen
SBI call functions/macros (linux already has sbi_ecall, so please try to
use and potentially improve it), but the ECALL is guaranteed to be SBI
compatible as long as a7=0xA000007.

a7 is needed to denote Xen's extension space and the remaining
input/output registers can be implemented in any way Xen wants.

  reply	other threads:[~2025-01-16 10:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-14 16:09 Milan Djokic
2025-01-14 16:40 ` Anup Patel
2025-01-15 18:08   ` Milan Đokić
2025-01-14 17:51 ` Teddy Astie
2025-01-15 18:26   ` Milan Đokić
2025-01-14 18:18 ` Andrew Jones
2025-01-15 19:04   ` Milan Đokić
2025-01-16  8:51     ` Andrew Jones
2025-01-16 10:22       ` Radim Krčmář [this message]
2025-01-16 20:47         ` Milan Đokić
2025-01-15  0:01 ` Stefano Stabellini
     [not found]   ` <2f1432e6-0d27-48fd-b034-475284f14233@gmail.com>
2025-01-15 19:20     ` Milan Đokić
2025-01-15 21:14       ` [PATCH] riscv: Add initial Xen guest support for RISC-Vgh Stefano Stabellini
2025-01-16 20:42         ` Milan Đokić
2025-01-16 21:07           ` Stefano Stabellini

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=D73F98QBJ4S9.3CN2ZUQ0GSMT6@ventanamicro.com \
    --to=rkrcmar@ventanamicro.com \
    --cc=Milan.Djokic@rt-rk.com \
    --cc=Slavisa.Petrovic@rt-rk.com \
    --cc=ajones@ventanamicro.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=iommu@lists.linux.dev \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv-bounces@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=milandjokic1995@gmail.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=rafael.j.wysocki@intel.com \
    --cc=sstabellini@kernel.org \
    --cc=takakura@valinux.co.jp \
    --cc=xen-devel@lists.xenproject.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

all inboxes | Powered by JetHome®