All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/10] next round of s390x patches
@ 2016-01-28 11:09 Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size Cornelia Huck
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell; +Cc: Cornelia Huck, borntraeger, jfrei, qemu-devel, agraf

The following changes since commit 39c36a0573d9307d68c0c3336b48e6351ffabc06:

  Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160126-2' into staging (2016-01-26 17:25:11 +0000)

are available in the git repository at:

  git://github.com/cohuck/qemu tags/s390x-20160128

for you to fetch changes up to 234779a2b9141d9386289ba5ed86c9d617567646:

  s390x: s390_cpu_get_phys_page_debug has to return -1 (2016-01-27 15:34:48 +0100)

----------------------------------------------------------------
Mostly bugfixes and small improvements; and the gdb target.xml
patch.

----------------------------------------------------------------

Bo Tu (2):
  watchdog: introduction of get_watchdog_action
  watchdog/diag288: don't reset for action=none|debug|pause

Christian Borntraeger (2):
  s390x/skeys: Fix instance and class size
  s390x/machine: make addon register fields static

David Hildenbrand (3):
  s390x/sclp: add device to the sysbus in sclp_realize
  gdb: provide the name of the architecture in the target.xml
  s390x: s390_cpu_get_phys_page_debug has to return -1

Halil Pasic (1):
  s390x/css: fix control flags during csch

Pierre Morel (1):
  s390x/ioinst: set type and len for SEI response

Song Shan Gong (1):
  s390x: fix generation of event information crw

 gdbstub.c                   | 21 ++++++++++++++-------
 hw/s390x/css.c              | 15 +++++++++++++--
 hw/s390x/css.h              |  1 +
 hw/s390x/s390-skeys.c       |  2 +-
 hw/s390x/sclp.c             |  8 ++++++--
 hw/watchdog/watchdog.c      | 14 +++++---------
 hw/watchdog/wdt_diag288.c   |  7 +++++++
 include/qom/cpu.h           |  3 +++
 include/sysemu/watchdog.h   | 10 ++++++++++
 target-arm/cpu.c            | 12 ++++++++++++
 target-arm/cpu64.c          |  6 ++++++
 target-ppc/translate_init.c | 10 ++++++++++
 target-s390x/cpu.c          |  6 ++++++
 target-s390x/helper.c       |  5 +++--
 target-s390x/ioinst.c       |  4 +++-
 target-s390x/machine.c      |  4 ++--
 16 files changed, 102 insertions(+), 26 deletions(-)

-- 
2.7.0

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 02/10] s390x/machine: make addon register fields static Cornelia Huck
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell; +Cc: Cornelia Huck, borntraeger, jfrei, qemu-devel, agraf

From: Christian Borntraeger <borntraeger@de.ibm.com>

fix a typo that messes up instance and class size.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/s390-skeys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/s390-skeys.c b/hw/s390x/s390-skeys.c
index f2b732e..0cd3407 100644
--- a/hw/s390x/s390-skeys.c
+++ b/hw/s390x/s390-skeys.c
@@ -237,7 +237,7 @@ static const TypeInfo qemu_s390_skeys_info = {
     .instance_init = qemu_s390_skeys_init,
     .instance_size = sizeof(QEMUS390SKeysState),
     .class_init    = qemu_s390_skeys_class_init,
-    .instance_size = sizeof(S390SKeysClass),
+    .class_size    = sizeof(S390SKeysClass),
 };
 
 static void s390_storage_keys_save(QEMUFile *f, void *opaque)
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 02/10] s390x/machine: make addon register fields static
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 03/10] s390x/sclp: add device to the sysbus in sclp_realize Cornelia Huck
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell; +Cc: Cornelia Huck, borntraeger, jfrei, qemu-devel, agraf

From: Christian Borntraeger <borntraeger@de.ibm.com>

