Skip to contentSkip to conversation

hw/s390x/sclp: Mark the sclp device with user_creatable = false

PATCH Applied Thomas Huth 6 participants 9 messages Oct 4, 2017 – Oct 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/s390x/sclp: Mark the sclp device with user_creatable = false

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
 hw/s390x/sclp.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/s390x/sclp.c +5 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void *data)
     dc->realize = sclp_realize;
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
     sc->read_SCP_info = read_SCP_info;
     sc->read_storage_element0_info = read_storage_element0_info;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · On Wed, 4 Oct 2017 15:53:19 +0200 Thomas Huth <[email protected]> wrote:

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
 hw/s390x/sclp.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/s390x/sclp.c +0 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc,
 void *data) dc->realize = sclp_realize;

hw/s390x/sclp.c static void sclp_class_init(ObjectClass *oc, · line 616

Quoted 10 lines
hw/s390x/sclp.c +5 -0
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
     sc->read_SCP_info = read_SCP_info;
     sc->read_storage_element0_info = read_storage_element0_info;

makes sense

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 24 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
 hw/s390x/sclp.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/s390x/sclp.c +0 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void *data)
     dc->realize = sclp_realize;

hw/s390x/sclp.c static void sclp_class_init(ObjectClass *oc, void *data) · line 616

Quoted 10 lines
hw/s390x/sclp.c +5 -0
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
     sc->read_SCP_info = read_SCP_info;
     sc->read_storage_element0_info = read_storage_element0_info;
Acked-by on v1 1/1
#3 lore raw
In reply to Thomas Huth
Quoted 7 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine
Quoted 7 lines

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

While I'm not really familiar with the sclp code, I do understand the measure (user_creatable = false), but I'm not sure I understand the explanation. So it's:

---

Quoted 20 lines
 hw/s390x/sclp.c | 5 +++++
 1 file changed, 5 insertions(+)
hw/s390x/sclp.c +5 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void *data)
     dc->realize = sclp_realize;
     dc->hotpluggable = false;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
     sc->read_SCP_info = read_SCP_info;
     sc->read_storage_element0_info = read_storage_element0_info;
#4 lore raw
In reply to Thomas Huth
Quoted 24 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
  hw/s390x/sclp.c | 5 +++++
  1 file changed, 5 insertions(+)
hw/s390x/sclp.c +0 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void *data)
      dc->realize = sclp_realize;

hw/s390x/sclp.c static void sclp_class_init(ObjectClass *oc, void *data) · line 616

Quoted 10 lines
hw/s390x/sclp.c +5 -0
      dc->hotpluggable = false;
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
      sc->read_SCP_info = read_SCP_info;
      sc->read_storage_element0_info = read_storage_element0_info;

I must miss something.
Why is the sclp device not a SYS_BUS_DEVICE ?
The problem seems to come from the heterogeneity of the sclp and sclp generated devices.

Signature · 2 lines
Pierre Morel
Linux/KVM/QEMU in Böblingen - Germany
#5 lore raw
Quoted 32 lines · On Wed, 4 Oct 2017 17:18:57 +0200 Pierre Morel <[email protected]>…
Quoted 31 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
  hw/s390x/sclp.c | 5 +++++
  1 file changed, 5 insertions(+)
hw/s390x/sclp.c +5 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void *data)
      dc->realize = sclp_realize;
      dc->hotpluggable = false;
      set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
Quoted 9 lines

hw/s390x/sclp.c static void sclp_class_init(ObjectClass *oc, void *data) · line 616

Quoted 3 lines
hw/s390x/sclp.c +0 -0
      sc->read_SCP_info = read_SCP_info;
      sc->read_storage_element0_info = read_storage_element0_info;

I must miss something.
Why is the sclp device not a SYS_BUS_DEVICE ?
The problem seems to come from the heterogeneity of the sclp and sclp generated devices.

I think the problem is 'not pluggable' rather than whether it is or is not a sysbus device, no?

#6 lore raw
In reply to Pierre Morel
Quoted 34 lines · Pierre Morel
Quoted 33 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
  hw/s390x/sclp.c | 5 +++++

  1 file changed, 5 insertions(+)
hw/s390x/sclp.c +5 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void
 *data)
       dc->realize = sclp_realize;
       dc->hotpluggable = false;
       set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
Quoted 8 lines
Quoted 3 lines
hw/s390x/sclp.c +0 -0
       sc->read_SCP_info = read_SCP_info;

      sc->read_storage_element0_info = read_storage_element0_info;

I must miss something.
Why is the sclp device not a SYS_BUS_DEVICE ?
The problem seems to come from the heterogeneity of the sclp and sclp generated devices.

I wonder whether it should rather be the other way round: Why is TYPE_SCLP_EVENT_FACILITY a sysbus device? Sysbus is an abstraction for simple on-board devices, while TYPE_SCLP_EVENT_FACILITY seems rather to be a pseudo-device... so it should rather simply be of TYPE_DEVICE instead? Or do I miss something?

Thomas

#8 lore raw
In reply to Thomas Huth
Quoted 12 lines · On Wed, 4 Oct 2017 15:53:19 +0200 Thomas Huth <[email protected]> wrote:

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

Quoted 4 lines
---
 hw/s390x/sclp.c | 5 +++++
 1 file changed, 5 insertions(+)

Thanks, applied.

#7 lore raw
In reply to Thomas Huth
Quoted 44 lines · On Wed, 4 Oct 2017 19:06:57 +0200 Thomas Huth <[email protected]> wrote:
Quoted 34 lines · Pierre Morel
Quoted 33 lines · Thomas Huth

The "sclp" device is just an internal device that can not be instantiated by the users. If they try to use it, they only get a simple error message:

$ qemu-system-s390x -nographic -device sclp
qemu-system-s390x: Option '-device s390-sclp-event-facility' cannot be
handled by this machine

Since sclp_init() tries to create a TYPE_SCLP_EVENT_FACILITY which is a non-pluggable sysbus device, there is really no way that the "sclp" device can be used by the user, so let's set the user_creatable = false accordingly.

---
  hw/s390x/sclp.c | 5 +++++

  1 file changed, 5 insertions(+)
hw/s390x/sclp.c +5 -0
index 30aefbf..9be0cb8 100644
@@ -606,6 +606,11 @@ static void sclp_class_init(ObjectClass *oc, void
 *data)
       dc->realize = sclp_realize;
       dc->hotpluggable = false;
       set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+    /*
+     * Reason: Creates TYPE_SCLP_EVENT_FACILITY in sclp_init
+     * which is a non-pluggable sysbus device
+     */
+    dc->user_creatable = false;
 
Quoted 8 lines
Quoted 3 lines
hw/s390x/sclp.c +0 -0
       sc->read_SCP_info = read_SCP_info;

      sc->read_storage_element0_info = read_storage_element0_info;

I must miss something.
Why is the sclp device not a SYS_BUS_DEVICE ?
The problem seems to come from the heterogeneity of the sclp and sclp generated devices.

Quoted 5 lines

I wonder whether it should rather be the other way round: Why is TYPE_SCLP_EVENT_FACILITY a sysbus device? Sysbus is an abstraction for simple on-board devices, while TYPE_SCLP_EVENT_FACILITY seems rather to be a pseudo-device... so it should rather simply be of TYPE_DEVICE instead? Or do I miss something?

We do have a number of devices that are sysbus because you could not have bus-less devices back then. We might want to convert them to a simple TYPE_DEVICE, but this needs double-checking regarding resets and other things and I'd rather not spend that much time on that right now.