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.

Backports commit 384728905441279e54fa3d714b11bf1b1bcbfd27 from qemu
This commit is contained in:
Alistair Francis 2020-04-30 20:51:57 -04:00 committed by Lioncash
parent 6d9233a542
commit b6e2cf33df

View file

@ -446,10 +446,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;