[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



On 12/24/25 10:05 AM, Oleksii Kurochko wrote:

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.

EID printing should be also updated to #%#lx.

Sorry for noticing that only now.

~ Oleksii




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.