qemu/target
Alistair Francis 47566421f0 target/riscv: pmp: Fixup TLB size calculation
Since commit 4047368938 "accel/tcg: Introduce tlb_set_page_full" we
have been seeing this assert

    ../accel/tcg/cputlb.c:1294: tlb_set_page_with_attrs: Assertion `is_power_of_2(size)' failed.

When running Tock on the OpenTitan machine.

The issue is that pmp_get_tlb_size() would return a TLB size that wasn't
a power of 2. The size was also smaller then TARGET_PAGE_SIZE.

This patch ensures that any TLB size less then TARGET_PAGE_SIZE is
rounded down to 1 to ensure it's a valid size.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: LIU Zhiwei<zhiwei_liu@linux.alibaba.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20221012011449.506928-1-alistair.francis@opensource.wdc.com
Message-Id: <20221012011449.506928-1-alistair.francis@opensource.wdc.com>
2022-10-14 14:36:19 +10:00
..
alpha hw/core: Add CPUClass.get_pc 2022-10-04 12:13:12 -07:00
arm * scsi-disk: support setting CD-ROM block size via device options 2022-10-13 13:55:03 -04:00
avr accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
cris hw/core: Add CPUClass.get_pc 2022-10-04 12:13:12 -07:00
hexagon Make store handling faster and more robust 2022-10-05 10:17:32 -04:00
hppa accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
i386 * scsi-disk: support setting CD-ROM block size via device options 2022-10-13 13:55:03 -04:00
loongarch accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
m68k hw/core: Add CPUClass.get_pc 2022-10-04 12:13:12 -07:00
microblaze accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
mips kvm: allow target-specific accelerator properties 2022-10-10 09:23:16 +02:00
nios2 hw/core: Add CPUClass.get_pc 2022-10-04 12:13:12 -07:00
openrisc accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
ppc * scsi-disk: support setting CD-ROM block size via device options 2022-10-13 13:55:03 -04:00
riscv target/riscv: pmp: Fixup TLB size calculation 2022-10-14 14:36:19 +10:00
rx accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
s390x * scsi-disk: support setting CD-ROM block size via device options 2022-10-13 13:55:03 -04:00
sh4 target/sh4: Fix TB_FLAG_UNALIGN 2022-10-04 12:33:05 -07:00
sparc accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
tricore accel/tcg: Introduce tb_pc and log_pc 2022-10-04 12:13:12 -07:00
xtensa hw/core: Add CPUClass.get_pc 2022-10-04 12:13:12 -07:00
Kconfig hw/loongarch: Add support loongson3 virt machine type. 2022-06-06 18:09:03 +00:00
meson.build target/loongarch: Add target build suport 2022-06-06 18:09:03 +00:00