No need to have them as global symbol.

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 target-s390x/machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-s390x/machine.c b/target-s390x/machine.c
index b76fb08..96ad0a9 100644
--- a/target-s390x/machine.c
+++ b/target-s390x/machine.c
@@ -48,7 +48,7 @@ static inline bool fpu_needed(void *opaque)
     return true;
 }
 
-const VMStateDescription vmstate_fpu = {
+static const VMStateDescription vmstate_fpu = {
     .name = "cpu/fpu",
     .version_id = 1,
     .minimum_version_id = 1,
@@ -75,7 +75,7 @@ const VMStateDescription vmstate_fpu = {
     }
 };
 
-const VMStateDescription vmstate_vregs = {
+static const VMStateDescription vmstate_vregs = {
     .name = "cpu/vregs",
     .version_id = 1,
     .minimum_version_id = 1,
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 03/10] s390x/sclp: add device to the sysbus in sclp_realize
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 02/10] s390x/machine: make addon register fields static Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 04/10] s390x/ioinst: set type and len for SEI response Cornelia Huck
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: borntraeger, qemu-devel, agraf, David Hildenbrand, jfrei, Cornelia Huck

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

The init of a device should have no side effects. Therefore move
registering of the event facility into the realize function, so
multiple instances of the SCLP device can be created e.g. for
introspection.

Add some more detail as to why we have to add it to the sysbus
at all.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/sclp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 74f2b40..23dee88 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -465,6 +465,12 @@ static void sclp_realize(DeviceState *dev, Error **errp)
     if (err) {
         goto out;
     }
+    /*
+     * qdev_device_add searches the sysbus for TYPE_SCLP_EVENTS_BUS. As long
+     * as we can't find a fitting bus via the qom tree, we have to add the
+     * event facility to the sysbus, so e.g. a sclp console can be created.
+     */
+    qdev_set_parent_bus(DEVICE(sclp->event_facility), sysbus_get_default());
 
     ret = s390_set_memory_limit(machine->maxram_size, &hw_limit);
     if (ret == -E2BIG) {
@@ -533,8 +539,6 @@ static void sclp_init(Object *obj)
 
     new = object_new(TYPE_SCLP_EVENT_FACILITY);
     object_property_add_child(obj, TYPE_SCLP_EVENT_FACILITY, new, NULL);
-    /* qdev_device_add searches the sysbus for TYPE_SCLP_EVENTS_BUS */
-    qdev_set_parent_bus(DEVICE(new), sysbus_get_default());
     object_unref(new);
     sclp->event_facility = EVENT_FACILITY(new);
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 04/10] s390x/ioinst: set type and len for SEI response
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (2 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 03/10] s390x/sclp: add device to the sysbus in sclp_realize Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 05/10] s390x: fix generation of event information crw Cornelia Huck
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, Pierre Morel, qemu-stable, qemu-devel, borntraeger, jfrei,
	Cornelia Huck

From: Pierre Morel <pmorel@linux.vnet.ibm.com>

If no event information is pending, the return code
is set to 0x0005 and the length of the response is
set to 8 bytes.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Song Shan Gong <gongss@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 target-s390x/ioinst.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 77f2a1f..57c2d8b 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -616,7 +616,8 @@ static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res)
             (*res_flags) &= ~0x80;
         }
     } else {
-        res->code = cpu_to_be16(0x0004);
+        res->code = cpu_to_be16(0x0005);
+        res->len = cpu_to_be16(CHSC_MIN_RESP_LEN);
     }
 }
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 05/10] s390x: fix generation of event information crw
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (3 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 04/10] s390x/ioinst: set type and len for SEI response Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 06/10] watchdog: introduction of get_watchdog_action Cornelia Huck
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: Song Shan Gong, qemu-devel, agraf, borntraeger, jfrei, Cornelia Huck

From: Song Shan Gong <gongss@linux.vnet.ibm.com>

Only one channel report word (crw) may be pending if there is
event-information pending.

