From: Alistair Francis Date: Thu, 26 Mar 2020 22:44:07 +0000 (-0700) Subject: riscv: Don't use stage-2 PTE lookup protection flags X-Git-Tag: v5.1.0-rc0~154^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=384728905441279e54fa3d714b11bf1b1bcbfd27;p=thirdparty%2Fqemu.git riscv: Don't use stage-2 PTE lookup protection flags When doing the fist of a two stage lookup (Hypervisor extensions) don't set the current protection flags from the second stage lookup of the base address PTE. Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson Tested-by: Anup Patel Message-id: 931db85d6890ed4bc2b527fd1011197cd28299aa.1585262586.git.alistair.francis@wdc.com Message-Id: <931db85d6890ed4bc2b527fd1011197cd28299aa.1585262586.git.alistair.francis@wdc.com> --- diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index d3ba9efb02b..f36d184b7bf 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -452,10 +452,11 @@ restart: hwaddr pte_addr; if (two_stage && first_stage) { + int vbase_prot; hwaddr vbase; /* Do the second stage translation on the base PTE address. */ - get_physical_address(env, &vbase, prot, base, access_type, + get_physical_address(env, &vbase, &vbase_prot, base, access_type, mmu_idx, false, true); pte_addr = vbase + idx * ptesize;