[Top][All Lists]

[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: Alistair Francis
Subject: Re: [PATCH v3 1/1] target/riscv: Fix PMP propagation for tlb
Date: Fri, 17 Dec 2021 10:37:23 +1000

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.


reply via email to

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