This patch introduces a bool-type field 'sei_pending' for the
channel subsystem, which indicates whether there are pending events.
It is set when event information is made pending and the crw
generated, and cleared after the guest has collected all pending
event information. A crw is not generated if this flag had already
been set.

Signed-off-by: Song Shan Gong <gongss@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/css.c        | 13 ++++++++++++-
 hw/s390x/css.h        |  1 +
 target-s390x/ioinst.c |  1 +
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 343c352..533357a 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -49,6 +49,7 @@ typedef struct IoAdapter {
 
 typedef struct ChannelSubSys {
     QTAILQ_HEAD(, CrwContainer) pending_crws;
+    bool sei_pending;
     bool do_crw_mchk;
     bool crws_lost;
     uint8_t max_cssid;
@@ -1359,7 +1360,15 @@ void css_generate_chp_crws(uint8_t cssid, uint8_t chpid)
 
 void css_generate_css_crws(uint8_t cssid)
 {
-    css_queue_crw(CRW_RSC_CSS, 0, 0, cssid);
+    if (!channel_subsys->sei_pending) {
+        css_queue_crw(CRW_RSC_CSS, 0, 0, cssid);
+    }
+    channel_subsys->sei_pending = true;
+}
+
+void css_clear_sei_pending(void)
+{
+    channel_subsys->sei_pending = false;
 }
 
 int css_enable_mcsse(void)
@@ -1509,6 +1518,7 @@ static void css_init(void)
 {
     channel_subsys = g_malloc0(sizeof(*channel_subsys));
     QTAILQ_INIT(&channel_subsys->pending_crws);
+    channel_subsys->sei_pending = false;
     channel_subsys->do_crw_mchk = true;
     channel_subsys->crws_lost = false;
     channel_subsys->chnmon_active = false;
@@ -1561,6 +1571,7 @@ void css_reset(void)
         QTAILQ_REMOVE(&channel_subsys->pending_crws, crw_cont, sibling);
         g_free(crw_cont);
     }
+    channel_subsys->sei_pending = false;
     channel_subsys->do_crw_mchk = true;
     channel_subsys->crws_lost = false;
 
diff --git a/hw/s390x/css.h b/hw/s390x/css.h
index a09bb1f..a47937d 100644
--- a/hw/s390x/css.h
+++ b/hw/s390x/css.h
@@ -103,6 +103,7 @@ void css_generate_sch_crws(uint8_t cssid, uint8_t ssid, uint16_t schid,
                            int hotplugged, int add);
 void css_generate_chp_crws(uint8_t cssid, uint8_t chpid);
 void css_generate_css_crws(uint8_t cssid);
+void css_clear_sei_pending(void);
 void css_adapter_interrupt(uint8_t isc);
 
 #define CSS_IO_ADAPTER_VIRTIO 1
diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 57c2d8b..9a8de6d 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -614,6 +614,7 @@ static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res)
             (*res_flags) |= 0x80;
         } else {
             (*res_flags) &= ~0x80;
+            css_clear_sei_pending();
         }
     } else {
         res->code = cpu_to_be16(0x0005);
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 06/10] watchdog: introduction of get_watchdog_action
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (4 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 05/10] s390x: fix generation of event information crw Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 07/10] watchdog/diag288: don't reset for action=none|debug|pause Cornelia Huck
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell; +Cc: Bo Tu, qemu-devel, agraf, borntraeger, jfrei, Cornelia Huck

From: Bo Tu <tubo@linux.vnet.ibm.com>

Add get_watchdog_action(void) to allow access to the configured action.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/watchdog/watchdog.c    | 14 +++++---------
 include/sysemu/watchdog.h | 10 ++++++++++
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 8d4b0ee..81de0e5 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -29,15 +29,6 @@
 #include "qapi-event.h"
 #include "hw/nmi.h"
 
