]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/riscv: Gate hardware A/D PTE bit updating
authorAndrew Jones <ajones@ventanamicro.com>
Thu, 15 Feb 2024 22:39:54 +0000 (19:39 -0300)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 8 Mar 2024 06:34:06 +0000 (16:34 +1000)
commit70d22fd92c3bacd15e6ba423999a1cf4a5e2e819
treefdbf2e75b36b5147c5b02a4986646531c1841d7e
parent148189ff1313e995a0a84957c496ff92965151a2
target/riscv: Gate hardware A/D PTE bit updating

Gate hardware A/D PTE bit updating on {m,h}envcfg.ADUE and only
enable menvcfg.ADUE on reset if svade has not been selected. Now
that we also consider svade, we have four possible configurations:

 1) !svade && !svadu
    use hardware updating and there's no way to disable it
    (the default, which maintains past behavior. Maintaining
     the default, even with !svadu is a change that fixes [1])

 2) !svade && svadu
    use hardware updating, but also provide {m,h}envcfg.ADUE,
    allowing software to switch to exception mode
    (being able to switch is a change which fixes [1])

 3) svade && !svadu
    use exception mode and there's no way to switch to hardware
    updating
    (this behavior change fixes [2])

 4) svade && svadu
    use exception mode, but also provide {m,h}envcfg.ADUE,
    allowing software to switch to hardware updating
    (this behavior change fixes [2])

Fixes: 0af3f115e68e ("target/riscv: Add *envcfg.HADE related check in address translation") [1]
Fixes: 48531f5adb2a ("target/riscv: implement svade") [2]
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240215223955.969568-6-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/cpu.c
target/riscv/cpu_helper.c
target/riscv/tcg/tcg-cpu.c