summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc.rs
diff options
context:
space:
mode:
authorQingwei Hu <qingwei.hu@bytedance.com>2026-07-07 20:25:48 +0800
committerAnup Patel <anup@brainfault.org>2026-07-14 18:31:51 +0530
commit4d638dc09128de1cb8311dff51e5de7d606d9346 (patch)
tree2b77ff5c9977e8aca45471287a6362e0fbb28ddd /rust/kernel/alloc.rs
parent298276da73cafd837ca9f762b3f9868216124eeb (diff)
downloadlinux-4d638dc09128de1cb8311dff51e5de7d606d9346.tar.gz
linux-4d638dc09128de1cb8311dff51e5de7d606d9346.zip
RISC-V: KVM: Inject instruction access fault on unmapped guest fetch
When an instruction guest-page-fault targets a GPA that is not backed by any memslot, KVM has no MMIO emulation path for the fetch. Load and store guest-page faults can be routed through MMIO emulation, but an instruction fetch has no data payload or access size for userspace to complete in the same way. Treat this case as an architectural access fault in the guest. On bare metal, fetching from an inaccessible physical address raises an instruction access fault for the supervisor to handle through its trap vector. Reflect EXC_INST_ACCESS back to the guest so the guest observes the same class of exception rather than leaving the fetch as a host-handled condition. stval contains the virtual address of the portion of the instruction that caused the fault, while sepc points to the beginning of the instruction. Signed-off-by: Qingwei Hu <qingwei.hu@bytedance.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260707122548.281685-1-qingwei.hu@bytedance.com Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'rust/kernel/alloc.rs')
0 files changed, 0 insertions, 0 deletions