-/* Possible values for action parameter. */
-#define WDT_RESET        1	/* Hard reset. */
-#define WDT_SHUTDOWN     2	/* Shutdown. */
-#define WDT_POWEROFF     3	/* Quit. */
-#define WDT_PAUSE        4	/* Pause. */
-#define WDT_DEBUG        5	/* Prints a message and continues running. */
-#define WDT_NONE         6	/* Do nothing. */
-#define WDT_NMI          7	/* Inject nmi into the guest */
-
 static int watchdog_action = WDT_RESET;
 static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
 
@@ -105,6 +96,11 @@ int select_watchdog_action(const char *p)
     return 0;
 }
 
+int get_watchdog_action(void)
+{
+    return watchdog_action;
+}
+
 /* This actually performs the "action" once a watchdog has expired,
  * ie. reboot, shutdown, exit, etc.
  */
diff --git a/include/sysemu/watchdog.h b/include/sysemu/watchdog.h
index 3e9a970..72a4da0 100644
--- a/include/sysemu/watchdog.h
+++ b/include/sysemu/watchdog.h
@@ -24,6 +24,15 @@
 
 #include "qemu/queue.h"
 
+/* Possible values for action parameter. */
+#define WDT_RESET        1      /* Hard reset. */
+#define WDT_SHUTDOWN     2      /* Shutdown. */
+#define WDT_POWEROFF     3      /* Quit. */
+#define WDT_PAUSE        4      /* Pause. */
+#define WDT_DEBUG        5      /* Prints a message and continues running. */
+#define WDT_NONE         6      /* Do nothing. */
+#define WDT_NMI          7      /* Inject nmi into the guest. */
+
 struct WatchdogTimerModel {
     QLIST_ENTRY(WatchdogTimerModel) entry;
 
@@ -37,6 +46,7 @@ typedef struct WatchdogTimerModel WatchdogTimerModel;
 /* in hw/watchdog.c */
 int select_watchdog(const char *p);
 int select_watchdog_action(const char *action);
+int get_watchdog_action(void);
 void watchdog_add_model(WatchdogTimerModel *model);
 void watchdog_perform_action(void);
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 07/10] watchdog/diag288: don't reset for action=none|debug|pause
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (5 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 06/10] watchdog: introduction of get_watchdog_action Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 08/10] s390x/css: fix control flags during csch Cornelia Huck
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell; +Cc: Bo Tu, qemu-devel, agraf, borntraeger, jfrei, Cornelia Huck

From: Bo Tu <tubo@linux.vnet.ibm.com>

If the watchdog expires and the guest is not notified (NONE, DEBUG, PAUSE),
we must not reset the watchdog device, otherwise watchdog_ping() and
watchdog_stop() will fail when triggered by the guest. This reset behavior
matches to the z/VM behavior when a custom command is to be executed
on expiry.

Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/watchdog/wdt_diag288.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
index 2a885a4..ddda723 100644
--- a/hw/watchdog/wdt_diag288.c
+++ b/hw/watchdog/wdt_diag288.c
@@ -51,6 +51,13 @@ static void diag288_timer_expired(void *dev)
 {
     qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n");
     watchdog_perform_action();
+    /* Reset the watchdog only if the guest was notified about expiry. */
+    switch (get_watchdog_action()) {
+    case WDT_DEBUG:
+    case WDT_NONE:
+    case WDT_PAUSE:
+         return;
+    }
     wdt_diag288_reset(dev);
 }
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 08/10] s390x/css: fix control flags during csch
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (6 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 07/10] watchdog/diag288: don't reset for action=none|debug|pause Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 09/10] gdb: provide the name of the architecture in the target.xml Cornelia Huck
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: agraf, Halil Pasic, qemu-stable, qemu-devel, borntraeger, jfrei,
	Cornelia Huck

From: Halil Pasic <pasic@linux.vnet.ibm.com>

