Code of Conduct
CVA6 commit affected
81245a4
Bug Description
Bug Description:
When the hypervisor extension is enabled and the compressed-instruction
extension is disabled (RVH=1, RVC=0), instr_queue changes an incoming
FE_INSTR_GUEST_PAGE_FAULT into INSTR_PAGE_FAULT (exception cause 12).
The architectural cause should remain INSTR_GUEST_PAGE_FAULT (cause 20).
The RVC-enabled path already handles this case correctly:
if (instr_data_out[i].ex == ariane_pkg::FE_INSTR_ACCESS_FAULT) begin
fetch_entry_o[0].ex.cause = riscv::INSTR_ACCESS_FAULT;
end else if (CVA6Cfg.RVH &&
instr_data_out[i].ex == ariane_pkg::FE_INSTR_GUEST_PAGE_FAULT) begin
fetch_entry_o[0].ex.cause = riscv::INSTR_GUEST_PAGE_FAULT;
end else begin
fetch_entry_o[0].ex.cause = riscv::INSTR_PAGE_FAULT;
end
In gen_downstream_itf_without_c, the corresponding logic only distinguishes
instruction access faults from all other faults:
if (instr_data_out[0].ex == ariane_pkg::FE_INSTR_ACCESS_FAULT) begin
fetch_entry_o[0].ex.cause = riscv::INSTR_ACCESS_FAULT;
end else begin
fetch_entry_o[0].ex.cause = riscv::INSTR_PAGE_FAULT;
end
The no-RVC path preserves tval, tval2, tinst, and gva; only the cause is
misclassified.
Steps to reproduce
The issue was reproduced using a full-core differential test:
CVA6's ariane_testharness under Verilator 5.036 and Spike execute
the same bare-metal RISC-V ELF, and their register writeback traces
are compared.
The RTL configuration is derived from cv64a6_imafdch_sv39, with
RVH enabled and RVC disabled.
- Set
vsatp to Bare and configure an Sv39x4 G-stage page table.
- Map the guest instruction address using a valid leaf PTE with
execute permission cleared (X=0).
- Disable exception delegation, install an M-mode trap handler,
and enter VS-mode using mret.
- The guest instruction fetch triggers a G-stage permission fault.
The trap cause differs between CVA6 and Spike: CVA6 reports
mcause=12, while Spike reports mcause=20.
Expected behavior
mcause should be 20, which is instruction guest-page fault.
Observed behavior
CVA6 reports mcause=12, while Spike reports the expected mcause=20.
Code of Conduct
CVA6 commit affected
81245a4
Bug Description
Bug Description:
When the hypervisor extension is enabled and the compressed-instruction
extension is disabled (
RVH=1,RVC=0),instr_queuechanges an incomingFE_INSTR_GUEST_PAGE_FAULTintoINSTR_PAGE_FAULT(exception cause 12).The architectural cause should remain
INSTR_GUEST_PAGE_FAULT(cause 20).The RVC-enabled path already handles this case correctly:
In
gen_downstream_itf_without_c, the corresponding logic only distinguishesinstruction access faults from all other faults:
The no-RVC path preserves
tval,tval2,tinst, andgva; only the cause ismisclassified.
Steps to reproduce
The issue was reproduced using a full-core differential test:
CVA6's
ariane_testharnessunder Verilator 5.036 and Spike executethe same bare-metal RISC-V ELF, and their register writeback traces
are compared.
The RTL configuration is derived from
cv64a6_imafdch_sv39, withRVH enabled and RVC disabled.
vsatpto Bare and configure an Sv39x4 G-stage page table.execute permission cleared (
X=0).and enter VS-mode using
mret.The trap cause differs between CVA6 and Spike: CVA6 reports
mcause=12, while Spike reportsmcause=20.Expected behavior
mcauseshould be 20, which is instruction guest-page fault.Observed behavior
CVA6 reports
mcause=12, while Spike reports the expectedmcause=20.