On Sun, Apr 24, 2022 at 5:59 AM Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> wrote: > > Two non-subsequent PTEs can be mapped to subsequent paddrs. In this > case, walk_pte will erroneously merge them. > > Enforce the split up, by tracking the virtual base address. > > Let's say we have the mapping: > 0x81200000 -> 0x89623000 (4K) > 0x8120f000 -> 0x89624000 (4K) > > Before, walk_pte would have shown: > > vaddr paddr size attr > ---------------- ---------------- ---------------- ------- > 0000000081200000 0000000089623000 0000000000002000 rwxu-ad > > as it only checks for subsequent paddrs. With this patch, it becomes: > > vaddr paddr size attr > ---------------- ---------------- ---------------- ------- > 0000000081200000 0000000089623000 0000000000001000 rwxu-ad > 000000008120f000 0000000089624000 0000000000001000 rwxu-ad > > Signed-off-by: Ralf Ramsauer <ralf.ramsa...@oth-regensburg.de> > --- > [since v2: Adjust comment, rebased to latest master] > > target/riscv/monitor.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) >
Reviewed-by: Bin Meng <bmeng...@gmail.com>