>From the beginning, css support contained an error in csch handling:
instead of setting the clear bit in the function control bits twice, we
need to set the clear pending bit in the activity control bits. Let's
fix this.

Cc: qemu-stable@nongnu.org
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 533357a..e83bf60 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -702,7 +702,7 @@ int css_do_csch(SubchDev *sch)
 
     /* Trigger the clear function. */
     s->ctrl &= ~(SCSW_CTRL_MASK_FCTL | SCSW_CTRL_MASK_ACTL);
-    s->ctrl |= SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_CLEAR_FUNC;
+    s->ctrl |= SCSW_FCTL_CLEAR_FUNC | SCSW_ACTL_CLEAR_PEND;
 
     do_subchannel_work(sch, NULL);
     ret = 0;
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 09/10] gdb: provide the name of the architecture in the target.xml
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (7 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 08/10] s390x/css: fix control flags during csch Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 11:09 ` [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1 Cornelia Huck
  2016-01-28 13:41 ` [Qemu-devel] [PULL 00/10] next round of s390x patches Peter Maydell
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: borntraeger, qemu-devel, agraf, David Hildenbrand, jfrei, Cornelia Huck

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

This patch provides the name of the architecture in the target.xml
if available.

This allows the remote gdb to detect the target architecture on its
own - so there is no need to specify it manually (e.g. if gdb is
started without a binary) using "set arch *arch_name*".

The name of the architecture is provided by a callback that can
be implemented by all architectures. The arm implementation has
special handling for iwmmxt and returns arm otherwise. This can
be extended if necessary.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
[rework to use a callback]
Message-Id: <1449144881-130935-1-git-send-email-borntraeger@de.ibm.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 gdbstub.c                   | 21 ++++++++++++++-------
 include/qom/cpu.h           |  3 +++
 target-arm/cpu.c            | 12 ++++++++++++
 target-arm/cpu64.c          |  6 ++++++
 target-ppc/translate_init.c | 10 ++++++++++
 target-s390x/cpu.c          |  6 ++++++
 6 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/gdbstub.c b/gdbstub.c
