* [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false
@ 2017-11-01 6:58 Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 1/3] hw/arm: Mark the "fsl, imx6" device " Thomas Huth
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Thomas Huth @ 2017-11-01 6:58 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: qemu-arm
These devices can not be used by the user directly and cause QEMU
to abort() if the user tried it anyway. So simply mark the devices
with user_creatable = false to avoid that the users can run into
this unpleasant situation.
Thomas Huth (3):
hw/arm: Mark the "fsl,imx6" device with user_creatable = false
hw/arm: Mark the "fsl,imx25" device with user_creatable = false
hw/arm: Mark the "fsl,imx31" device with user_creatable = false
hw/arm/fsl-imx25.c | 6 +++++-
hw/arm/fsl-imx31.c | 6 +++++-
hw/arm/fsl-imx6.c | 3 ++-
3 files changed, 12 insertions(+), 3 deletions(-)
--
1.8.3.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 1/3] hw/arm: Mark the "fsl, imx6" device with user_creatable = false
2017-11-01 6:58 [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false Thomas Huth
@ 2017-11-01 6:58 ` Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 2/3] hw/arm: Mark the "fsl, imx25" " Thomas Huth
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-11-01 6:58 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: qemu-arm
This device causes QEMU to abort if the user tries to instantiate it:
$ qemu-system-aarch64 -M sabrelite -smp 1,maxcpus=2 -device fsl,,imx6
Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:222:
qemu-system-aarch64: -device fsl,,imx6: Device 'serial0' is in use
Aborted (core dumped)
The device uses serial_hds[] directly in its realize function, so it
can not be instantiated again by the user.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/fsl-imx6.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c
index 26fd214..59ef33e 100644
--- a/hw/arm/fsl-imx6.c
+++ b/hw/arm/fsl-imx6.c
@@ -440,8 +440,9 @@ static void fsl_imx6_class_init(ObjectClass *oc, void *data)
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = fsl_imx6_realize;
-
dc->desc = "i.MX6 SOC";
+ /* Reason: Uses serial_hds[] in the realize() function */
+ dc->user_creatable = false;
}
static const TypeInfo fsl_imx6_type_info = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 2/3] hw/arm: Mark the "fsl, imx25" device with user_creatable = false
2017-11-01 6:58 [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 1/3] hw/arm: Mark the "fsl, imx6" device " Thomas Huth
@ 2017-11-01 6:58 ` Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 3/3] hw/arm: Mark the "fsl, imx31" " Thomas Huth
2017-11-02 15:07 ` [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices " Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-11-01 6:58 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: qemu-arm
QEMU currently crashes when the user tries to instantiate the fsl,imx25
device manually:
$ aarch64-softmmu/qemu-system-aarch64 -S -M imx25-pdk -device fsl,,imx25
**
ERROR:/home/thuth/devel/qemu/tcg/tcg.c:538:tcg_register_thread:
assertion failed: (n < max_cpus)
The imx25-pdk board (which is the one that uses this CPU type) only
supports one CPU, and the realize function of the "fsl,imx25" device
also uses serial_hds[] directly, so this device clearly can not be
instantiated twice and thus we should mark it with user_creatable = 0.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/fsl-imx25.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c
index 3b97ece..cb988a6 100644
--- a/hw/arm/fsl-imx25.c
+++ b/hw/arm/fsl-imx25.c
@@ -288,8 +288,12 @@ static void fsl_imx25_class_init(ObjectClass *oc, void *data)
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = fsl_imx25_realize;
-
dc->desc = "i.MX25 SOC";
+ /*
+ * Reason: uses serial_hds in realize and the imx25 board does not
+ * support multiple CPUs
+ */
+ dc->user_creatable = false;
}
static const TypeInfo fsl_imx25_type_info = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [Qemu-devel] [PATCH 3/3] hw/arm: Mark the "fsl, imx31" device with user_creatable = false
2017-11-01 6:58 [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 1/3] hw/arm: Mark the "fsl, imx6" device " Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 2/3] hw/arm: Mark the "fsl, imx25" " Thomas Huth
@ 2017-11-01 6:58 ` Thomas Huth
2017-11-02 15:07 ` [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices " Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-11-01 6:58 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: qemu-arm
QEMU currently crashes when the user tries to instantiate the fsl,imx31
device manually:
$ aarch64-softmmu/qemu-system-aarch64 -M kzm -device fsl,,imx31
**
ERROR:/home/thuth/devel/qemu/tcg/tcg.c:538:tcg_register_thread:
assertion failed: (n < max_cpus)
Aborted (core dumped)
The kzm board (which is the one that uses this CPU type) only supports
one CPU, and the realize function of the "fsl,imx31" device also uses
serial_hds[] directly, so this device clearly can not be instantiated
twice and thus we should mark it with user_creatable = false.
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
hw/arm/fsl-imx31.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/hw/arm/fsl-imx31.c b/hw/arm/fsl-imx31.c
index 0f2ebe8..3eee83d 100644
--- a/hw/arm/fsl-imx31.c
+++ b/hw/arm/fsl-imx31.c
@@ -260,8 +260,12 @@ static void fsl_imx31_class_init(ObjectClass *oc, void *data)
DeviceClass *dc = DEVICE_CLASS(oc);
dc->realize = fsl_imx31_realize;
-
dc->desc = "i.MX31 SOC";
+ /*
+ * Reason: uses serial_hds in realize and the kzm board does not
+ * support multiple CPUs
+ */
+ dc->user_creatable = false;
}
static const TypeInfo fsl_imx31_type_info = {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false
2017-11-01 6:58 [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false Thomas Huth
` (2 preceding siblings ...)
2017-11-01 6:58 ` [Qemu-devel] [PATCH 3/3] hw/arm: Mark the "fsl, imx31" " Thomas Huth
@ 2017-11-02 15:07 ` Peter Maydell
3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2017-11-02 15:07 UTC (permalink / raw)
To: Thomas Huth; +Cc: QEMU Developers, qemu-arm
On 1 November 2017 at 06:58, Thomas Huth <thuth@redhat.com> wrote:
> These devices can not be used by the user directly and cause QEMU
> to abort() if the user tried it anyway. So simply mark the devices
> with user_creatable = false to avoid that the users can run into
> this unpleasant situation.
>
> Thomas Huth (3):
> hw/arm: Mark the "fsl,imx6" device with user_creatable = false
> hw/arm: Mark the "fsl,imx25" device with user_creatable = false
> hw/arm: Mark the "fsl,imx31" device with user_creatable = false
>
> hw/arm/fsl-imx25.c | 6 +++++-
> hw/arm/fsl-imx31.c | 6 +++++-
> hw/arm/fsl-imx6.c | 3 ++-
> 3 files changed, 12 insertions(+), 3 deletions(-)
Applied to target-arm.next, thanks.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-11-02 15:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-01 6:58 [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices with user_creatable = false Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 1/3] hw/arm: Mark the "fsl, imx6" device " Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 2/3] hw/arm: Mark the "fsl, imx25" " Thomas Huth
2017-11-01 6:58 ` [Qemu-devel] [PATCH 3/3] hw/arm: Mark the "fsl, imx31" " Thomas Huth
2017-11-02 15:07 ` [Qemu-devel] [PATCH 0/3] hw/arm: Mark the "fsl, imx" devices " Peter Maydell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.