target-arm queue:
* Correct minor errors in Cortex-A710 definition * Implement Neoverse N2 CPU model * Refactor feature test functions out into separate header * Fix syndrome for FGT traps on ERET * Remove 'hw/arm/boot.h' includes from various header files * pxa2xx: Refactoring/cleanup * Avoid using 'first_cpu' when first ARM CPU is reachable * misc/led: LED state is set opposite of what is expected * hw/net/cadence_gen: clean up to use FIELD macros * hw/net/cadence_gem: perform PHY access on write only * hw/net/cadence_gem: enforce 32 bits variable size for CRC -----BEGIN PGP SIGNATURE----- iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmU7yz0ZHHBldGVyLm1h eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3n4xEACK4ti+PFSJHVCQ69NzLLBT ybFGFMsMhXJTSNS30Pzs+KWCKWPP59knYBD4qO43W1iV6pPUhy+skr+BFCCRvBow se74+Fm1l4LmnuHxgukJzTdvRffI3v37alLn6Y/ioWe8bDpf/IJj8WLj8B1IPoNg fswJSGDLpPMovaz8NBQRzglUWpfyzxH+uuW779qBS1nuFdPOfIHKrocvvdrfogBP aO8AeiBzz5STW9Naeq+BIKho8S9LinSB6FHa+rRPUDkWx03lvRIvkgGPzHpXYy8I zAZ8gUQZyXprHAHMpnoBv8Wcw3Bwc2f+8xx8hnRRki3iBroXKfJA9NkeN0StQmL1 ZHhfYkiKSS5diIFW5pX6ZixKbXHE2a4aH4zPVUNQriNWOevhe7n82mAPNFIYjk97 ciTtd4I2oew48sDLSodMiirGL987Mit7KC23itVGezcNfQ9FnVTDmuGy8Rq52BZm u4TZjVBrtjQOdMBUcD2hKvXhikQNAdOhArPwNfOr0esSQL44MMEe+6Q5/Cbp0BOE stAY/xwSP2cY5mIPnAbIBELseEZsV8ySA3M0y1iRCJptjwbyWM+s1TYz0iXcqeOn l6LfiI6r1BqUeoWLGP4042R4FLyLNh6gU/TiFNLu7JJQjXl/EkRgqVXWYfzy2n51 KKY6iGFi5r41sAU6GIXOkQ== =szC7 -----END PGP SIGNATURE----- Merge tag 'pull-target-arm-20231027' of https://git-us.linaro.org/people/pmaydell/qemu-arm into staging target-arm queue: * Correct minor errors in Cortex-A710 definition * Implement Neoverse N2 CPU model * Refactor feature test functions out into separate header * Fix syndrome for FGT traps on ERET * Remove 'hw/arm/boot.h' includes from various header files * pxa2xx: Refactoring/cleanup * Avoid using 'first_cpu' when first ARM CPU is reachable * misc/led: LED state is set opposite of what is expected * hw/net/cadence_gen: clean up to use FIELD macros * hw/net/cadence_gem: perform PHY access on write only * hw/net/cadence_gem: enforce 32 bits variable size for CRC # -----BEGIN PGP SIGNATURE----- # # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmU7yz0ZHHBldGVyLm1h # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3n4xEACK4ti+PFSJHVCQ69NzLLBT # ybFGFMsMhXJTSNS30Pzs+KWCKWPP59knYBD4qO43W1iV6pPUhy+skr+BFCCRvBow # se74+Fm1l4LmnuHxgukJzTdvRffI3v37alLn6Y/ioWe8bDpf/IJj8WLj8B1IPoNg # fswJSGDLpPMovaz8NBQRzglUWpfyzxH+uuW779qBS1nuFdPOfIHKrocvvdrfogBP # aO8AeiBzz5STW9Naeq+BIKho8S9LinSB6FHa+rRPUDkWx03lvRIvkgGPzHpXYy8I # zAZ8gUQZyXprHAHMpnoBv8Wcw3Bwc2f+8xx8hnRRki3iBroXKfJA9NkeN0StQmL1 # ZHhfYkiKSS5diIFW5pX6ZixKbXHE2a4aH4zPVUNQriNWOevhe7n82mAPNFIYjk97 # ciTtd4I2oew48sDLSodMiirGL987Mit7KC23itVGezcNfQ9FnVTDmuGy8Rq52BZm # u4TZjVBrtjQOdMBUcD2hKvXhikQNAdOhArPwNfOr0esSQL44MMEe+6Q5/Cbp0BOE # stAY/xwSP2cY5mIPnAbIBELseEZsV8ySA3M0y1iRCJptjwbyWM+s1TYz0iXcqeOn # l6LfiI6r1BqUeoWLGP4042R4FLyLNh6gU/TiFNLu7JJQjXl/EkRgqVXWYfzy2n51 # KKY6iGFi5r41sAU6GIXOkQ== # =szC7 # -----END PGP SIGNATURE----- # gpg: Signature made Fri 27 Oct 2023 23:37:49 JST # gpg: using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE # gpg: issuer "peter.maydell@linaro.org" # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full] # gpg: aka "Peter Maydell <pmaydell@gmail.com>" [full] # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full] # gpg: aka "Peter Maydell <peter@archaic.org.uk>" [unknown] # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * tag 'pull-target-arm-20231027' of https://git-us.linaro.org/people/pmaydell/qemu-arm: (41 commits) hw/net/cadence_gem: enforce 32 bits variable size for CRC hw/net/cadence_gem: perform PHY access on write only hw/net/cadence_gem: use FIELD to describe PHYMNTNC register fields hw/net/cadence_gem: use FIELD to describe DESCONF6 register fields hw/net/cadence_gem: use FIELD to describe IRQ register fields hw/net/cadence_gem: use FIELD to describe [TX|RX]STATUS register fields hw/net/cadence_gem: use FIELD to describe DMACFG register fields hw/net/cadence_gem: use FIELD to describe NWCFG register fields hw/net/cadence_gem: use FIELD to describe NWCTRL register fields hw/net/cadence_gem: use FIELD for screening registers hw/net/cadence_gem: use REG32 macro for register definitions misc/led: LED state is set opposite of what is expected hw/arm: Avoid using 'first_cpu' when first ARM CPU is reachable hw/arm/pxa2xx: Realize PXA2XX_I2C device before accessing it hw/intc/pxa2xx: Factor pxa2xx_pic_realize() out of pxa2xx_pic_init() hw/intc/pxa2xx: Pass CPU reference using QOM link property hw/intc/pxa2xx: Convert to Resettable interface hw/pcmcia/pxa2xx: Inline pxa2xx_pcmcia_init() hw/pcmcia/pxa2xx: Do not open-code sysbus_create_simple() hw/pcmcia/pxa2xx: Realize sysbus device before accessing it ... Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
commit
850e874f1c
@ -21,6 +21,7 @@
|
||||
#define TARGET_ARCH_H
|
||||
|
||||
#include "qemu.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
|
||||
void target_cpu_set_tls(CPUARMState *env, target_ulong newtls);
|
||||
target_ulong target_cpu_get_tls(CPUARMState *env);
|
||||
|
@ -63,6 +63,7 @@ Supported guest CPU types:
|
||||
- ``host`` (with KVM only)
|
||||
- ``neoverse-n1`` (64-bit)
|
||||
- ``neoverse-v1`` (64-bit)
|
||||
- ``neoverse-n2`` (64-bit)
|
||||
- ``max`` (same as ``host`` for KVM; best possible emulation with TCG)
|
||||
|
||||
Note that the default is ``cortex-a15``, so for an AArch64 guest you must
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "qemu/module.h"
|
||||
#include "qemu/log.h"
|
||||
#include "target/arm/idau.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
#include "migration/vmstate.h"
|
||||
|
||||
/* Bitbanded IO. Each word corresponds to a single bit. */
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "hw/i2c/i2c.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/allwinner-r40.h"
|
||||
#include "hw/arm/boot.h"
|
||||
|
||||
static struct arm_boot_info bpim2u_binfo;
|
||||
|
||||
@ -127,7 +128,7 @@ static void bpim2u_init(MachineState *machine)
|
||||
bpim2u_binfo.loader_start = r40->memmap[AW_R40_DEV_SDRAM];
|
||||
bpim2u_binfo.ram_size = machine->ram_size;
|
||||
bpim2u_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &bpim2u_binfo);
|
||||
arm_load_kernel(&r40->cpus[0], machine, &bpim2u_binfo);
|
||||
}
|
||||
|
||||
static void bpim2u_machine_init(MachineClass *mc)
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/allwinner-a10.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/i2c/i2c.h"
|
||||
|
||||
static struct arm_boot_info cubieboard_binfo = {
|
||||
|
@ -134,9 +134,10 @@ exynos4_boards_init_common(MachineState *machine,
|
||||
|
||||
static void nuri_init(MachineState *machine)
|
||||
{
|
||||
exynos4_boards_init_common(machine, EXYNOS4_BOARD_NURI);
|
||||
Exynos4BoardState *s = exynos4_boards_init_common(machine,
|
||||
EXYNOS4_BOARD_NURI);
|
||||
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &exynos4_board_binfo);
|
||||
arm_load_kernel(s->soc.cpu[0], machine, &exynos4_board_binfo);
|
||||
}
|
||||
|
||||
static void smdkc210_init(MachineState *machine)
|
||||
@ -146,7 +147,7 @@ static void smdkc210_init(MachineState *machine)
|
||||
|
||||
lan9215_init(SMDK_LAN9118_BASE_ADDR,
|
||||
qemu_irq_invert(s->soc.irq_table[exynos4210_get_irq(37, 1)]));
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &exynos4_board_binfo);
|
||||
arm_load_kernel(s->soc.cpu[0], machine, &exynos4_board_binfo);
|
||||
}
|
||||
|
||||
static void nuri_class_init(ObjectClass *oc, void *data)
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "qapi/error.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/fsl-imx25.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "sysemu/qtest.h"
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/arm/fsl-imx31.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "exec/address-spaces.h"
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/arm/fsl-imx6ul.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/arm/fsl-imx7.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/allwinner-h3.h"
|
||||
#include "hw/arm/boot.h"
|
||||
|
||||
static struct arm_boot_info orangepi_binfo;
|
||||
|
||||
@ -105,7 +106,7 @@ static void orangepi_init(MachineState *machine)
|
||||
orangepi_binfo.loader_start = h3->memmap[AW_H3_DEV_SDRAM];
|
||||
orangepi_binfo.ram_size = machine->ram_size;
|
||||
orangepi_binfo.psci_conduit = QEMU_PSCI_CONDUIT_SMC;
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &orangepi_binfo);
|
||||
arm_load_kernel(&h3->cpus[0], machine, &orangepi_binfo);
|
||||
}
|
||||
|
||||
static void orangepi_machine_init(MachineClass *mc)
|
||||
|
@ -1513,14 +1513,15 @@ PXA2xxI2CState *pxa2xx_i2c_init(hwaddr base,
|
||||
qdev_prop_set_uint32(dev, "size", region_size + 1);
|
||||
qdev_prop_set_uint32(dev, "offset", base & region_size);
|
||||
|
||||
/* FIXME: Should the slave device really be on a separate bus? */
|
||||
i2cbus = i2c_init_bus(dev, "dummy");
|
||||
|
||||
i2c_dev = SYS_BUS_DEVICE(dev);
|
||||
sysbus_realize_and_unref(i2c_dev, &error_fatal);
|
||||
sysbus_mmio_map(i2c_dev, 0, base & ~region_size);
|
||||
sysbus_connect_irq(i2c_dev, 0, irq);
|
||||
|
||||
s = PXA2XX_I2C(i2c_dev);
|
||||
/* FIXME: Should the slave device really be on a separate bus? */
|
||||
i2cbus = i2c_init_bus(dev, "dummy");
|
||||
s->slave = PXA2XX_I2C_SLAVE(i2c_slave_create_simple(i2cbus,
|
||||
TYPE_PXA2XX_I2C_SLAVE,
|
||||
0));
|
||||
@ -2205,8 +2206,10 @@ PXA2xxState *pxa270_init(unsigned int sdram_size, const char *cpu_type)
|
||||
sysbus_create_simple("sysbus-ohci", 0x4c000000,
|
||||
qdev_get_gpio_in(s->pic, PXA2XX_PIC_USBH1));
|
||||
|
||||
s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000);
|
||||
s->pcmcia[1] = pxa2xx_pcmcia_init(address_space, 0x30000000);
|
||||
s->pcmcia[0] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA,
|
||||
0x20000000, NULL));
|
||||
s->pcmcia[1] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA,
|
||||
0x30000000, NULL));
|
||||
|
||||
sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000,
|
||||
qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM));
|
||||
@ -2338,8 +2341,10 @@ PXA2xxState *pxa255_init(unsigned int sdram_size)
|
||||
s->ssp[i] = (SSIBus *)qdev_get_child_bus(dev, "ssi");
|
||||
}
|
||||
|
||||
s->pcmcia[0] = pxa2xx_pcmcia_init(address_space, 0x20000000);
|
||||
s->pcmcia[1] = pxa2xx_pcmcia_init(address_space, 0x30000000);
|
||||
s->pcmcia[0] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA,
|
||||
0x20000000, NULL));
|
||||
s->pcmcia[1] = PXA2XX_PCMCIA(sysbus_create_simple(TYPE_PXA2XX_PCMCIA,
|
||||
0x30000000, NULL));
|
||||
|
||||
sysbus_create_simple(TYPE_PXA2XX_RTC, 0x40900000,
|
||||
qdev_get_gpio_in(s->pic, PXA2XX_PIC_RTCALARM));
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "cpu.h"
|
||||
#include "hw/arm/pxa.h"
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "migration/vmstate.h"
|
||||
#include "qom/object.h"
|
||||
#include "target/arm/cpregs.h"
|
||||
@ -271,12 +272,9 @@ static int pxa2xx_pic_post_load(void *opaque, int version_id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
|
||||
static void pxa2xx_pic_reset_hold(Object *obj)
|
||||
{
|
||||
DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC);
|
||||
PXA2xxPICState *s = PXA2XX_PIC(dev);
|
||||
|
||||
s->cpu = cpu;
|
||||
PXA2xxPICState *s = PXA2XX_PIC(obj);
|
||||
|
||||
s->int_pending[0] = 0;
|
||||
s->int_pending[1] = 0;
|
||||
@ -284,8 +282,23 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
|
||||
s->int_enabled[1] = 0;
|
||||
s->is_fiq[0] = 0;
|
||||
s->is_fiq[1] = 0;
|
||||
}
|
||||
|
||||
DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
|
||||
{
|
||||
DeviceState *dev = qdev_new(TYPE_PXA2XX_PIC);
|
||||
|
||||
object_property_set_link(OBJECT(dev), "arm-cpu",
|
||||
OBJECT(cpu), &error_abort);
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
static void pxa2xx_pic_realize(DeviceState *dev, Error **errp)
|
||||
{
|
||||
PXA2xxPICState *s = PXA2XX_PIC(dev);
|
||||
|
||||
qdev_init_gpio_in(dev, pxa2xx_pic_set_irq, PXA2XX_PIC_SRCS);
|
||||
|
||||
@ -293,12 +306,9 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)
|
||||
memory_region_init_io(&s->iomem, OBJECT(s), &pxa2xx_pic_ops, s,
|
||||
"pxa2xx-pic", 0x00100000);
|
||||
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
||||
|
||||
/* Enable IC coprocessor access. */
|
||||
define_arm_cp_regs_with_opaque(cpu, pxa_pic_cp_reginfo, s);
|
||||
|
||||
return dev;
|
||||
define_arm_cp_regs_with_opaque(s->cpu, pxa_pic_cp_reginfo, s);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_pxa2xx_pic_regs = {
|
||||
@ -316,12 +326,22 @@ static const VMStateDescription vmstate_pxa2xx_pic_regs = {
|
||||
},
|
||||
};
|
||||
|
||||
static Property pxa2xx_pic_properties[] = {
|
||||
DEFINE_PROP_LINK("arm-cpu", PXA2xxPICState, cpu,
|
||||
TYPE_ARM_CPU, ARMCPU *),
|
||||
DEFINE_PROP_END_OF_LIST(),
|
||||
};
|
||||
|
||||
static void pxa2xx_pic_class_init(ObjectClass *klass, void *data)
|
||||
{
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
ResettableClass *rc = RESETTABLE_CLASS(klass);
|
||||
|
||||
device_class_set_props(dc, pxa2xx_pic_properties);
|
||||
dc->realize = pxa2xx_pic_realize;
|
||||
dc->desc = "PXA2xx PIC";
|
||||
dc->vmsd = &vmstate_pxa2xx_pic_regs;
|
||||
rc->phases.hold = pxa2xx_pic_reset_hold;
|
||||
}
|
||||
|
||||
static const TypeInfo pxa2xx_pic_info = {
|
||||
|
@ -384,7 +384,7 @@ static void realview_init(MachineState *machine,
|
||||
realview_binfo.ram_size = ram_size;
|
||||
realview_binfo.board_id = realview_board_id[board_type];
|
||||
realview_binfo.loader_start = (board_type == BOARD_PB_A8 ? 0x70000000 : 0);
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &realview_binfo);
|
||||
arm_load_kernel(cpu, machine, &realview_binfo);
|
||||
}
|
||||
|
||||
static void realview_eb_init(MachineState *machine)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/arm/fsl-imx6.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qemu/error-report.h"
|
||||
|
@ -149,6 +149,7 @@ static const char * const valid_cpus[] = {
|
||||
ARM_CPU_TYPE_NAME("cortex-a72"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-n1"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-v1"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-n2"),
|
||||
ARM_CPU_TYPE_NAME("max"),
|
||||
};
|
||||
|
||||
|
@ -215,6 +215,7 @@ static const char *valid_cpus[] = {
|
||||
ARM_CPU_TYPE_NAME("a64fx"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-n1"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-v1"),
|
||||
ARM_CPU_TYPE_NAME("neoverse-n2"),
|
||||
#endif
|
||||
ARM_CPU_TYPE_NAME("cortex-a53"),
|
||||
ARM_CPU_TYPE_NAME("cortex-a57"),
|
||||
|
@ -349,7 +349,7 @@ static void zynq_init(MachineState *machine)
|
||||
zynq_binfo.board_setup_addr = BOARD_SETUP_ADDR;
|
||||
zynq_binfo.write_board_setup = zynq_write_board_setup;
|
||||
|
||||
arm_load_kernel(ARM_CPU(first_cpu), machine, &zynq_binfo);
|
||||
arm_load_kernel(cpu, machine, &zynq_binfo);
|
||||
}
|
||||
|
||||
static void zynq_machine_class_init(ObjectClass *oc, void *data)
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "cpu.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "hw/arm/xlnx-versal.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "qom/object.h"
|
||||
|
||||
#define TYPE_XLNX_VERSAL_VIRT_MACHINE MACHINE_TYPE_NAME("xlnx-versal-virt")
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/arm/xlnx-zynqmp.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/log.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "sysemu/tcg.h"
|
||||
#include "sysemu/runstate.h"
|
||||
#include "target/arm/cpu.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/memop.h"
|
||||
#include "qemu/log.h"
|
||||
|
@ -63,7 +63,7 @@ static void led_set_state_gpio_handler(void *opaque, int line, int new_state)
|
||||
LEDState *s = LED(opaque);
|
||||
|
||||
assert(line == 0);
|
||||
led_set_state(s, !!new_state != s->gpio_active_high);
|
||||
led_set_state(s, !!new_state == s->gpio_active_high);
|
||||
}
|
||||
|
||||
static void led_reset(DeviceState *dev)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -138,21 +138,6 @@ static void pxa2xx_pcmcia_set_irq(void *opaque, int line, int level)
|
||||
qemu_set_irq(s->irq, level);
|
||||
}
|
||||
|
||||
PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
|
||||
hwaddr base)
|
||||
{
|
||||
DeviceState *dev;
|
||||
PXA2xxPCMCIAState *s;
|
||||
|
||||
dev = qdev_new(TYPE_PXA2XX_PCMCIA);
|
||||
sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, base);
|
||||
s = PXA2XX_PCMCIA(dev);
|
||||
|
||||
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
static void pxa2xx_pcmcia_initfn(Object *obj)
|
||||
{
|
||||
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
|
||||
|
@ -479,15 +479,10 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem,
|
||||
qemu_irq irq, qemu_irq rx_dma, qemu_irq tx_dma)
|
||||
{
|
||||
DeviceState *dev;
|
||||
SysBusDevice *sbd;
|
||||
|
||||
dev = qdev_new(TYPE_PXA2XX_MMCI);
|
||||
sbd = SYS_BUS_DEVICE(dev);
|
||||
sysbus_mmio_map(sbd, 0, base);
|
||||
sysbus_connect_irq(sbd, 0, irq);
|
||||
dev = sysbus_create_simple(TYPE_PXA2XX_MMCI, base, irq);
|
||||
qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma);
|
||||
qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma);
|
||||
sysbus_realize_and_unref(sbd, &error_fatal);
|
||||
|
||||
return PXA2XX_MMCI(dev);
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef HW_ARM_ALLWINNER_A10_H
|
||||
#define HW_ARM_ALLWINNER_A10_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/timer/allwinner-a10-pit.h"
|
||||
#include "hw/intc/allwinner-a10-pic.h"
|
||||
#include "hw/net/allwinner_emac.h"
|
||||
|
@ -36,7 +36,6 @@
|
||||
#define HW_ARM_ALLWINNER_H3_H
|
||||
|
||||
#include "qom/object.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/timer/allwinner-a10-pit.h"
|
||||
#include "hw/intc/arm_gic.h"
|
||||
#include "hw/misc/allwinner-h3-ccu.h"
|
||||
|
@ -21,7 +21,6 @@
|
||||
#define HW_ARM_ALLWINNER_R40_H
|
||||
|
||||
#include "qom/object.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/timer/allwinner-a10-pit.h"
|
||||
#include "hw/intc/arm_gic.h"
|
||||
#include "hw/sd/allwinner-sdhost.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#ifndef FSL_IMX25_H
|
||||
#define FSL_IMX25_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/intc/imx_avic.h"
|
||||
#include "hw/misc/imx25_ccm.h"
|
||||
#include "hw/char/imx_serial.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#ifndef FSL_IMX31_H
|
||||
#define FSL_IMX31_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/intc/imx_avic.h"
|
||||
#include "hw/misc/imx31_ccm.h"
|
||||
#include "hw/char/imx_serial.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#ifndef FSL_IMX6_H
|
||||
#define FSL_IMX6_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/cpu/a9mpcore.h"
|
||||
#include "hw/misc/imx6_ccm.h"
|
||||
#include "hw/misc/imx6_src.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#ifndef FSL_IMX6UL_H
|
||||
#define FSL_IMX6UL_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/cpu/a15mpcore.h"
|
||||
#include "hw/misc/imx6ul_ccm.h"
|
||||
#include "hw/misc/imx6_src.h"
|
||||
|
@ -19,7 +19,6 @@
|
||||
#ifndef FSL_IMX7_H
|
||||
#define FSL_IMX7_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/cpu/a15mpcore.h"
|
||||
#include "hw/intc/imx_gpcv2.h"
|
||||
#include "hw/misc/imx7_ccm.h"
|
||||
|
@ -100,8 +100,6 @@ void pxa2xx_mmci_handlers(PXA2xxMMCIState *s, qemu_irq readonly,
|
||||
#define TYPE_PXA2XX_PCMCIA "pxa2xx-pcmcia"
|
||||
OBJECT_DECLARE_SIMPLE_TYPE(PXA2xxPCMCIAState, PXA2XX_PCMCIA)
|
||||
|
||||
PXA2xxPCMCIAState *pxa2xx_pcmcia_init(MemoryRegion *sysmem,
|
||||
hwaddr base);
|
||||
int pxa2xx_pcmcia_attach(void *opaque, PCMCIACardState *card);
|
||||
int pxa2xx_pcmcia_detach(void *opaque);
|
||||
void pxa2xx_pcmcia_set_irq_cb(void *opaque, qemu_irq irq, qemu_irq cd_irq);
|
||||
|
@ -13,7 +13,6 @@
|
||||
#define XLNX_VERSAL_H
|
||||
|
||||
#include "hw/sysbus.h"
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/cpu/cluster.h"
|
||||
#include "hw/or-irq.h"
|
||||
#include "hw/sd/sdhci.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#ifndef XLNX_ZYNQMP_H
|
||||
#define XLNX_ZYNQMP_H
|
||||
|
||||
#include "hw/arm/boot.h"
|
||||
#include "hw/intc/arm_gic.h"
|
||||
#include "hw/net/cadence_gem.h"
|
||||
#include "hw/char/cadence_uart.h"
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "qemu/guest-random.h"
|
||||
#include "semihosting/common-semi.h"
|
||||
#include "target/arm/syndrome.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
|
||||
#define get_user_code_u32(x, gaddr, env) \
|
||||
({ abi_long __r = get_user_u32((x), (gaddr)); \
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "user-internals.h"
|
||||
#include "signal-common.h"
|
||||
#include "linux-user/trace.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
|
||||
struct target_sigcontext {
|
||||
uint64_t fault_address;
|
||||
|
@ -6,6 +6,8 @@
|
||||
#ifndef AARCH64_TARGET_PRCTL_H
|
||||
#define AARCH64_TARGET_PRCTL_H
|
||||
|
||||
#include "target/arm/cpu-features.h"
|
||||
|
||||
static abi_long do_prctl_sve_get_vl(CPUArchState *env)
|
||||
{
|
||||
ARMCPU *cpu = env_archcpu(env);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "user-internals.h"
|
||||
#include "signal-common.h"
|
||||
#include "linux-user/trace.h"
|
||||
#include "target/arm/cpu-features.h"
|
||||
|
||||
struct target_sigcontext {
|
||||
abi_ulong trap_no;
|
||||
|
@ -23,6 +23,10 @@
|
||||
#include "target_signal.h"
|
||||
#include "accel/tcg/debuginfo.h"
|
||||
|
||||
#ifdef TARGET_ARM
|
||||
#include "target/arm/cpu-features.h"
|
||||
#endif
|
||||
|
||||
#ifdef _ARCH_PPC64
|
||||
#undef ARCH_DLINFO
|
||||
#undef ELF_PLATFORM
|
||||
|
@ -26,6 +26,10 @@
|
||||
#include "target_mman.h"
|
||||
#include "qemu/interval-tree.h"
|
||||
|
||||
#ifdef TARGET_ARM
|
||||
#include "target/arm/cpu-features.h"
|
||||
#endif
|
||||
|
||||
static pthread_mutex_t mmap_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
static __thread int mmap_lock_count;
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "cpu.h"
|
||||
#include "elf.h"
|
||||
#include "sysemu/dump.h"
|
||||
#include "cpu-features.h"
|
||||
|
||||
/* struct user_pt_regs from arch/arm64/include/uapi/asm/ptrace.h */
|
||||
struct aarch64_user_regs {
|
||||
|
994
target/arm/cpu-features.h
Normal file
994
target/arm/cpu-features.h
Normal file
@ -0,0 +1,994 @@
|
||||
/*
|
||||
* QEMU Arm CPU -- feature test functions
|
||||
*
|
||||
* Copyright (c) 2023 Linaro Ltd
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef TARGET_ARM_FEATURES_H
|
||||
#define TARGET_ARM_FEATURES_H
|
||||
|
||||
/*
|
||||
* Naming convention for isar_feature functions:
|
||||
* Functions which test 32-bit ID registers should have _aa32_ in
|
||||
* their name. Functions which test 64-bit ID registers should have
|
||||
* _aa64_ in their name. These must only be used in code where we
|
||||
* know for certain that the CPU has AArch32 or AArch64 respectively
|
||||
* or where the correct answer for a CPU which doesn't implement that
|
||||
* CPU state is "false" (eg when generating A32 or A64 code, if adding
|
||||
* system registers that are specific to that CPU state, for "should
|
||||
* we let this system register bit be set" tests where the 32-bit
|
||||
* flavour of the register doesn't have the bit, and so on).
|
||||
* Functions which simply ask "does this feature exist at all" have
|
||||
* _any_ in their name, and always return the logical OR of the _aa64_
|
||||
* and the _aa32_ function.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 32-bit feature tests via id registers.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_arm_div(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_lob(const ARMISARegisters *id)
|
||||
{
|
||||
/* (M-profile) low-overhead loops and branch future */
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, CMPBRANCH) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_jazelle(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar1, ID_ISAR1, JAZELLE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmull(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sha1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sha2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_crc32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, CRC32) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_rdm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, RDM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vcma(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, VCMA) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_jscvt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, JSCVT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_dp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, DP) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fhm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, FHM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, SB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, SPECRES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, BF16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr0, ID_PFR0, RAS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mprofile(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr1, ID_PFR1, MPROGMOD) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if M-profile state handling insns
|
||||
* (VSCCLRM, CLRM, FPCTX access insns) are implemented
|
||||
*/
|
||||
return FIELD_EX32(id->id_pfr1, ID_PFR1, SECURITY) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id)
|
||||
{
|
||||
/* Sadly this is encoded differently for A-profile and M-profile */
|
||||
if (isar_feature_aa32_mprofile(id)) {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FP16) > 0;
|
||||
} else {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) >= 3;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mve(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if MVE is supported (either integer or floating point).
|
||||
* We must check for M-profile as the MVFR1 field means something
|
||||
* else for A-profile.
|
||||
*/
|
||||
return isar_feature_aa32_mprofile(id) &&
|
||||
FIELD_EX32(id->mvfr1, MVFR1, MVE) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mve_fp(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if MVE is supported (either integer or floating point).
|
||||
* We must check for M-profile as the MVFR1 field means something
|
||||
* else for A-profile.
|
||||
*/
|
||||
return isar_feature_aa32_mprofile(id) &&
|
||||
FIELD_EX32(id->mvfr1, MVFR1, MVE) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vfp_simd(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if either VFP or SIMD is implemented.
|
||||
* In this case, a minimum of VFP w/ D0-D15.
|
||||
*/
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_simd_r32(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if D16-D31 are implemented */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpsp_v2(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports single precision floating point, VFPv2 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpsp_v3(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports single precision floating point, VFPv3 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSP) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports double precision floating point, VFPv2 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpdp_v3(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports double precision floating point, VFPv3 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPDP) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vfp(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa32_fpsp_v2(id) || isar_feature_aa32_fpdp_v2(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* We always set the FP and SIMD FP16 fields to indicate identical
|
||||
* levels of support (assuming SIMD is implemented at all), so
|
||||
* we only need one set of accessors.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_fp16_spconv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fp16_dpconv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that this ID register field covers both VFP and Neon FMAC,
|
||||
* so should usually be tested in combination with some other
|
||||
* check that confirms the presence of whichever of VFP or Neon is
|
||||
* relevant, to avoid accidentally enabling a Neon feature on
|
||||
* a VFP-no-Neon core or vice-versa.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_simdfmac(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, SIMDFMAC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vsel(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vcvt_dr(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vrint(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vminmaxnm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 4;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr0, ID_MMFR0, VMSA) >= 4;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pan(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 4 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 5 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 6 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, HPDS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ac2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, AC2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, CCIDX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, XNX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_dit(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr0, ID_PFR0, DIT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr2, ID_PFR2, SSBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 5;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 8;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->dbgdevid, DBGDEVID, DOUBLELOCK) > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 64-bit feature tests via id registers.
|
||||
*/
|
||||
static inline bool isar_feature_aa64_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmull(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, AES) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha256(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha512(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA2) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_crc32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, CRC32) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_atomics(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, ATOMIC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rdm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, RDM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sm3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SM3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sm4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SM4) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, DP) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fhm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, FHM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_condm_4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_condm_5(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rndr(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, RNDR) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tlbirange(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) == 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tlbios(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_jscvt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, JSCVT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fcma(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, FCMA) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* These are the values from APA/API/APA3.
|
||||
* In general these must be compared '>=', per the normal Arm ARM
|
||||
* treatment of fields in ID registers.
|
||||
*/
|
||||
typedef enum {
|
||||
PauthFeat_None = 0,
|
||||
PauthFeat_1 = 1,
|
||||
PauthFeat_EPAC = 2,
|
||||
PauthFeat_2 = 3,
|
||||
PauthFeat_FPAC = 4,
|
||||
PauthFeat_FPACCOMBINED = 5,
|
||||
} ARMPauthFeature;
|
||||
|
||||
static inline ARMPauthFeature
|
||||
isar_feature_pauth_feature(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Architecturally, only one of {APA,API,APA3} may be active (non-zero)
|
||||
* and the other two must be zero. Thus we may avoid conditionals.
|
||||
*/
|
||||
return (FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, APA) |
|
||||
FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, API) |
|
||||
FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, APA3));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if any form of pauth is enabled, as this
|
||||
* predicate controls migration of the 128-bit keys.
|
||||
*/
|
||||
return isar_feature_pauth_feature(id) != PauthFeat_None;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth_qarma5(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if pauth is enabled with the architected QARMA5 algorithm.
|
||||
* QEMU will always enable or disable both APA and GPA.
|
||||
*/
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, APA) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth_qarma3(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if pauth is enabled with the architected QARMA3 algorithm.
|
||||
* QEMU will always enable or disable both APA3 and GPA3.
|
||||
*/
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, APA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SPECRES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_frint(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, FRINTTS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dcpop(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, DPB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dcpodp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, DPB) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, BF16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rcpc_8_3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rcpc_8_4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hbc(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, BC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mops(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, MOPS);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id)
|
||||
{
|
||||
/* We always set the AdvSIMD and FP fields identically. */
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fp16(const ARMISARegisters *id)
|
||||
{
|
||||
/* We always set the AdvSIMD and FP fields identically wrt FP16. */
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) == 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL0) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32_el1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL1) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32_el2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL2) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RAS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_doublefault(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RAS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SVE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sel2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SEL2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rme(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RME) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dit(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, DIT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_scxtnum(const ARMISARegisters *id)
|
||||
{
|
||||
int key = FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, CSV2);
|
||||
if (key >= 2) {
|
||||
return true; /* FEAT_CSV2_2 */
|
||||
}
|
||||
if (key == 1) {
|
||||
key = FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, CSV2_FRAC);
|
||||
return key >= 2; /* FEAT_CSV2_1p2 */
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ssbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SSBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_bti(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, BT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mte_insn_reg(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mte(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SME) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_2_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2);
|
||||
return t >= 3 || (t == 0 && isar_feature_aa64_tgran4_lpa2(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_2_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2);
|
||||
return t >= 3 || (t == 0 && isar_feature_aa64_tgran16_lpa2(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran4(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran16(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran64_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran64(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fgt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, FGT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_vh(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, VH) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lor(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, LO) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pan(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ats1e1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pan3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hcx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HCX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tidcp1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR1, TIDCP1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hafs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hdbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, XNX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_uao(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, UAO) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_st(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, ST) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lse2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, AT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fwb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, FWB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ids(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, IDS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, EVT) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, EVT) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, CCIDX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lva(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, VARANGE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_e0pd(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, E0PD) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 4 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 5 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 6 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, DEBUGVER) >= 8;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_doublelock(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64dfr0, ID_AA64DFR0, DOUBLELOCK) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SVEVER) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_pmull128(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, AES) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_bitperm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, BITPERM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, BFLOAT16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_sha3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SHA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_sm4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SM4) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_f32mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F32MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_f64mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F64MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_f64f64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, F64F64);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_i16i64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, I16I64) == 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_fa64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, FA64);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature tests for "does this exist in either 32-bit or 64-bit?"
|
||||
*/
|
||||
static inline bool isar_feature_any_fp16(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_fp16(id) || isar_feature_aa32_fp16_arith(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_predinv(id) || isar_feature_aa32_predinv(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p1(id) || isar_feature_aa32_pmuv3p1(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p4(id) || isar_feature_aa32_pmuv3p4(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p5(id) || isar_feature_aa32_pmuv3p5(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_ccidx(id) || isar_feature_aa32_ccidx(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_tts2uxn(id) || isar_feature_aa32_tts2uxn(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_debugv8p2(id) || isar_feature_aa32_debugv8p2(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_ras(id) || isar_feature_aa32_ras(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_half_evt(id) || isar_feature_aa32_half_evt(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_evt(id) || isar_feature_aa32_evt(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Forward to the above feature tests given an ARMCPU pointer.
|
||||
*/
|
||||
#define cpu_isar_feature(name, cpu) \
|
||||
({ ARMCPU *cpu_ = (cpu); isar_feature_##name(&cpu_->isar); })
|
||||
|
||||
#endif
|
@ -31,6 +31,7 @@
|
||||
#include "hw/core/tcg-cpu-ops.h"
|
||||
#endif /* CONFIG_TCG */
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
|
971
target/arm/cpu.h
971
target/arm/cpu.h
@ -3402,975 +3402,4 @@ static inline target_ulong cpu_untagged_addr(CPUState *cs, target_ulong x)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Naming convention for isar_feature functions:
|
||||
* Functions which test 32-bit ID registers should have _aa32_ in
|
||||
* their name. Functions which test 64-bit ID registers should have
|
||||
* _aa64_ in their name. These must only be used in code where we
|
||||
* know for certain that the CPU has AArch32 or AArch64 respectively
|
||||
* or where the correct answer for a CPU which doesn't implement that
|
||||
* CPU state is "false" (eg when generating A32 or A64 code, if adding
|
||||
* system registers that are specific to that CPU state, for "should
|
||||
* we let this system register bit be set" tests where the 32-bit
|
||||
* flavour of the register doesn't have the bit, and so on).
|
||||
* Functions which simply ask "does this feature exist at all" have
|
||||
* _any_ in their name, and always return the logical OR of the _aa64_
|
||||
* and the _aa32_ function.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 32-bit feature tests via id registers.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_thumb_div(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_arm_div(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, DIVIDE) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_lob(const ARMISARegisters *id)
|
||||
{
|
||||
/* (M-profile) low-overhead loops and branch future */
|
||||
return FIELD_EX32(id->id_isar0, ID_ISAR0, CMPBRANCH) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_jazelle(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar1, ID_ISAR1, JAZELLE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmull(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, AES) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sha1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sha2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, SHA2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_crc32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, CRC32) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_rdm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, RDM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vcma(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar5, ID_ISAR5, VCMA) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_jscvt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, JSCVT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_dp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, DP) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fhm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, FHM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_sb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, SB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, SPECRES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, BF16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_isar6, ID_ISAR6, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr0, ID_PFR0, RAS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mprofile(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr1, ID_PFR1, MPROGMOD) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_m_sec_state(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if M-profile state handling insns
|
||||
* (VSCCLRM, CLRM, FPCTX access insns) are implemented
|
||||
*/
|
||||
return FIELD_EX32(id->id_pfr1, ID_PFR1, SECURITY) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fp16_arith(const ARMISARegisters *id)
|
||||
{
|
||||
/* Sadly this is encoded differently for A-profile and M-profile */
|
||||
if (isar_feature_aa32_mprofile(id)) {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FP16) > 0;
|
||||
} else {
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) >= 3;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mve(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if MVE is supported (either integer or floating point).
|
||||
* We must check for M-profile as the MVFR1 field means something
|
||||
* else for A-profile.
|
||||
*/
|
||||
return isar_feature_aa32_mprofile(id) &&
|
||||
FIELD_EX32(id->mvfr1, MVFR1, MVE) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_mve_fp(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if MVE is supported (either integer or floating point).
|
||||
* We must check for M-profile as the MVFR1 field means something
|
||||
* else for A-profile.
|
||||
*/
|
||||
return isar_feature_aa32_mprofile(id) &&
|
||||
FIELD_EX32(id->mvfr1, MVFR1, MVE) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vfp_simd(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if either VFP or SIMD is implemented.
|
||||
* In this case, a minimum of VFP w/ D0-D15.
|
||||
*/
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_simd_r32(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if D16-D31 are implemented */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, SIMDREG) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpshvec(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSHVEC) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpsp_v2(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports single precision floating point, VFPv2 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpsp_v3(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports single precision floating point, VFPv3 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPSP) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpdp_v2(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports double precision floating point, VFPv2 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPDP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fpdp_v3(const ARMISARegisters *id)
|
||||
{
|
||||
/* Return true if CPU supports double precision floating point, VFPv3 */
|
||||
return FIELD_EX32(id->mvfr0, MVFR0, FPDP) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vfp(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa32_fpsp_v2(id) || isar_feature_aa32_fpdp_v2(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* We always set the FP and SIMD FP16 fields to indicate identical
|
||||
* levels of support (assuming SIMD is implemented at all), so
|
||||
* we only need one set of accessors.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_fp16_spconv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_fp16_dpconv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, FPHP) > 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Note that this ID register field covers both VFP and Neon FMAC,
|
||||
* so should usually be tested in combination with some other
|
||||
* check that confirms the presence of whichever of VFP or Neon is
|
||||
* relevant, to avoid accidentally enabling a Neon feature on
|
||||
* a VFP-no-Neon core or vice-versa.
|
||||
*/
|
||||
static inline bool isar_feature_aa32_simdfmac(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr1, MVFR1, SIMDFMAC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vsel(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vcvt_dr(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vrint(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_vminmaxnm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->mvfr2, MVFR2, FPMISC) >= 4;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr0, ID_MMFR0, VMSA) >= 4;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pan(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ats1e1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr3, ID_MMFR3, PAN) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 4 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 5 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
/* 0xf means "non-standard IMPDEF PMU" */
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) >= 6 &&
|
||||
FIELD_EX32(id->id_dfr0, ID_DFR0, PERFMON) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_hpd(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, HPDS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ac2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, AC2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, CCIDX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, XNX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_mmfr4, ID_MMFR4, EVT) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_dit(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr0, ID_PFR0, DIT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_ssbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_pfr2, ID_PFR2, SSBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_debugv7p1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 5;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->id_dfr0, ID_DFR0, COPDBG) >= 8;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa32_doublelock(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX32(id->dbgdevid, DBGDEVID, DOUBLELOCK) > 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* 64-bit feature tests via id registers.
|
||||
*/
|
||||
static inline bool isar_feature_aa64_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmull(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, AES) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha256(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha512(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA2) > 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_crc32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, CRC32) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_atomics(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, ATOMIC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rdm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, RDM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sha3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SHA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sm3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SM3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sm4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, SM4) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, DP) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fhm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, FHM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_condm_4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_condm_5(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rndr(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, RNDR) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_jscvt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, JSCVT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fcma(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, FCMA) != 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* These are the values from APA/API/APA3.
|
||||
* In general these must be compared '>=', per the normal Arm ARM
|
||||
* treatment of fields in ID registers.
|
||||
*/
|
||||
typedef enum {
|
||||
PauthFeat_None = 0,
|
||||
PauthFeat_1 = 1,
|
||||
PauthFeat_EPAC = 2,
|
||||
PauthFeat_2 = 3,
|
||||
PauthFeat_FPAC = 4,
|
||||
PauthFeat_FPACCOMBINED = 5,
|
||||
} ARMPauthFeature;
|
||||
|
||||
static inline ARMPauthFeature
|
||||
isar_feature_pauth_feature(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Architecturally, only one of {APA,API,APA3} may be active (non-zero)
|
||||
* and the other two must be zero. Thus we may avoid conditionals.
|
||||
*/
|
||||
return (FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, APA) |
|
||||
FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, API) |
|
||||
FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, APA3));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if any form of pauth is enabled, as this
|
||||
* predicate controls migration of the 128-bit keys.
|
||||
*/
|
||||
return isar_feature_pauth_feature(id) != PauthFeat_None;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth_qarma5(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if pauth is enabled with the architected QARMA5 algorithm.
|
||||
* QEMU will always enable or disable both APA and GPA.
|
||||
*/
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, APA) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pauth_qarma3(const ARMISARegisters *id)
|
||||
{
|
||||
/*
|
||||
* Return true if pauth is enabled with the architected QARMA3 algorithm.
|
||||
* QEMU will always enable or disable both APA3 and GPA3.
|
||||
*/
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, APA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tlbirange(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) == 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tlbios(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar0, ID_AA64ISAR0, TLB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, SPECRES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_frint(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, FRINTTS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dcpop(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, DPB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dcpodp(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, DPB) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, BF16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fp_simd(const ARMISARegisters *id)
|
||||
{
|
||||
/* We always set the AdvSIMD and FP fields identically. */
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fp16(const ARMISARegisters *id)
|
||||
{
|
||||
/* We always set the AdvSIMD and FP fields identically wrt FP16. */
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, FP) == 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL0) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32_el1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL1) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_aa32_el2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, EL2) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RAS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_doublefault(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RAS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SVE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sel2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, SEL2) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rme(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, RME) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_vh(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, VH) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lor(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, LO) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pan(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ats1e1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pan3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, PAN) >= 3;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hcx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HCX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tidcp1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR1, TIDCP1) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_uao(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, UAO) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_st(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, ST) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lse2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, AT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fwb(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, FWB) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ids(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, IDS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, EVT) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, EVT) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_bti(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, BT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mte_insn_reg(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mte(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, MTE) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SME) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 4 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 5 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) >= 6 &&
|
||||
FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, PMUVER) != 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rcpc_8_3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_rcpc_8_4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, LRCPC) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar1, ID_AA64ISAR1, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hbc(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, BC) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_2_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2);
|
||||
return t >= 3 || (t == 0 && isar_feature_aa64_tgran4_lpa2(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_2_lpa2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2);
|
||||
return t >= 3 || (t == 0 && isar_feature_aa64_tgran16_lpa2(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16) >= 1;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran4_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN4_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran4(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran16_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN16_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran16(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tgran64_2(const ARMISARegisters *id)
|
||||
{
|
||||
unsigned t = FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, TGRAN64_2);
|
||||
return t >= 2 || (t == 0 && isar_feature_aa64_tgran64(id));
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_fgt(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr0, ID_AA64MMFR0, FGT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, CCIDX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_lva(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, VARANGE) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_e0pd(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr2, ID_AA64MMFR2, E0PD) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hafs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_hdbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, HAFDBS) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64mmfr1, ID_AA64MMFR1, XNX) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_dit(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, DIT) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_scxtnum(const ARMISARegisters *id)
|
||||
{
|
||||
int key = FIELD_EX64(id->id_aa64pfr0, ID_AA64PFR0, CSV2);
|
||||
if (key >= 2) {
|
||||
return true; /* FEAT_CSV2_2 */
|
||||
}
|
||||
if (key == 1) {
|
||||
key = FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, CSV2_FRAC);
|
||||
return key >= 2; /* FEAT_CSV2_1p2 */
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_ssbs(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64pfr1, ID_AA64PFR1, SSBS) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64dfr0, ID_AA64DFR0, DEBUGVER) >= 8;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SVEVER) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_aes(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, AES) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_pmull128(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, AES) >= 2;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_bitperm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, BITPERM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_bf16(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, BFLOAT16) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_sha3(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SHA3) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve2_sm4(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, SM4) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_i8mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, I8MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_f32mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F32MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sve_f64mm(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64zfr0, ID_AA64ZFR0, F64MM) != 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_f64f64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, F64F64);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_i16i64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, I16I64) == 0xf;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_sme_fa64(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64smfr0, ID_AA64SMFR0, FA64);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_doublelock(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_SEX64(id->id_aa64dfr0, ID_AA64DFR0, DOUBLELOCK) >= 0;
|
||||
}
|
||||
|
||||
static inline bool isar_feature_aa64_mops(const ARMISARegisters *id)
|
||||
{
|
||||
return FIELD_EX64(id->id_aa64isar2, ID_AA64ISAR2, MOPS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Feature tests for "does this exist in either 32-bit or 64-bit?"
|
||||
*/
|
||||
static inline bool isar_feature_any_fp16(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_fp16(id) || isar_feature_aa32_fp16_arith(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_predinv(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_predinv(id) || isar_feature_aa32_predinv(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p1(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p1(id) || isar_feature_aa32_pmuv3p1(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p4(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p4(id) || isar_feature_aa32_pmuv3p4(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_pmuv3p5(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_pmuv3p5(id) || isar_feature_aa32_pmuv3p5(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_ccidx(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_ccidx(id) || isar_feature_aa32_ccidx(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_tts2uxn(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_tts2uxn(id) || isar_feature_aa32_tts2uxn(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_debugv8p2(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_debugv8p2(id) || isar_feature_aa32_debugv8p2(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_ras(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_ras(id) || isar_feature_aa32_ras(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_half_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_half_evt(id) || isar_feature_aa32_half_evt(id);
|
||||
}
|
||||
|
||||
static inline bool isar_feature_any_evt(const ARMISARegisters *id)
|
||||
{
|
||||
return isar_feature_aa64_evt(id) || isar_feature_aa32_evt(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* Forward to the above feature tests given an ARMCPU pointer.
|
||||
*/
|
||||
#define cpu_isar_feature(name, cpu) \
|
||||
({ ARMCPU *cpu_ = (cpu); isar_feature_##name(&cpu_->isar); })
|
||||
|
||||
#endif
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "qapi/visitor.h"
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "cpregs.h"
|
||||
|
||||
void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp)
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "qemu/log.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "cpregs.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/helper-proto.h"
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "gdbstub/helpers.h"
|
||||
#include "sysemu/tcg.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "cpregs.h"
|
||||
|
||||
typedef struct RegisterSysregXmlParam {
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "trace.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/timer.h"
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "hw/registerfields.h"
|
||||
#include "tcg/tcg-gvec-desc.h"
|
||||
#include "syndrome.h"
|
||||
#include "cpu-features.h"
|
||||
|
||||
/* register banks for CPU modes */
|
||||
#define BANK_USRSYS 0
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "sysemu/kvm_int.h"
|
||||
#include "kvm_arm.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "hw/acpi/acpi.h"
|
||||
#include "hw/acpi/ghes.h"
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include "sysemu/tcg.h"
|
||||
#include "kvm_arm.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "migration/cpu.h"
|
||||
|
||||
static bool vfp_needed(void *opaque)
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "exec/exec-all.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "idau.h"
|
||||
#ifdef CONFIG_TCG
|
||||
# include "tcg/oversized-guest.h"
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "hw/qdev-properties.h"
|
||||
#include "qemu/units.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "cpregs.h"
|
||||
|
||||
static uint64_t make_ccsidr64(unsigned assoc, unsigned linesize,
|
||||
@ -840,6 +841,13 @@ static const ARMCPRegInfo cortex_a710_cp_reginfo[] = {
|
||||
{ .name = "CPUPFR_EL3", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 6, .crn = 15, .crm = 8, .opc2 = 6,
|
||||
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
|
||||
/*
|
||||
* Report CPUCFR_EL1.SCU as 1, as we do not implement the DSU
|
||||
* (and in particular its system registers).
|
||||
*/
|
||||
{ .name = "CPUCFR_EL1", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 0, .crn = 15, .crm = 0, .opc2 = 0,
|
||||
.access = PL1_R, .type = ARM_CP_CONST, .resetvalue = 4 },
|
||||
|
||||
/*
|
||||
* Stub RAMINDEX, as we don't actually implement caches, BTB,
|
||||
@ -909,12 +917,12 @@ static void aarch64_a710_initfn(Object *obj)
|
||||
cpu->isar.id_aa64pfr0 = 0x1201111120111112ull; /* GIC filled in later */
|
||||
cpu->isar.id_aa64pfr1 = 0x0000000000000221ull;
|
||||
cpu->isar.id_aa64zfr0 = 0x0000110100110021ull; /* with Crypto */
|
||||
cpu->isar.id_aa64dfr0 = 0x000011f010305611ull;
|
||||
cpu->isar.id_aa64dfr0 = 0x000011f010305619ull;
|
||||
cpu->isar.id_aa64dfr1 = 0;
|
||||
cpu->id_aa64afr0 = 0;
|
||||
cpu->id_aa64afr1 = 0;
|
||||
cpu->isar.id_aa64isar0 = 0x0221111110212120ull; /* with Crypto */
|
||||
cpu->isar.id_aa64isar1 = 0x0010111101211032ull;
|
||||
cpu->isar.id_aa64isar1 = 0x0010111101211052ull;
|
||||
cpu->isar.id_aa64mmfr0 = 0x0000022200101122ull;
|
||||
cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull;
|
||||
cpu->isar.id_aa64mmfr2 = 0x1221011110101011ull;
|
||||
@ -956,6 +964,108 @@ static void aarch64_a710_initfn(Object *obj)
|
||||
aarch64_add_sve_properties(obj);
|
||||
}
|
||||
|
||||
/* Extra IMPDEF regs in the N2 beyond those in the A710 */
|
||||
static const ARMCPRegInfo neoverse_n2_cp_reginfo[] = {
|
||||
{ .name = "CPURNDBR_EL3", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 6, .crn = 15, .crm = 3, .opc2 = 0,
|
||||
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
|
||||
{ .name = "CPURNDPEID_EL3", .state = ARM_CP_STATE_AA64,
|
||||
.opc0 = 3, .opc1 = 6, .crn = 15, .crm = 3, .opc2 = 1,
|
||||
.access = PL3_RW, .type = ARM_CP_CONST, .resetvalue = 0 },
|
||||
};
|
||||
|
||||
static void aarch64_neoverse_n2_initfn(Object *obj)
|
||||
{
|
||||
ARMCPU *cpu = ARM_CPU(obj);
|
||||
|
||||
cpu->dtb_compatible = "arm,neoverse-n2";
|
||||
set_feature(&cpu->env, ARM_FEATURE_V8);
|
||||
set_feature(&cpu->env, ARM_FEATURE_NEON);
|
||||
set_feature(&cpu->env, ARM_FEATURE_GENERIC_TIMER);
|
||||
set_feature(&cpu->env, ARM_FEATURE_AARCH64);
|
||||
set_feature(&cpu->env, ARM_FEATURE_CBAR_RO);
|
||||
set_feature(&cpu->env, ARM_FEATURE_EL2);
|
||||
set_feature(&cpu->env, ARM_FEATURE_EL3);
|
||||
set_feature(&cpu->env, ARM_FEATURE_PMU);
|
||||
|
||||
/* Ordered by Section B.5: AArch64 ID registers */
|
||||
cpu->midr = 0x410FD493; /* r0p3 */
|
||||
cpu->revidr = 0;
|
||||
cpu->isar.id_pfr0 = 0x21110131;
|
||||
cpu->isar.id_pfr1 = 0x00010000; /* GIC filled in later */
|
||||
cpu->isar.id_dfr0 = 0x16011099;
|
||||
cpu->id_afr0 = 0;
|
||||
cpu->isar.id_mmfr0 = 0x10201105;
|
||||
cpu->isar.id_mmfr1 = 0x40000000;
|
||||
cpu->isar.id_mmfr2 = 0x01260000;
|
||||
cpu->isar.id_mmfr3 = 0x02122211;
|
||||
cpu->isar.id_isar0 = 0x02101110;
|
||||
cpu->isar.id_isar1 = 0x13112111;
|
||||
cpu->isar.id_isar2 = 0x21232042;
|
||||
cpu->isar.id_isar3 = 0x01112131;
|
||||
cpu->isar.id_isar4 = 0x00010142;
|
||||
cpu->isar.id_isar5 = 0x11011121; /* with Crypto */
|
||||
cpu->isar.id_mmfr4 = 0x01021110;
|
||||
cpu->isar.id_isar6 = 0x01111111;
|
||||
cpu->isar.mvfr0 = 0x10110222;
|
||||
cpu->isar.mvfr1 = 0x13211111;
|
||||
cpu->isar.mvfr2 = 0x00000043;
|
||||
cpu->isar.id_pfr2 = 0x00000011;
|
||||
cpu->isar.id_aa64pfr0 = 0x1201111120111112ull; /* GIC filled in later */
|
||||
cpu->isar.id_aa64pfr1 = 0x0000000000000221ull;
|
||||
cpu->isar.id_aa64zfr0 = 0x0000110100110021ull; /* with Crypto */
|
||||
cpu->isar.id_aa64dfr0 = 0x000011f210305619ull;
|
||||
cpu->isar.id_aa64dfr1 = 0;
|
||||
cpu->id_aa64afr0 = 0;
|
||||
cpu->id_aa64afr1 = 0;
|
||||
cpu->isar.id_aa64isar0 = 0x0221111110212120ull; /* with Crypto */
|
||||
cpu->isar.id_aa64isar1 = 0x0011111101211052ull;
|
||||
cpu->isar.id_aa64mmfr0 = 0x0000022200101125ull;
|
||||
cpu->isar.id_aa64mmfr1 = 0x0000000010212122ull;
|
||||
cpu->isar.id_aa64mmfr2 = 0x1221011112101011ull;
|
||||
cpu->clidr = 0x0000001482000023ull;
|
||||
cpu->gm_blocksize = 4;
|
||||
cpu->ctr = 0x00000004b444c004ull;
|
||||
cpu->dcz_blocksize = 4;
|
||||
/* TODO FEAT_MPAM: mpamidr_el1 = 0x0000_0001_001e_01ff */
|
||||
|
||||
/* Section B.7.2: PMCR_EL0 */
|
||||
cpu->isar.reset_pmcr_el0 = 0x3000; /* with 6 counters */
|
||||
|
||||
/* Section B.8.9: ICH_VTR_EL2 */
|
||||
cpu->gic_num_lrs = 4;
|
||||
cpu->gic_vpribits = 5;
|
||||
cpu->gic_vprebits = 5;
|
||||
cpu->gic_pribits = 5;
|
||||
|
||||
/* Section 14: Scalable Vector Extensions support */
|
||||
cpu->sve_vq.supported = 1 << 0; /* 128bit */
|
||||
|
||||
/*
|
||||
* The Neoverse N2 TRM does not list CCSIDR values. The layout of
|
||||
* the caches are in text in Table 7-1, Table 8-1, and Table 9-1.
|
||||
*
|
||||
* L1: 4-way set associative 64-byte line size, total 64K.
|
||||
* L2: 8-way set associative 64 byte line size, total either 512K or 1024K.
|
||||
*/
|
||||
cpu->ccsidr[0] = make_ccsidr64(4, 64, 64 * KiB); /* L1 dcache */
|
||||
cpu->ccsidr[1] = cpu->ccsidr[0]; /* L1 icache */
|
||||
cpu->ccsidr[2] = make_ccsidr64(8, 64, 512 * KiB); /* L2 cache */
|
||||
|
||||
/* FIXME: Not documented -- copied from neoverse-v1 */
|
||||
cpu->reset_sctlr = 0x30c50838;
|
||||
|
||||
/*
|
||||
* The Neoverse N2 has all of the Cortex-A710 IMPDEF registers,
|
||||
* and a few more RNG related ones.
|
||||
*/
|
||||
define_arm_cp_regs(cpu, cortex_a710_cp_reginfo);
|
||||
define_arm_cp_regs(cpu, neoverse_n2_cp_reginfo);
|
||||
|
||||
aarch64_add_pauth_properties(obj);
|
||||
aarch64_add_sve_properties(obj);
|
||||
}
|
||||
|
||||
/*
|
||||
* -cpu max: a CPU with as many features enabled as our emulation supports.
|
||||
* The version of '-cpu max' for qemu-system-arm is defined in cpu32.c;
|
||||
@ -1158,6 +1268,7 @@ static const ARMCPUInfo aarch64_cpus[] = {
|
||||
{ .name = "a64fx", .initfn = aarch64_a64fx_initfn },
|
||||
{ .name = "neoverse-n1", .initfn = aarch64_neoverse_n1_initfn },
|
||||
{ .name = "neoverse-v1", .initfn = aarch64_neoverse_v1_initfn },
|
||||
{ .name = "neoverse-n2", .initfn = aarch64_neoverse_n2_initfn },
|
||||
};
|
||||
|
||||
static void aarch64_cpu_register_types(void)
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "cpregs.h"
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "gdbstub/helpers.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "qemu/main-loop.h"
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "cpu.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/cpu_ldst.h"
|
||||
#include "cpregs.h"
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/cpu_ldst.h"
|
||||
#include "exec/helper-proto.h"
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "qemu/osdep.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/helper-proto.h"
|
||||
|
||||
|
@ -1606,7 +1606,7 @@ static bool trans_ERET(DisasContext *s, arg_ERET *a)
|
||||
return false;
|
||||
}
|
||||
if (s->fgt_eret) {
|
||||
gen_exception_insn_el(s, 0, EXCP_UDEF, 0, 2);
|
||||
gen_exception_insn_el(s, 0, EXCP_UDEF, syn_erettrap(0), 2);
|
||||
return true;
|
||||
}
|
||||
dst = tcg_temp_new_i64();
|
||||
@ -1633,7 +1633,7 @@ static bool trans_ERETA(DisasContext *s, arg_reta *a)
|
||||
}
|
||||
/* The FGT trap takes precedence over an auth trap. */
|
||||
if (s->fgt_eret) {
|
||||
gen_exception_insn_el(s, 0, EXCP_UDEF, a->m ? 3 : 2, 2);
|
||||
gen_exception_insn_el(s, 0, EXCP_UDEF, syn_erettrap(a->m ? 3 : 2), 2);
|
||||
return true;
|
||||
}
|
||||
dst = tcg_temp_new_i64();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "exec/translator.h"
|
||||
#include "exec/helper-gen.h"
|
||||
#include "internals.h"
|
||||
|
||||
#include "cpu-features.h"
|
||||
|
||||
/* internal defines */
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "cpu.h"
|
||||
#include "exec/helper-proto.h"
|
||||
#include "internals.h"
|
||||
#include "cpu-features.h"
|
||||
#ifdef CONFIG_TCG
|
||||
#include "qemu/log.h"
|
||||
#include "fpu/softfloat.h"
|
||||
|
Loading…
Reference in New Issue
Block a user