Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Daniel Henrique Barboza
On 4/12/24 13:52, Aleksei Filippov wrote: On 12.04.2024 19:00, Daniel Henrique Barboza wrote: Thanks for giving it a go. You're right, this patch alone is not enough and we'll need your patch too. But note that, with what you've said in mind, your patch will also end up setting mtval2 a

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Daniel Henrique Barboza
On 4/12/24 14:12, Peter Maydell wrote: On Tue, 9 Apr 2024 at 18:53, Daniel Henrique Barboza wrote: raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no me

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Peter Maydell
On Tue, 9 Apr 2024 at 18:53, Daniel Henrique Barboza wrote: > > raise_mmu_exception(), as is today, is prioritizing guest page faults by > checking first if virt_enabled && !first_stage, and then considering the > regular inst/load/store faults. > > There's no mention in the spec about guest page

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Aleksei Filippov
On 12.04.2024 19:00, Daniel Henrique Barboza wrote: Thanks for giving it a go. You're right, this patch alone is not enough and we'll need your patch too. But note that, with what you've said in mind, your patch will also end up setting mtval2 and env->guest_phys_fault_addr in case a PMP f

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Daniel Henrique Barboza
On 4/12/24 11:15, Aleksei Filippov wrote: On 09.04.2024 20:52, Daniel Henrique Barboza wrote: raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no mention

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-12 Thread Aleksei Filippov
On 09.04.2024 20:52, Daniel Henrique Barboza wrote: raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no mention in the spec about guest page fault being a h

[PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()

2024-04-09 Thread Daniel Henrique Barboza
raise_mmu_exception(), as is today, is prioritizing guest page faults by checking first if virt_enabled && !first_stage, and then considering the regular inst/load/store faults. There's no mention in the spec about guest page fault being a higher priority that PMP faults. In fact, privileged spec