index 1a84c1a..59d1650 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -540,13 +540,20 @@ static const char *get_feature_xml(const char *p, const char **newp,
             GDBRegisterState *r;
             CPUState *cpu = first_cpu;
 
-            snprintf(target_xml, sizeof(target_xml),
-                     "<?xml version=\"1.0\"?>"
-                     "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"
-                     "<target>"
-                     "<xi:include href=\"%s\"/>",
-                     cc->gdb_core_xml_file);
-
+            pstrcat(target_xml, sizeof(target_xml),
+                    "<?xml version=\"1.0\"?>"
+                    "<!DOCTYPE target SYSTEM \"gdb-target.dtd\">"
+                    "<target>");
+            if (cc->gdb_arch_name) {
+                gchar *arch = cc->gdb_arch_name(cpu);
+                pstrcat(target_xml, sizeof(target_xml), "<architecture>");
+                pstrcat(target_xml, sizeof(target_xml), arch);
+                pstrcat(target_xml, sizeof(target_xml), "</architecture>");
+                g_free(arch);
+            }
+            pstrcat(target_xml, sizeof(target_xml), "<xi:include href=\"");
+            pstrcat(target_xml, sizeof(target_xml), cc->gdb_core_xml_file);
+            pstrcat(target_xml, sizeof(target_xml), "\"/>");
             for (r = cpu->gdb_regs; r; r = r->next) {
                 pstrcat(target_xml, sizeof(target_xml), "<xi:include href=\"");
                 pstrcat(target_xml, sizeof(target_xml), r->xml);
diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index 2e5229d..035179c 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -120,6 +120,8 @@ struct TranslationBlock;
  * @gdb_core_xml_file: File name for core registers GDB XML description.
  * @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop
  *           before the insn which triggers a watchpoint rather than after it.
+ * @gdb_arch_name: Optional callback that returns the architecture name known
+ * to GDB. The caller must free the returned string with g_free.
  * @cpu_exec_enter: Callback for cpu_exec preparation.
  * @cpu_exec_exit: Callback for cpu_exec cleanup.
  * @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec.
@@ -177,6 +179,7 @@ typedef struct CPUClass {
     const struct VMStateDescription *vmsd;
     int gdb_num_core_regs;
     const char *gdb_core_xml_file;
+    gchar * (*gdb_arch_name)(CPUState *cpu);
     bool gdb_stop_before_watchpoint;
 
     void (*cpu_exec_enter)(CPUState *cpu);
diff --git a/target-arm/cpu.c b/target-arm/cpu.c
index 6c34476..0e582c4 100644
--- a/target-arm/cpu.c
+++ b/target-arm/cpu.c
@@ -1426,6 +1426,17 @@ static int arm_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw,
 }
 #endif
 
+static gchar *arm_gdb_arch_name(CPUState *cs)
+{
+    ARMCPU *cpu = ARM_CPU(cs);
+    CPUARMState *env = &cpu->env;
+
+    if (arm_feature(env, ARM_FEATURE_IWMMXT)) {
+        return g_strdup("iwmmxt");
+    }
+    return g_strdup("arm");
+}
+
 static void arm_cpu_class_init(ObjectClass *oc, void *data)
 {
     ARMCPUClass *acc = ARM_CPU_CLASS(oc);
@@ -1460,6 +1471,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data)
 #endif
     cc->gdb_num_core_regs = 26;
     cc->gdb_core_xml_file = "arm-core.xml";
+    cc->gdb_arch_name = arm_gdb_arch_name;
     cc->gdb_stop_before_watchpoint = true;
     cc->debug_excp_handler = arm_debug_excp_handler;
 
diff --git a/target-arm/cpu64.c b/target-arm/cpu64.c
index cc177bb..c847513 100644
--- a/target-arm/cpu64.c
+++ b/target-arm/cpu64.c
@@ -287,6 +287,11 @@ static void aarch64_cpu_set_pc(CPUState *cs, vaddr value)
     }
 }
 
+static gchar *aarch64_gdb_arch_name(CPUState *cs)
+{
+    return g_strdup("aarch64");
+}
+
 static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
 {
     CPUClass *cc = CPU_CLASS(oc);
@@ -297,6 +302,7 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void *data)
     cc->gdb_write_register = aarch64_cpu_gdb_write_register;
     cc->gdb_num_core_regs = 34;
     cc->gdb_core_xml_file = "aarch64-core.xml";
+    cc->gdb_arch_name = aarch64_gdb_arch_name;
 }
 
 static void aarch64_cpu_register(const ARMCPUInfo *info)
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 4ab2d92..d7e1a4e 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9681,6 +9681,15 @@ static bool ppc_pvr_match_default(PowerPCCPUClass *pcc, uint32_t pvr)
     return pcc->pvr == pvr;
 }
 
+static gchar *ppc_gdb_arch_name(CPUState *cs)
+{
+#if defined(TARGET_PPC64)
+    return g_strdup("powerpc:common64");
+#else
+    return g_strdup("powerpc:common");
+#endif
+}
+
 static void ppc_cpu_class_init(ObjectClass *oc, void *data)
 {
     PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc);
@@ -9724,6 +9733,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
     cc->gdb_num_core_regs = 71 + 32;
 #endif
 
+    cc->gdb_arch_name = ppc_gdb_arch_name;
 #if defined(TARGET_PPC64)
     cc->gdb_core_xml_file = "power64-core.xml";
 #else
diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c
index e5a3f65..792310e 100644
--- a/target-s390x/cpu.c
+++ b/target-s390x/cpu.c
@@ -325,6 +325,11 @@ unsigned int s390_cpu_set_state(uint8_t cpu_state, S390CPU *cpu)
 }
 #endif
 
