diff --git a/qemu/hw/arm/virt.c b/qemu/hw/arm/virt.c index fe6d2206..64344cfe 100644 --- a/qemu/hw/arm/virt.c +++ b/qemu/hw/arm/virt.c @@ -64,7 +64,9 @@ static int machvirt_init(struct uc_struct *uc, MachineState *machine) int n; if (!cpu_model) { - cpu_model = "cortex-a57"; // ARM64 + // Unicorn: "any" used instead to allow use of ARMv8.1+ instructions. + //cpu_model = "cortex-a57"; // ARM64 + cpu_model = "any"; } for (n = 0; n < smp_cpus; n++) { diff --git a/qemu/target/arm/cpu64.c b/qemu/target/arm/cpu64.c index 627e9e98..55bc79ee 100644 --- a/qemu/target/arm/cpu64.c +++ b/qemu/target/arm/cpu64.c @@ -188,7 +188,7 @@ static void aarch64_a53_initfn(struct uc_struct *uc, Object *obj, void *opaque) define_arm_cp_regs(cpu, cortex_a57_a53_cp_reginfo); } -#ifdef CONFIG_USER_ONLY +// Unicorn: enabled for the general use-case as well. static void aarch64_any_initfn(struct uc_struct *uc, Object *obj, void *opaque) { ARMCPU *cpu = ARM_CPU(uc, obj); @@ -212,7 +212,6 @@ static void aarch64_any_initfn(struct uc_struct *uc, Object *obj, void *opaque) cpu->ctr = 0x80038003; /* 32 byte I and D cacheline size, VIPT icache */ cpu->dcz_blocksize = 7; /* 512 bytes */ } -#endif typedef struct ARMCPUInfo { const char *name; @@ -223,9 +222,8 @@ typedef struct ARMCPUInfo { static const ARMCPUInfo aarch64_cpus[] = { { "cortex-a57", aarch64_a57_initfn }, { "cortex-a53", aarch64_a53_initfn }, -#ifdef CONFIG_USER_ONLY + // Unicorn: enabled for the general use case as well { "any", aarch64_any_initfn }, -#endif { NULL } };