On 2021/12/17 上午8:37, Alistair Francis wrote:
On Wed, Dec 8, 2021 at 1:23 PM Alistair Francis <alistai...@gmail.com> wrote:
On Tue, Nov 23, 2021 at 7:09 PM LIU Zhiwei <zhiwei_...@c-sky.com> wrote:
Only the pmp index that be checked by pmp_hart_has_privs can be used
by pmp_get_tlb_size to avoid an error pmp index.

Before modification, we may use an error pmp index. For example,
we check address 0x4fc, and the size 0x4 in pmp_hart_has_privs. If there
is an pmp rule, valid range is [0x4fc, 0x500), then pmp_hart_has_privs
will return true;

However, this checked pmp index is discarded as pmp_hart_has_privs
return bool value. In pmp_is_range_in_tlb, it will traverse all pmp
rules. The tlb_sa will be 0x0, and tlb_ea will be 0x4fff. If there is
a pmp rule [0x10, 0x4]. It will be misused as it is legal in
pmp_get_tlb_size.

Signed-off-by: LIU Zhiwei <zhiwei_...@c-sky.com>
Thanks!

Applied to riscv-to-apply.next
This patch causes lots of Linux boot failures. I see messages like this:

Invalid write at addr 0x22048, size 8, region '(null)', reason: rejected

from QEMU and the guest fails to start.

Yes, it's an error.  Send it again later.

Thanks,
Zhiwei

Alistair

Reply via email to