[PATCH v2] RISC-V: KVM: Delegate kvm unhandled faults to VS mode
Radim Krčmář
rkrcmar at ventanamicro.com
Thu Jul 10 23:16:22 PDT 2025
2025-07-10T21:30:30+08:00, Xu Lu <luxu.kernel at bytedance.com>:
> Delegate faults which are not handled by kvm to VS mode to avoid
> unnecessary traps to HS mode. These faults include illegal instruction
> fault, instruction access fault, load access fault and store access
> fault.
>
> The delegation of illegal instruction fault is particularly important
> to guest applications that use vector instructions frequently. In such
> cases, an illegal instruction fault will be raised when guest user thread
> uses vector instruction the first time and then guest kernel will enable
> user thread to execute following vector instructions.
(This optimization will be even more significant when nesting, where it
would currently go -> HS0 -> HS1 -> HS0 -> VS1, instead of -> VS1.)
> The fw pmu event counters remain undeleted so that guest can still get
> these events via sbi call. Guest will only see zero count on these
> events and know 'firmware' has delegated these faults.
>
> Signed-off-by: Xu Lu <luxu.kernel at bytedance.com>
> ---
Reviewed-by: Radim Krčmář <rkrcmar at ventanamicro.com>
More information about the kvm-riscv
mailing list