qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH v3 1/1] target/riscv: Fix PMP propagation for tlb


From: LIU Zhiwei
Subject: Re: [PATCH v3 1/1] target/riscv: Fix PMP propagation for tlb
Date: Fri, 17 Dec 2021 11:06:33 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0


On 2021/12/17 上午8:37, Alistair Francis wrote:
On Wed, Dec 8, 2021 at 1:23 PM Alistair Francis <alistair23@gmail.com> wrote:
On Tue, Nov 23, 2021 at 7:09 PM LIU Zhiwei <zhiwei_liu@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_liu@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

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