[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 2/3] xen/riscv: add RISC-V legacy SBI extension support for guests
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Wed, 24 Dec 2025 10:05:49 +0100
- Cc: Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 24 Dec 2025 09:06:00 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 12/23/25 5:11 PM, Jan Beulich wrote:
On 22.12.2025 17:37, Oleksii Kurochko wrote:
+static int vsbi_legacy_ecall_handler(unsigned long eid, unsigned long fid,
+ struct cpu_user_regs *regs)
+{
+ int ret = 0;
+
+ switch ( eid )
+ {
+ case SBI_EXT_0_1_CONSOLE_PUTCHAR:
+ vsbi_print_char(regs->a0);
+ break;
+
+ case SBI_EXT_0_1_CONSOLE_GETCHAR:
+ ret = SBI_ERR_NOT_SUPPORTED;
+ break;
+
+ default:
+ /*
+ * TODO: domain_crash() is acceptable here while things are still under
+ * development.
+ * It shouldn't stay like this in the end though: guests should not
+ * be punished like this for something Xen hasn't implemented.
+ */
+ domain_crash(current->domain,
+ "%s: Unsupported ecall: FID: #%lx, EID: #%lx\n",
Hmm, wait - patch 1 says you would consistently use #%lu for FIDs. I can adjust
while committing, unless you tell me not to.
I think that we should drop printing FID at all for Legacy extension as
according to
the spec.:
The SBI function ID field in a6 register is ignored because these are encoded
as multiple SBI
extension IDs.
And according to "Function Listing" FID will be 0:
https://github.com/riscv-non-isa/riscv-sbi-doc/blob/master/src/ext-legacy.adoc#function-listing
I would be happy if you could drop printing of FID during commit. Let me know
if you want me to
drop printing of FID in the next patch series version.
Thanks.
~ Oleksii
|