+static gchar *s390_gdb_arch_name(CPUState *cs)
+{
+    return g_strdup("s390:64-bit");
+}
+
 static void s390_cpu_class_init(ObjectClass *oc, void *data)
 {
     S390CPUClass *scc = S390_CPU_CLASS(oc);
@@ -360,6 +365,7 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data)
 
     cc->gdb_num_core_regs = S390_NUM_CORE_REGS;
     cc->gdb_core_xml_file = "s390x-core64.xml";
+    cc->gdb_arch_name = s390_gdb_arch_name;
 
     /*
      * Reason: s390_cpu_initfn() calls cpu_exec_init(), which saves
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (8 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 09/10] gdb: provide the name of the architecture in the target.xml Cornelia Huck
@ 2016-01-28 11:09 ` Cornelia Huck
  2016-01-28 13:41 ` [Qemu-devel] [PULL 00/10] next round of s390x patches Peter Maydell
  10 siblings, 0 replies; 12+ messages in thread
From: Cornelia Huck @ 2016-01-28 11:09 UTC (permalink / raw)
  To: peter.maydell
  Cc: borntraeger, qemu-devel, agraf, David Hildenbrand, jfrei, Cornelia Huck

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

If translation fails, we have to return -1. For now, we
would simply return the value last stored to raddr (if any).

This way, reading invalid memory via gdb will return values, although it
shouldn't.

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 target-s390x/helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index e541d69..1231e58 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -162,8 +162,9 @@ hwaddr s390_cpu_get_phys_page_debug(CPUState *cs, vaddr vaddr)
         vaddr &= 0x7fffffff;
     }
 
-    mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false);
-
+    if (mmu_translate(env, vaddr, MMU_INST_FETCH, asc, &raddr, &prot, false)) {
+        return -1;
+    }
     return raddr;
 }
 
-- 
2.7.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] [PULL 00/10] next round of s390x patches
  2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
                   ` (9 preceding siblings ...)
  2016-01-28 11:09 ` [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1 Cornelia Huck
@ 2016-01-28 13:41 ` Peter Maydell
  10 siblings, 0 replies; 12+ messages in thread
From: Peter Maydell @ 2016-01-28 13:41 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Christian Borntraeger, Jens Freimann, QEMU Developers, Alexander Graf

On 28 January 2016 at 11:09, Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> The following changes since commit 39c36a0573d9307d68c0c3336b48e6351ffabc06:
>
>   Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160126-2' into staging (2016-01-26 17:25:11 +0000)
>
> are available in the git repository at:
>
>   git://github.com/cohuck/qemu tags/s390x-20160128
>
> for you to fetch changes up to 234779a2b9141d9386289ba5ed86c9d617567646:
>
>   s390x: s390_cpu_get_phys_page_debug has to return -1 (2016-01-27 15:34:48 +0100)
>
> ----------------------------------------------------------------
> Mostly bugfixes and small improvements; and the gdb target.xml
> patch.
>
> ----------------------------------------------------------------

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-01-28 13:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 11:09 [Qemu-devel] [PULL 00/10] next round of s390x patches Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 01/10] s390x/skeys: Fix instance and class size Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 02/10] s390x/machine: make addon register fields static Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 03/10] s390x/sclp: add device to the sysbus in sclp_realize Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 04/10] s390x/ioinst: set type and len for SEI response Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 05/10] s390x: fix generation of event information crw Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 06/10] watchdog: introduction of get_watchdog_action Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 07/10] watchdog/diag288: don't reset for action=none|debug|pause Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 08/10] s390x/css: fix control flags during csch Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 09/10] gdb: provide the name of the architecture in the target.xml Cornelia Huck
2016-01-28 11:09 ` [Qemu-devel] [PULL 10/10] s390x: s390_cpu_get_phys_page_debug has to return -1 Cornelia Huck
2016-01-28 13:41 ` [Qemu-devel] [PULL 00/10] next round of s390x patches 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.