Add do_transaction_failed hook for ARM
Subsystems (5)
v2 cover Add do_transaction_failed hook for ARM
I sent these patches earlier, but only realized when I put them in the target-arm pull request that they broke the user-mode emulators.
Only change in these 3 patches from v1 is that patch 1 now checks that what it gets from qdev_get_machine() is really an instance of TYPE_MACHINE before using it (which only happens for the user-mode emulators, where we don't need to set ignore_memory_transaction_failures).
thanks
-- PMM
Peter Maydell (3):
boards.h: Define new flag ignore_memory_transaction_failures hw/arm: Set ignore_memory_transaction_failures for most ARM boards target/arm: Implement new do_transaction_failed hook
include/hw/boards.h | 11 +++++++++++ include/qom/cpu.h | 7 ++++++- target/arm/internals.h | 10 ++++++++++ hw/arm/aspeed.c | 3 +++ hw/arm/collie.c | 1 + hw/arm/cubieboard.c | 1 + hw/arm/digic_boards.c | 1 + hw/arm/exynos4_boards.c | 2 ++ hw/arm/gumstix.c | 2 ++ hw/arm/highbank.c | 2 ++ hw/arm/imx25_pdk.c | 1 + hw/arm/integratorcp.c | 1 + hw/arm/kzm.c | 1 + hw/arm/mainstone.c | 1 + hw/arm/musicpal.c | 1 + hw/arm/netduino2.c | 1 + hw/arm/nseries.c | 2 ++ hw/arm/omap_sx1.c | 2 ++ hw/arm/palm.c | 1 + hw/arm/raspi.c | 1 + hw/arm/realview.c | 4 ++++ hw/arm/sabrelite.c | 1 + hw/arm/spitz.c | 4 ++++ hw/arm/stellaris.c | 2 ++ hw/arm/tosa.c | 1 + hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 1 + hw/arm/xilinx_zynq.c | 1 + hw/arm/xlnx-ep108.c | 2 ++ hw/arm/z2.c | 1 + qom/cpu.c | 16 ++++++++++++++++ target/arm/cpu.c | 1 + target/arm/op_helper.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 33 files changed, 130 insertions(+), 1 deletion(-)
Signature · 1 line
2.7.4
PATCH v2 1/3 boards.h: Define new flag ignore_memory_transaction_failures
Define a new MachineClass field ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the transaction will instead return zero (for a read) or be ignored (for a write). This should be set only by legacy board models which rely on the old RAZ/WI behaviour for handling devices that QEMU does not yet model. New board models should instead use "unimplemented-device" for all memory ranges where the guest will attempt to probe for a device that QEMU doesn't implement and a stub device is required.
We need this for ARM boards, where we're about to implement support for generating external aborts on memory transaction failures. Too many of our legacy board models rely on the RAZ/WI behaviour and we would break currently working guests when their "probe for device" code provoked an external abort rather than a RAZ.
--- include/hw/boards.h | 11 +++++++++++ include/qom/cpu.h | 7 ++++++- qom/cpu.c | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-)
include/hw/boards.h +11 -0
@@ -131,6 +131,16 @@ typedef struct {* size than the target architecture's minimum. (Attempting to create * such a CPU will fail.) Note that changing this is a migration * compatibility break for the machine. +* @ignore_memory_transaction_failures: +* If this is flag is true then the CPU will ignore memory transaction +* failures which should cause the CPU to take an exception due to an +* access to an unassigned physical address; the transaction will instead +* return zero (for a read) or be ignored (for a write). This should be +* set only by legacy board models which rely on the old RAZ/WI behaviour +* for handling devices that QEMU does not yet model. New board models +* should instead use "unimplemented-device" for all memory ranges where +* the guest will attempt to probe for a device that QEMU doesn't +* implement and a stub device is required. */ struct MachineClass {/*< private >*/
@@ -171,6 +181,7 @@ struct MachineClass {bool rom_file_has_mr;int minimum_page_bits;bool has_hotpluggable_cpus; +bool ignore_memory_transaction_failures;int numa_mem_align_shift;void (*numa_auto_assign_ram)(MachineClass *mc,NodeInfo *nodes,int nb_nodes,ram_addr_t size);
include/qom/cpu.h +6 -1
@@ -312,6 +312,9 @@ struct qemu_work_item;* @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). * @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). +* @ignore_memory_transaction_failures: Cached copy of the MachineState +* flag of the same name: allows the board to suppress calling of the +* CPU do_transaction_failed hook function. * * State of one CPU core or thread. */
@@ -398,6 +401,8 @@ struct CPUState {*/ bool throttle_thread_scheduled; +bool ignore_memory_transaction_failures; +/* Note that this is accessed at the start of every TB via a negative offset from AREG0. Leave this field at the end so as to make the (absolute value) offset as small as possible. This reduces code
@@ -864,7 +869,7 @@ static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr, {CPUClass *cc =CPU_GET_CLASS (cpu); -if (cc->do_transaction_failed) { +if (!cpu->ignore_memory_transaction_failures && cc->do_transaction_failed) { cc->do_transaction_failed (cpu, physaddr, addr, size, access_type, mmu_idx, attrs, response, retaddr); }
qom/cpu.c +16 -0
@@ -29,6 +29,7 @@#include "exec/cpu-common.h" #include "qemu/error-report.h" #include "sysemu/sysemu.h" +#include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace-root.h"
@@ -363,6 +364,21 @@ static void cpu_common_parse_features(const char *typename, char *features,static void cpu_common_realizefn (DeviceState *dev,Error **errp) {CPUState *cpu =CPU (dev); +Object *machine =qdev_get_machine (); + +/* qdev_get_machine() can return something that's not TYPE_MACHINE +* if this is one of the user-only emulators; in that case there's +* no need to check the ignore_memory_transaction_failures board flag. +*/ +if (object_dynamic_cast (machine,TYPE_MACHINE )) { +ObjectClass *oc =object_get_class (machine); +MachineClass *mc =MACHINE_CLASS (oc); + +if (mc) { + cpu->ignore_memory_transaction_failures = + mc->ignore_memory_transaction_failures; + } + }if (dev->hotplugged) {cpu_synchronize_post_init (cpu);
Signature · 1 line
2.7.4
Re: [Qemu-devel] [PATCH v2 1/3] boards.h: Define new flag ignore_memory_transaction_failures
Quoted 17 lines · Peter Maydell
Define a new MachineClass field
ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the transaction will instead return zero (for a read) or be ignored (for a write). This should be set only by legacy board models which rely on the old RAZ/WI behaviour for handling devices that QEMU does not yet model. New board models should instead use "unimplemented-device" for all memory ranges where the guest will attempt to probe for a device that QEMU doesn't implement and a stub device is required.We need this for ARM boards, where we're about to implement support for generating external aborts on memory transaction failures. Too many of our legacy board models rely on the RAZ/WI behaviour and we would break currently working guests when their "probe for device" code provoked an external abort rather than a RAZ.
Quoted 6 lines
Signed-off-by Peter Maydell <[email protected]>--- include/hw/boards.h | 11 +++++++++++ include/qom/cpu.h | 7 ++++++- qom/cpu.c | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-)
r~
Alistair Francis
Reviewed-byRe: [Qemu-arm] [Qemu-devel] [PATCH v2 1/3] boards.h: Define new flag ignore_memory_transaction_failures
Quoted 18 lines · Richard Henderson
Quoted 17 lines · Peter Maydell
Define a new MachineClass field
ignore_memory_transaction_failures. If this is flag is true then the CPU will ignore memory transaction failures which should cause the CPU to take an exception due to an access to an unassigned physical address; the transaction will instead return zero (for a read) or be ignored (for a write). This should be set only by legacy board models which rely on the old RAZ/WI behaviour for handling devices that QEMU does not yet model. New board models should instead use "unimplemented-device" for all memory ranges where the guest will attempt to probe for a device that QEMU doesn't implement and a stub device is required.We need this for ARM boards, where we're about to implement support for generating external aborts on memory transaction failures. Too many of our legacy board models rely on the RAZ/WI behaviour and we would break currently working guests when their "probe for device" code provoked an external abort rather than a RAZ.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Peter Maydell <[email protected]>--- include/hw/boards.h | 11 +++++++++++ include/qom/cpu.h | 7 ++++++- qom/cpu.c | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-)Reviewed-by Richard Henderson <[email protected]>
Thanks,
Alistair
Quoted 4 lines
r~
PATCH v2 2/3 hw/arm: Set ignore_memory_transaction_failures for most ARM boards
In reply to Peter MaydellSet the MachineClass flag ignore_memory_transaction_failures for almost all ARM boards. This means they retain the legacy behaviour that accesses to unimplemented addresses will RAZ/WI rather than aborting, when a subsequent commit adds support for external aborts.
The exceptions are:
* virt -- we know that guests won't try to prod devices that we don't describe in the device tree or ACPI tables
* mps2 -- this board was written to use unimplemented-device for all the ranges with devices we don't yet handle
New boards should not set the flag, but instead be written like the mps2.
For the Xilinx boards:
--- hw/arm/aspeed.c | 3 +++ hw/arm/collie.c | 1 + hw/arm/cubieboard.c | 1 + hw/arm/digic_boards.c | 1 + hw/arm/exynos4_boards.c | 2 ++ hw/arm/gumstix.c | 2 ++ hw/arm/highbank.c | 2 ++ hw/arm/imx25_pdk.c | 1 + hw/arm/integratorcp.c | 1 + hw/arm/kzm.c | 1 + hw/arm/mainstone.c | 1 + hw/arm/musicpal.c | 1 + hw/arm/netduino2.c | 1 + hw/arm/nseries.c | 2 ++ hw/arm/omap_sx1.c | 2 ++ hw/arm/palm.c | 1 + hw/arm/raspi.c | 1 + hw/arm/realview.c | 4 ++++ hw/arm/sabrelite.c | 1 + hw/arm/spitz.c | 4 ++++ hw/arm/stellaris.c | 2 ++ hw/arm/tosa.c | 1 + hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 1 + hw/arm/xilinx_zynq.c | 1 + hw/arm/xlnx-ep108.c | 2 ++ hw/arm/z2.c | 1 + 27 files changed, 43 insertions(+)
hw/arm/aspeed.c +3 -0
@@ -270,6 +270,7 @@ static void palmetto_bmc_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo palmetto_bmc_type = {
@@ -302,6 +303,7 @@ static void ast2500_evb_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo ast2500_evb_type = {
@@ -326,6 +328,7 @@ static void romulus_bmc_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo romulus_bmc_type = {
hw/arm/collie.c +1 -0
@@ -64,6 +64,7 @@ static void collie_machine_init(MachineClass *mc) { mc->desc ="Sharp SL-5500 (Collie) PDA (SA-1110)" ; mc->init = collie_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("collie" , collie_machine_init)
hw/arm/cubieboard.c +1 -0
@@ -86,6 +86,7 @@ static void cubieboard_machine_init(MachineClass *mc) mc->init = cubieboard_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("cubieboard" , cubieboard_machine_init)
hw/arm/digic_boards.c +1 -0
@@ -155,6 +155,7 @@ static void canon_a1100_machine_init(MachineClass *mc) { mc->desc ="Canon PowerShot A1100 IS" ; mc->init = &canon_a1100_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("canon-a1100" , canon_a1100_machine_init)
hw/arm/exynos4_boards.c +2 -0
@@ -189,6 +189,7 @@ static void nuri_class_init(ObjectClass *oc, void *data) mc->desc ="Samsung NURI board (Exynos4210)" ; mc->init = nuri_init; mc->max_cpus =EXYNOS4210_NCPUS ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo nuri_type = {
@@ -204,6 +205,7 @@ static void smdkc210_class_init(ObjectClass *oc, void *data) mc->desc ="Samsung SMDKC210 board (Exynos4210)" ; mc->init = smdkc210_init; mc->max_cpus =EXYNOS4210_NCPUS ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo smdkc210_type = {
hw/arm/gumstix.c +2 -0
@@ -128,6 +128,7 @@ static void connex_class_init(ObjectClass *oc, void *data) mc->desc ="Gumstix Connex (PXA255)" ; mc->init = connex_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo connex_type = {
@@ -142,6 +143,7 @@ static void verdex_class_init(ObjectClass *oc, void *data) mc->desc ="Gumstix Verdex (PXA270)" ; mc->init = verdex_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo verdex_type = {
hw/arm/highbank.c +2 -0
@@ -413,6 +413,7 @@ static void highbank_class_init(ObjectClass *oc, void *data) mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo highbank_type = {
@@ -430,6 +431,7 @@ static void midway_class_init(ObjectClass *oc, void *data) mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo midway_type = {
hw/arm/imx25_pdk.c +1 -0
@@ -148,6 +148,7 @@ static void imx25_pdk_machine_init(MachineClass *mc) { mc->desc ="ARM i.MX25 PDK board (ARM926)" ; mc->init = imx25_pdk_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("imx25-pdk" , imx25_pdk_machine_init)
hw/arm/integratorcp.c +1 -0
@@ -681,6 +681,7 @@ static void integratorcp_machine_init(MachineClass *mc) { mc->desc ="ARM Integrator/CP (ARM926EJ-S)" ; mc->init = integratorcp_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("integratorcp" , integratorcp_machine_init)
hw/arm/kzm.c +1 -0
@@ -142,6 +142,7 @@ static void kzm_machine_init(MachineClass *mc) { mc->desc ="ARM KZM Emulation Baseboard (ARM1136)" ; mc->init = kzm_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("kzm" , kzm_machine_init)
hw/arm/mainstone.c +1 -0
@@ -196,6 +196,7 @@ static void mainstone2_machine_init(MachineClass *mc) { mc->desc ="Mainstone II (PXA27x)" ; mc->init = mainstone_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("mainstone" , mainstone2_machine_init)
hw/arm/musicpal.c +1 -0
@@ -1718,6 +1718,7 @@ static void musicpal_machine_init(MachineClass *mc) { mc->desc ="Marvell 88w8618 / MusicPal (ARM926EJ-S)" ; mc->init = musicpal_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("musicpal" , musicpal_machine_init)
hw/arm/netduino2.c +1 -0
@@ -45,6 +45,7 @@ static void netduino2_machine_init(MachineClass *mc) { mc->desc ="Netduino 2 Machine" ; mc->init = netduino2_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("netduino2" , netduino2_machine_init)
hw/arm/nseries.c +2 -0
@@ -1425,6 +1425,7 @@ static void n800_class_init(ObjectClass *oc, void *data) mc->desc ="Nokia N800 tablet aka. RX-34 (OMAP2420)" ; mc->init = n800_init; mc->default_boot_order ="" ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo n800_type = {
@@ -1440,6 +1441,7 @@ static void n810_class_init(ObjectClass *oc, void *data) mc->desc ="Nokia N810 tablet aka. RX-44 (OMAP2420)" ; mc->init = n810_init; mc->default_boot_order ="" ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo n810_type = {
hw/arm/omap_sx1.c +2 -0
@@ -223,6 +223,7 @@ static void sx1_machine_v2_class_init(ObjectClass *oc, void *data) mc->desc ="Siemens SX1 (OMAP310) V2" ; mc->init = sx1_init_v2; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo sx1_machine_v2_type = {
@@ -237,6 +238,7 @@ static void sx1_machine_v1_class_init(ObjectClass *oc, void *data) mc->desc ="Siemens SX1 (OMAP310) V1" ; mc->init = sx1_init_v1; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo sx1_machine_v1_type = {
hw/arm/palm.c +1 -0
@@ -274,6 +274,7 @@ static void palmte_machine_init(MachineClass *mc) { mc->desc ="Palm Tungsten|E aka. Cheetah PDA (OMAP310)" ; mc->init = palmte_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("cheetah" , palmte_machine_init)
hw/arm/raspi.c +1 -0
@@ -168,5 +168,6 @@ static void raspi2_machine_init(MachineClass *mc) mc->no_cdrom =1 ; mc->max_cpus =BCM2836_NCPUS ; mc->default_ram_size =1024 *1024 *1024 ; + mc->ignore_memory_transaction_failures = true; };DEFINE_MACHINE ("raspi2" , raspi2_machine_init)
hw/arm/realview.c +4 -0
@@ -398,6 +398,7 @@ static void realview_eb_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Emulation Baseboard (ARM926EJ-S)" ; mc->init = realview_eb_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_eb_type = {
@@ -414,6 +415,7 @@ static void realview_eb_mpcore_class_init(ObjectClass *oc, void *data) mc->init = realview_eb_mpcore_init; mc->block_default_type =IF_SCSI ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_eb_mpcore_type = {
@@ -428,6 +430,7 @@ static void realview_pb_a8_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Platform Baseboard for Cortex-A8" ; mc->init = realview_pb_a8_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_pb_a8_type = {
@@ -443,6 +446,7 @@ static void realview_pbx_a9_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Platform Baseboard Explore for Cortex-A9" ; mc->init = realview_pbx_a9_init; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_pbx_a9_type = {
hw/arm/sabrelite.c +1 -0
@@ -122,6 +122,7 @@ static void sabrelite_machine_init(MachineClass *mc) mc->desc ="Freescale i.MX6 Quad SABRE Lite Board (Cortex A9)" ; mc->init = sabrelite_init; mc->max_cpus =FSL_IMX6_NUM_CPUS ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("sabrelite" , sabrelite_machine_init)
hw/arm/spitz.c +4 -0
@@ -983,6 +983,7 @@ static void akitapda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C1000 (Akita) PDA (PXA270)" ; mc->init = akita_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo akitapda_type = {
@@ -998,6 +999,7 @@ static void spitzpda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3000 (Spitz) PDA (PXA270)" ; mc->init = spitz_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo spitzpda_type = {
@@ -1013,6 +1015,7 @@ static void borzoipda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3100 (Borzoi) PDA (PXA270)" ; mc->init = borzoi_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo borzoipda_type = {
@@ -1028,6 +1031,7 @@ static void terrierpda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3200 (Terrier) PDA (PXA270)" ; mc->init = terrier_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo terrierpda_type = {
hw/arm/stellaris.c +2 -0
@@ -1453,6 +1453,7 @@ static void lm3s811evb_class_init(ObjectClass *oc, void *data) mc->desc ="Stellaris LM3S811EVB" ; mc->init = lm3s811evb_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo lm3s811evb_type = {
@@ -1467,6 +1468,7 @@ static void lm3s6965evb_class_init(ObjectClass *oc, void *data) mc->desc ="Stellaris LM3S6965EVB" ; mc->init = lm3s6965evb_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo lm3s6965evb_type = {
hw/arm/tosa.c +1 -0
@@ -263,6 +263,7 @@ static void tosapda_machine_init(MachineClass *mc) mc->desc ="Sharp SL-6000 (Tosa) PDA (PXA255)" ; mc->init = tosa_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("tosa" , tosapda_machine_init)
hw/arm/versatilepb.c +2 -0
@@ -403,6 +403,7 @@ static void versatilepb_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile/PB (ARM926EJ-S)" ; mc->init = vpb_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo versatilepb_type = {
@@ -418,6 +419,7 @@ static void versatileab_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile/AB (ARM926EJ-S)" ; mc->init = vab_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo versatileab_type = {
hw/arm/vexpress.c +1 -0
@@ -752,6 +752,7 @@ static void vexpress_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile Express" ; mc->init = vexpress_common_init; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static void vexpress_a9_class_init (ObjectClass *oc,void *data)
hw/arm/xilinx_zynq.c +1 -0
@@ -326,6 +326,7 @@ static void zynq_machine_init(MachineClass *mc) mc->init = zynq_init; mc->max_cpus =1 ; mc->no_sdcard =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xilinx-zynq-a9" , zynq_machine_init)
hw/arm/xlnx-ep108.c +2 -0
@@ -122,6 +122,7 @@ static void xlnx_ep108_machine_init(MachineClass *mc) mc->init = xlnx_ep108_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xlnx-ep108" , xlnx_ep108_machine_init)
@@ -132,6 +133,7 @@ static void xlnx_zcu102_machine_init(MachineClass *mc) mc->init = xlnx_ep108_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xlnx-zcu102" , xlnx_zcu102_machine_init)
hw/arm/z2.c +1 -0
@@ -370,6 +370,7 @@ static void z2_machine_init(MachineClass *mc) { mc->desc ="Zipit Z2 (PXA27x)" ; mc->init = z2_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("z2" , z2_machine_init)
Signature · 1 line
2.7.4
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 2/3] hw/arm: Set ignore_memory_transaction_failures for most ARM boards
Quoted 12 lines · Peter Maydell
Set the MachineClass flag
ignore_memory_transaction_failuresfor almost all ARM boards. This means they retain the legacy behaviour that accesses to unimplemented addresses will RAZ/WI rather than aborting, when a subsequent commit adds support for external aborts.The exceptions are:
* virt -- we know that guests won't try to prod devices that we don't describe in the device tree or ACPI tables
* mps2 -- this board was written to use unimplemented-device for all the ranges with devices we don't yet handle
Quoted 6 lines
New boards should not set the flag, but instead be written like the mps2.
Signed-off-by Peter Maydell <[email protected]>For the Xilinx boards:
Reviewed-by Edgar E. Iglesias <[email protected]>
Thanks,
Alistair
Quoted 485 lines
--- hw/arm/aspeed.c | 3 +++ hw/arm/collie.c | 1 + hw/arm/cubieboard.c | 1 + hw/arm/digic_boards.c | 1 + hw/arm/exynos4_boards.c | 2 ++ hw/arm/gumstix.c | 2 ++ hw/arm/highbank.c | 2 ++ hw/arm/imx25_pdk.c | 1 + hw/arm/integratorcp.c | 1 + hw/arm/kzm.c | 1 + hw/arm/mainstone.c | 1 + hw/arm/musicpal.c | 1 + hw/arm/netduino2.c | 1 + hw/arm/nseries.c | 2 ++ hw/arm/omap_sx1.c | 2 ++ hw/arm/palm.c | 1 + hw/arm/raspi.c | 1 + hw/arm/realview.c | 4 ++++ hw/arm/sabrelite.c | 1 + hw/arm/spitz.c | 4 ++++ hw/arm/stellaris.c | 2 ++ hw/arm/tosa.c | 1 + hw/arm/versatilepb.c | 2 ++ hw/arm/vexpress.c | 1 + hw/arm/xilinx_zynq.c | 1 + hw/arm/xlnx-ep108.c | 2 ++ hw/arm/z2.c | 1 + 27 files changed, 43 insertions(+)hw/arm/aspeed.c +3
-0@@ -270,6 +270,7 @@ static void palmetto_bmc_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo palmetto_bmc_type = {@@ -302,6 +303,7 @@ static void ast2500_evb_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo ast2500_evb_type = {@@ -326,6 +328,7 @@ static void romulus_bmc_class_init(ObjectClass *oc, void *data) mc->no_floppy =1 ; mc->no_cdrom =1 ; mc->no_parallel =1 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo romulus_bmc_type = {hw/arm/collie.c +1
-0@@ -64,6 +64,7 @@ static void collie_machine_init(MachineClass *mc) { mc->desc ="Sharp SL-5500 (Collie) PDA (SA-1110)" ; mc->init = collie_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("collie" , collie_machine_init)hw/arm/cubieboard.c +1
-0@@ -86,6 +86,7 @@ static void cubieboard_machine_init(MachineClass *mc) mc->init = cubieboard_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("cubieboard" , cubieboard_machine_init)hw/arm/digic_boards.c +1
-0@@ -155,6 +155,7 @@ static void canon_a1100_machine_init(MachineClass *mc) { mc->desc ="Canon PowerShot A1100 IS" ; mc->init = &canon_a1100_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("canon-a1100" , canon_a1100_machine_init)hw/arm/exynos4_boards.c +2
-0@@ -189,6 +189,7 @@ static void nuri_class_init(ObjectClass *oc, void *data) mc->desc ="Samsung NURI board (Exynos4210)" ; mc->init = nuri_init; mc->max_cpus =EXYNOS4210_NCPUS ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo nuri_type = {@@ -204,6 +205,7 @@ static void smdkc210_class_init(ObjectClass *oc, void *data) mc->desc ="Samsung SMDKC210 board (Exynos4210)" ; mc->init = smdkc210_init; mc->max_cpus =EXYNOS4210_NCPUS ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo smdkc210_type = {hw/arm/gumstix.c +2
-0@@ -128,6 +128,7 @@ static void connex_class_init(ObjectClass *oc, void *data) mc->desc ="Gumstix Connex (PXA255)" ; mc->init = connex_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo connex_type = {@@ -142,6 +143,7 @@ static void verdex_class_init(ObjectClass *oc, void *data) mc->desc ="Gumstix Verdex (PXA270)" ; mc->init = verdex_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo verdex_type = {hw/arm/highbank.c +2
-0@@ -413,6 +413,7 @@ static void highbank_class_init(ObjectClass *oc, void *data) mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo highbank_type = {@@ -430,6 +431,7 @@ static void midway_class_init(ObjectClass *oc, void *data) mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo midway_type = {hw/arm/imx25_pdk.c +1
-0@@ -148,6 +148,7 @@ static void imx25_pdk_machine_init(MachineClass *mc) { mc->desc ="ARM i.MX25 PDK board (ARM926)" ; mc->init = imx25_pdk_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("imx25-pdk" , imx25_pdk_machine_init)hw/arm/integratorcp.c +1
-0@@ -681,6 +681,7 @@ static void integratorcp_machine_init(MachineClass *mc) { mc->desc ="ARM Integrator/CP (ARM926EJ-S)" ; mc->init = integratorcp_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("integratorcp" , integratorcp_machine_init)hw/arm/kzm.c +1
-0@@ -142,6 +142,7 @@ static void kzm_machine_init(MachineClass *mc) { mc->desc ="ARM KZM Emulation Baseboard (ARM1136)" ; mc->init = kzm_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("kzm" , kzm_machine_init)hw/arm/mainstone.c +1
-0@@ -196,6 +196,7 @@ static void mainstone2_machine_init(MachineClass *mc) { mc->desc ="Mainstone II (PXA27x)" ; mc->init = mainstone_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("mainstone" , mainstone2_machine_init)hw/arm/musicpal.c +1
-0@@ -1718,6 +1718,7 @@ static void musicpal_machine_init(MachineClass *mc) { mc->desc ="Marvell 88w8618 / MusicPal (ARM926EJ-S)" ; mc->init = musicpal_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("musicpal" , musicpal_machine_init)hw/arm/netduino2.c +1
-0@@ -45,6 +45,7 @@ static void netduino2_machine_init(MachineClass *mc) { mc->desc ="Netduino 2 Machine" ; mc->init = netduino2_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("netduino2" , netduino2_machine_init)hw/arm/nseries.c +2
-0@@ -1425,6 +1425,7 @@ static void n800_class_init(ObjectClass *oc, void *data) mc->desc ="Nokia N800 tablet aka. RX-34 (OMAP2420)" ; mc->init = n800_init; mc->default_boot_order ="" ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo n800_type = {@@ -1440,6 +1441,7 @@ static void n810_class_init(ObjectClass *oc, void *data) mc->desc ="Nokia N810 tablet aka. RX-44 (OMAP2420)" ; mc->init = n810_init; mc->default_boot_order ="" ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo n810_type = {hw/arm/omap_sx1.c +2
-0@@ -223,6 +223,7 @@ static void sx1_machine_v2_class_init(ObjectClass *oc, void *data) mc->desc ="Siemens SX1 (OMAP310) V2" ; mc->init = sx1_init_v2; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo sx1_machine_v2_type = {@@ -237,6 +238,7 @@ static void sx1_machine_v1_class_init(ObjectClass *oc, void *data) mc->desc ="Siemens SX1 (OMAP310) V1" ; mc->init = sx1_init_v1; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo sx1_machine_v1_type = {hw/arm/palm.c +1
-0@@ -274,6 +274,7 @@ static void palmte_machine_init(MachineClass *mc) { mc->desc ="Palm Tungsten|E aka. Cheetah PDA (OMAP310)" ; mc->init = palmte_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("cheetah" , palmte_machine_init)hw/arm/raspi.c +1
-0@@ -168,5 +168,6 @@ static void raspi2_machine_init(MachineClass *mc) mc->no_cdrom =1 ; mc->max_cpus =BCM2836_NCPUS ; mc->default_ram_size =1024 *1024 *1024 ; + mc->ignore_memory_transaction_failures = true; };DEFINE_MACHINE ("raspi2" , raspi2_machine_init)hw/arm/realview.c +4
-0@@ -398,6 +398,7 @@ static void realview_eb_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Emulation Baseboard (ARM926EJ-S)" ; mc->init = realview_eb_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_eb_type = {@@ -414,6 +415,7 @@ static void realview_eb_mpcore_class_init(ObjectClass *oc, void *data) mc->init = realview_eb_mpcore_init; mc->block_default_type =IF_SCSI ; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_eb_mpcore_type = {@@ -428,6 +430,7 @@ static void realview_pb_a8_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Platform Baseboard for Cortex-A8" ; mc->init = realview_pb_a8_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_pb_a8_type = {@@ -443,6 +446,7 @@ static void realview_pbx_a9_class_init(ObjectClass *oc, void *data) mc->desc ="ARM RealView Platform Baseboard Explore for Cortex-A9" ; mc->init = realview_pbx_a9_init; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo realview_pbx_a9_type = {hw/arm/sabrelite.c +1
-0@@ -122,6 +122,7 @@ static void sabrelite_machine_init(MachineClass *mc) mc->desc ="Freescale i.MX6 Quad SABRE Lite Board (Cortex A9)" ; mc->init = sabrelite_init; mc->max_cpus =FSL_IMX6_NUM_CPUS ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("sabrelite" , sabrelite_machine_init)hw/arm/spitz.c +4
-0@@ -983,6 +983,7 @@ static void akitapda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C1000 (Akita) PDA (PXA270)" ; mc->init = akita_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo akitapda_type = {@@ -998,6 +999,7 @@ static void spitzpda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3000 (Spitz) PDA (PXA270)" ; mc->init = spitz_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo spitzpda_type = {@@ -1013,6 +1015,7 @@ static void borzoipda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3100 (Borzoi) PDA (PXA270)" ; mc->init = borzoi_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo borzoipda_type = {@@ -1028,6 +1031,7 @@ static void terrierpda_class_init(ObjectClass *oc, void *data) mc->desc ="Sharp SL-C3200 (Terrier) PDA (PXA270)" ; mc->init = terrier_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo terrierpda_type = {hw/arm/stellaris.c +2
-0@@ -1453,6 +1453,7 @@ static void lm3s811evb_class_init(ObjectClass *oc, void *data) mc->desc ="Stellaris LM3S811EVB" ; mc->init = lm3s811evb_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo lm3s811evb_type = {@@ -1467,6 +1468,7 @@ static void lm3s6965evb_class_init(ObjectClass *oc, void *data) mc->desc ="Stellaris LM3S6965EVB" ; mc->init = lm3s6965evb_init; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo lm3s6965evb_type = {hw/arm/tosa.c +1
-0@@ -263,6 +263,7 @@ static void tosapda_machine_init(MachineClass *mc) mc->desc ="Sharp SL-6000 (Tosa) PDA (PXA255)" ; mc->init = tosa_init; mc->block_default_type =IF_IDE ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("tosa" , tosapda_machine_init)hw/arm/versatilepb.c +2
-0@@ -403,6 +403,7 @@ static void versatilepb_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile/PB (ARM926EJ-S)" ; mc->init = vpb_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo versatilepb_type = {@@ -418,6 +419,7 @@ static void versatileab_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile/AB (ARM926EJ-S)" ; mc->init = vab_init; mc->block_default_type =IF_SCSI ; + mc->ignore_memory_transaction_failures = true; }static const TypeInfo versatileab_type = {hw/arm/vexpress.c +1
-0@@ -752,6 +752,7 @@ static void vexpress_class_init(ObjectClass *oc, void *data) mc->desc ="ARM Versatile Express" ; mc->init = vexpress_common_init; mc->max_cpus =4 ; + mc->ignore_memory_transaction_failures = true; }static void vexpress_a9_class_init (ObjectClass *oc,void *data)hw/arm/xilinx_zynq.c +1
-0@@ -326,6 +326,7 @@ static void zynq_machine_init(MachineClass *mc) mc->init = zynq_init; mc->max_cpus =1 ; mc->no_sdcard =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xilinx-zynq-a9" , zynq_machine_init)hw/arm/xlnx-ep108.c +2
-0@@ -122,6 +122,7 @@ static void xlnx_ep108_machine_init(MachineClass *mc) mc->init = xlnx_ep108_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xlnx-ep108" , xlnx_ep108_machine_init)@@ -132,6 +133,7 @@ static void xlnx_zcu102_machine_init(MachineClass *mc) mc->init = xlnx_ep108_init; mc->block_default_type =IF_IDE ; mc->units_per_default_bus =1 ; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("xlnx-zcu102" , xlnx_zcu102_machine_init)hw/arm/z2.c +1
-1@@ -370,6 +370,7 @@ static void z2_machine_init(MachineClass *mc) { mc->desc ="Zipit Z2 (PXA27x)" ; mc->init = z2_init; + mc->ignore_memory_transaction_failures = true; }DEFINE_MACHINE ("z2" , z2_machine_init) --2.7.4
PATCH v2 3/3 target/arm: Implement new do_transaction_failed hook
In reply to Peter MaydellImplement the new do_transaction_failed hook for ARM, which should cause the CPU to take a prefetch abort or data abort.
--- target/arm/internals.h | 10 ++++++++++ target/arm/cpu.c | 1 + target/arm/op_helper.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+)
target/arm/internals.h +10 -0
@@ -472,6 +472,16 @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr,MMUAccessType access_type, int mmu_idx, uintptr_t retaddr); +/* arm_cpu_do_transaction_failed: handle a memory system error response +* (eg "no device/memory present at address") by raising an external abort +* exception +*/ +void arm_cpu_do_transaction_failed (CPUState *cs,hwaddr physaddr, +vaddr addr,unsigned size, +MMUAccessType access_type, +int mmu_idx,MemTxAttrs attrs, +MemTxResult response,uintptr_t retaddr); +/* Call the EL change hook if one has been registered */ static inline void arm_call_el_change_hook (ARMCPU *cpu) {
target/arm/cpu.c +1 -0
@@ -1667,6 +1667,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data)#else cc->do_interrupt = arm_cpu_do_interrupt; cc->do_unaligned_access = arm_cpu_do_unaligned_access; + cc->do_transaction_failed = arm_cpu_do_transaction_failed; cc->get_phys_page_attrs_debug = arm_cpu_get_phys_page_attrs_debug; cc->asidx_from_attrs = arm_asidx_from_attrs; cc->vmsd = &vmstate_arm_cpu;
target/arm/op_helper.c +43 -0
49 lines not on this page · raw message
Signature · 1 line
2.7.4