target/riscv/machine.c: do not migrate pmp state with kvm
The PMP emulation isn't present in the KVM driver. Signed-off-by: Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20260703180538.3346781-6-daniel.barboza@oss.qualcomm.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
committed by
Alistair Francis
parent
d45b9bc655
commit
6f6f6aaa26
@@ -20,6 +20,7 @@
|
||||
#include "cpu.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "system/kvm.h"
|
||||
#include "system/tcg.h"
|
||||
#include "migration/cpu.h"
|
||||
#include "exec/icount.h"
|
||||
#include "target/riscv/debug.h"
|
||||
@@ -29,21 +30,25 @@ static bool pmp_needed(void *opaque)
|
||||
{
|
||||
RISCVCPU *cpu = opaque;
|
||||
|
||||
return cpu->cfg.pmp;
|
||||
if (kvm_enabled()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return tcg_enabled() && cpu->cfg.pmp;
|
||||
}
|
||||
|
||||
static int pmp_post_load(void *opaque, int version_id)
|
||||
{
|
||||
#ifdef CONFIG_TCG
|
||||
RISCVCPU *cpu = opaque;
|
||||
CPURISCVState *env = &cpu->env;
|
||||
int i;
|
||||
uint8_t pmp_regions = riscv_cpu_cfg(env)->pmp_regions;
|
||||
|
||||
for (i = 0; i < pmp_regions; i++) {
|
||||
for (int i = 0; i < pmp_regions; i++) {
|
||||
pmp_update_rule_addr(env, i);
|
||||
}
|
||||
pmp_update_rule_nums(env);
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user