qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exc


From: Aleksei Filippov
Subject: Re: [PATCH for-9.0] target/riscv: prioritize pmp errors in raise_mmu_exception()
Date: Fri, 12 Apr 2024 19:52:35 +0300
User-agent: Mozilla Thunderbird



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 fault occurs during the
get_physical_address() right at the start of second stage:

         if (ret == TRANSLATE_SUCCESS) {
             /* Second stage lookup */
             im_address = pa;

             ret = get_physical_address(env, &pa, &prot2, im_address, NULL,
                                        access_type, MMUIdx_U, false, true,
                                        false);


I think your patch needs to also prevent env->guest_phys_fault_addr to be set 
when
ret == TRANSLATE_PMP_FAIL.

With these changes in your patch, and this patch, we're free to set "first_stage_error = false;" at the start of second stage lookup, keeping consistency, because raise_mmu_exception is now able to deal with it. I can amend this change in this patch. This patch would prioritize
PMP errors, your patch will fix the problem with mtval2.

Let me know what do you think. If you agree I can re-send both patches together.


Thanks,


Daniel

Oh, I actually missed that, thx, you are right. I could prepare patch to fix
this, do you want it in this thread or in previous with only my patch in?

--
Sincerely,
Aleksei Filippov



reply via email to

[Prev in Thread] Current Thread [Next in Thread]