[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADLLry65+uvd5mPwn+L3obNAL8sc=K1E3xHnh9uTz8bV7ob6aw@mail.gmail.com>
Date: Mon, 26 Jan 2026 18:39:48 +0900
From: Austin Kim <austindh.kim@...il.com>
To: Paul Walmsley <pjw@...nel.org>
Cc: Palmer Dabbelt <palmer@...belt.com>, Alexandre Ghiti <alex@...ti.fr>, Albert Ou <aou@...s.berkeley.edu>,
linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] riscv: Add macros for software check and hardware error
exception codes
Hello,
2026년 1월 24일 (토) PM 4:57, Paul Walmsley <pjw@...nel.org>님이 작성:
>
> Hi Austin,
>
> On Thu, 22 Jan 2026, Austin Kim wrote:
>
> > The latest RISC-V Privileged specification defines new synchronous
> > exception codes in the scause register:
> >
> > 18: Software check
> > 19: Hardware error
> >
> > Link: https://docs.riscv.org/reference/isa/priv/supervisor.html
> > - 12.1.8. Supervisor Cause (scause) Register
> >
> > Add these macros for future use.
> >
> > Signed-off-by: Austin Kim <austindh.kim@...il.com>
>
> Thanks for the patch. Though, maybe it makes more sense to add these
> along with code that uses them?
Thank you for the feedback.
Could you consider adding macro definitions for the upcoming exception codes?
These might be used later when trying to handle exceptions for
SOFTWARE_CHECK or HARDWARE_ERROR.
18 = integrity fault
19 = corrupt/poisoned memory
<From: https://lists.riscv.org/g/tech-privileged/topic/new_exception_cause_codes_for/100518912>
As for SOFTWARE_CHECK(18), Deepak Gupta is now developing patch-set
for the entire patch for
CFI with SOFTWARE_CHECK error, as below.
https://lkml.org/lkml/2025/6/4/979
And HARDWARE_ERROR(19) is intented for 'implementation defined'.
I guess the following switch~case is the right place to put
EXC_SOFTWARE_CHECK and
EXC_HARDWARE_ERROR.
arch/riscv/kvm/vcpu_exit.c
int kvm_riscv_vcpu_exit(struct kvm_vcpu *vcpu, struct kvm_run *run,
struct kvm_cpu_trap *trap)
{
[...]
case EXC_BREAKPOINT:
run->exit_reason = KVM_EXIT_DEBUG;
ret = 0;
break;
+ case EXC_SOFTWARE_CHECK:
+ case EXC_HARDWARE_ERROR:
+ /* Todo: This exception code is added at Privileged
ISA version 1.13,
+ further actions will follow */
+ break;
If code with the macro definition should be added, I will propose a
new version later
with these macro definition.
Thank you again.
BR,
Austin Kim
>
>
> - Paul
Powered by blists - more mailing lists