[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 09/10] msf2: Unbreak device-list-properties for "msf-soc"
From: |
Thomas Huth |
Subject: |
[PULL 09/10] msf2: Unbreak device-list-properties for "msf-soc" |
Date: |
Tue, 21 Jul 2020 10:10:54 +0200 |
From: Markus Armbruster <armbru@redhat.com>
Watch this:
$ qemu-system-aarch64 -M ast2600-evb -S -display none -qmp stdio
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 0, "major": 5},
"package": "v5.0.0-2464-g3a9163af4e"}, "capabilities": ["oob"]}}
{"execute": "qmp_capabilities"}
{"return": {}}
{"execute": "device-list-properties", "arguments": {"typename": "msf2-soc"}}
Unsupported NIC model: ftgmac100
armbru@dusky:~/work/images$ echo $?
1
This is what breaks "make check SPEED=slow".
Root cause is m2sxxx_soc_initfn()'s messing with nd_table[] via
qemu_check_nic_model(). That's wrong.
We fixed the exact same bug for device "allwinner-a10" in commit
8aabc5437b "hw/arm/allwinner-a10: Do not use nd_table in instance_init
function". Fix this instance the same way: move the offending code to
m2sxxx_soc_realize(), where it's less wrong, and add a FIXME comment.
Fixes: 05b7374a58 ("msf2: Add EMAC block to SmartFusion2 SoC")
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200715140440.3540942-2-armbru@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/msf2-soc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/arm/msf2-soc.c b/hw/arm/msf2-soc.c
index 16bb7c9916..33ea7df342 100644
--- a/hw/arm/msf2-soc.c
+++ b/hw/arm/msf2-soc.c
@@ -82,10 +82,6 @@ static void m2sxxx_soc_initfn(Object *obj)
}
object_initialize_child(obj, "emac", &s->emac, TYPE_MSS_EMAC);
- if (nd_table[0].used) {
- qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
- qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
- }
}
static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
@@ -187,6 +183,11 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error
**errp)
g_free(bus_name);
}
+ /* FIXME use qdev NIC properties instead of nd_table[] */
+ if (nd_table[0].used) {
+ qemu_check_nic_model(&nd_table[0], TYPE_MSS_EMAC);
+ qdev_set_nic_properties(DEVICE(&s->emac), &nd_table[0]);
+ }
dev = DEVICE(&s->emac);
object_property_set_link(OBJECT(&s->emac), "ahb-bus",
OBJECT(get_system_memory()), &error_abort);
--
2.18.1
- [PULL 00/10] qtest / fuzzer patches, Thomas Huth, 2020/07/21
- [PULL 01/10] scripts/oss-fuzz: Limit target list to i386-softmmu, Thomas Huth, 2020/07/21
- [PULL 02/10] fuzz: Fix leak when assembling datadir path string, Thomas Huth, 2020/07/21
- [PULL 03/10] gitlab-ci.yml: Add oss-fuzz build tests, Thomas Huth, 2020/07/21
- [PULL 04/10] fuzz: build without AddressSanitizer, by default, Thomas Huth, 2020/07/21
- [PULL 05/10] docs/fuzz: describe building fuzzers with enable-sanitizers, Thomas Huth, 2020/07/21
- [PULL 07/10] docs/fuzz: add instructions for generating a coverage report, Thomas Huth, 2020/07/21
- [PULL 06/10] docs/fuzz: add information about useful libFuzzer flags, Thomas Huth, 2020/07/21
- [PULL 10/10] hw: Mark nd_table[] misuse in realize methods FIXME, Thomas Huth, 2020/07/21
- [PULL 08/10] MAINTAINERS: Extend the device fuzzing section, Thomas Huth, 2020/07/21
- [PULL 09/10] msf2: Unbreak device-list-properties for "msf-soc",
Thomas Huth <=
- Re: [PULL 00/10] qtest / fuzzer patches, Peter Maydell, 2020/07/21