All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/3] s390x updates
@ 2020-10-26 11:13 Cornelia Huck
  2020-10-26 11:13 ` [PULL 1/3] s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset Cornelia Huck
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Cornelia Huck @ 2020-10-26 11:13 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-s390x, Cornelia Huck, qemu-devel

The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430:

  Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 12:33:21 +0100)

are available in the Git repository at:

  https://github.com/cohuck/qemu tags/s390x-20201026

for you to fetch changes up to 3ded270a2697852a71961b45291519ae044f25e3:

  s390x: pv: Fix diag318 PV fencing (2020-10-22 15:47:27 +0200)

----------------------------------------------------------------
some s390x fixes

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

Janosch Frank (2):
  s390x: pv: Remove sclp boundary checks
  s390x: pv: Fix diag318 PV fencing

Matthew Rosato (1):
  s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset

 hw/s390x/s390-virtio-ccw.c  | 1 +
 hw/s390x/sclp.c             | 5 -----
 target/s390x/cpu_features.c | 5 +++++
 target/s390x/cpu_features.h | 4 ++++
 target/s390x/cpu_models.c   | 4 ++++
 target/s390x/kvm.c          | 3 +--
 6 files changed, 15 insertions(+), 7 deletions(-)

-- 
2.26.2



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

* [PULL 1/3] s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset
  2020-10-26 11:13 [PULL 0/3] s390x updates Cornelia Huck
@ 2020-10-26 11:13 ` Cornelia Huck
  2020-10-26 11:13 ` [PULL 2/3] s390x: pv: Remove sclp boundary checks Cornelia Huck
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2020-10-26 11:13 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Eric Farman, Matthew Rosato, Cornelia Huck, qemu-devel,
	qemu-stable, Halil Pasic, Christian Borntraeger, qemu-s390x

From: Matthew Rosato <mjrosato@linux.ibm.com>

Currently, a subsystem reset event leaves PCI devices enabled, causing
issues post-reset in the guest (an example would be after a kexec).  These
devices need to be reset during a subsystem reset, allowing them to be
properly re-enabled afterwards.  Add the S390 PCI host bridge to the list
of qdevs to be reset during subsystem reset.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Acked-by: Halil Pasic <pasic@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: qemu-stable@nongnu.org
Message-Id: <1602767767-32713-1-git-send-email-mjrosato@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/s390-virtio-ccw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index e52182f94633..2e900335eaba 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -101,6 +101,7 @@ static const char *const reset_dev_types[] = {
     "s390-sclp-event-facility",
     "s390-flic",
     "diag288",
+    TYPE_S390_PCI_HOST_BRIDGE,
 };
 
 static void subsystem_reset(void)
-- 
2.26.2



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

* [PULL 2/3] s390x: pv: Remove sclp boundary checks
  2020-10-26 11:13 [PULL 0/3] s390x updates Cornelia Huck
  2020-10-26 11:13 ` [PULL 1/3] s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset Cornelia Huck
@ 2020-10-26 11:13 ` Cornelia Huck
  2020-10-26 11:13 ` [PULL 3/3] s390x: pv: Fix diag318 PV fencing Cornelia Huck
  2020-10-26 15:48 ` [PULL 0/3] s390x updates Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2020-10-26 11:13 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Thomas Huth, Janosch Frank, David Hildenbrand, Cornelia Huck,
	qemu-devel, Halil Pasic, Christian Borntraeger, qemu-s390x,
	Marc Hartmayer, Collin Walling

From: Janosch Frank <frankja@linux.ibm.com>

The SCLP boundary cross check is done by the Ultravisor for a
protected guest, hence we don't need to do it. As QEMU doesn't get a
valid SCCB address in protected mode this is even problematic and can
lead to QEMU reporting a false boundary cross error.

Fixes: db13387ca0 ("s390/sclp: rework sclp boundary checks")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Acked-by: Halil Pasic <pasic@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Message-Id: <20201022103135.126033-2-frankja@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 hw/s390x/sclp.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 00f1e4648db2..0cf229082670 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -285,11 +285,6 @@ int sclp_service_call_protected(CPUS390XState *env, uint64_t sccb,
         goto out_write;
     }
 
-    if (!sccb_verify_boundary(sccb, be16_to_cpu(work_sccb->h.length), code)) {
-        work_sccb->h.response_code = cpu_to_be16(SCLP_RC_SCCB_BOUNDARY_VIOLATION);
-        goto out_write;
-    }
-
     sclp_c->execute(sclp, work_sccb, code);
 out_write:
     s390_cpu_pv_mem_write(env_archcpu(env), 0, work_sccb,
-- 
2.26.2



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

* [PULL 3/3] s390x: pv: Fix diag318 PV fencing
  2020-10-26 11:13 [PULL 0/3] s390x updates Cornelia Huck
  2020-10-26 11:13 ` [PULL 1/3] s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset Cornelia Huck
  2020-10-26 11:13 ` [PULL 2/3] s390x: pv: Remove sclp boundary checks Cornelia Huck
@ 2020-10-26 11:13 ` Cornelia Huck
  2020-10-26 15:48 ` [PULL 0/3] s390x updates Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Cornelia Huck @ 2020-10-26 11:13 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Collin Walling, Janosch Frank, David Hildenbrand, Cornelia Huck,
	qemu-devel, Christian Borntraeger, qemu-s390x, Marc Hartmayer

From: Janosch Frank <frankja@linux.ibm.com>

Diag318 fencing needs to be determined on the current VM PV state and
not on the state that the VM has when we create the CPU model.

Fixes: fabdada935 ("s390: guest support for diagnose 0x318")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
Acked-by: David Hildenbrand <david@redhat.com>
Message-Id: <20201022103135.126033-3-frankja@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 target/s390x/cpu_features.c | 5 +++++
 target/s390x/cpu_features.h | 4 ++++
 target/s390x/cpu_models.c   | 4 ++++
 target/s390x/kvm.c          | 3 +--
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c
index 31ea8df2460e..42fe0bf4ca7a 100644
--- a/target/s390x/cpu_features.c
+++ b/target/s390x/cpu_features.c
@@ -14,6 +14,7 @@
 #include "qemu/osdep.h"
 #include "qemu/module.h"
 #include "cpu_features.h"
+#include "hw/s390x/pv.h"
 
 #define DEF_FEAT(_FEAT, _NAME, _TYPE, _BIT, _DESC) \
     [S390_FEAT_##_FEAT] = {                        \
@@ -105,6 +106,10 @@ void s390_fill_feat_block(const S390FeatBitmap features, S390FeatType type,
         }
         feat = find_next_bit(features, S390_FEAT_MAX, feat + 1);
     }
+
+    if (type == S390_FEAT_TYPE_SCLP_FAC134 && s390_is_pv()) {
+        clear_be_bit(s390_feat_def(S390_FEAT_DIAG_318)->bit, data);
+    }
 }
 
 void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type,
diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h
index ef52ffce83ec..87463f064d2a 100644
--- a/target/s390x/cpu_features.h
+++ b/target/s390x/cpu_features.h
@@ -81,6 +81,10 @@ const S390FeatGroupDef *s390_feat_group_def(S390FeatGroup group);
 
 #define BE_BIT_NR(BIT) (BIT ^ (BITS_PER_LONG - 1))
 
+static inline void clear_be_bit(unsigned int bit_nr, uint8_t *array)
+{
+    array[bit_nr / 8] &= ~(0x80 >> (bit_nr % 8));
+}
 static inline void set_be_bit(unsigned int bit_nr, uint8_t *array)
 {
     array[bit_nr / 8] |= 0x80 >> (bit_nr % 8);
diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index ca484bfda7be..461e0b8f4a8d 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -29,6 +29,7 @@
 #include "hw/pci/pci.h"
 #endif
 #include "qapi/qapi-commands-machine-target.h"
+#include "hw/s390x/pv.h"
 
 #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \
     {                                                                    \
@@ -238,6 +239,9 @@ bool s390_has_feat(S390Feat feat)
         }
         return 0;
     }
+    if (feat == S390_FEAT_DIAG_318 && s390_is_pv()) {
+        return false;
+    }
     return test_bit(feat, cpu->model->features);
 }
 
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index f13eff688caf..baa070fdf7f9 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -2498,8 +2498,7 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model, Error **errp)
      */
     set_bit(S390_FEAT_EXTENDED_LENGTH_SCCB, model->features);
 
-    /* DIAGNOSE 0x318 is not supported under protected virtualization */
-    if (!s390_is_pv() && kvm_check_extension(kvm_state, KVM_CAP_S390_DIAG318)) {
+    if (kvm_check_extension(kvm_state, KVM_CAP_S390_DIAG318)) {
         set_bit(S390_FEAT_DIAG_318, model->features);
     }
 
-- 
2.26.2



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

* Re: [PULL 0/3] s390x updates
  2020-10-26 11:13 [PULL 0/3] s390x updates Cornelia Huck
                   ` (2 preceding siblings ...)
  2020-10-26 11:13 ` [PULL 3/3] s390x: pv: Fix diag318 PV fencing Cornelia Huck
@ 2020-10-26 15:48 ` Peter Maydell
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2020-10-26 15:48 UTC (permalink / raw)
  To: Cornelia Huck; +Cc: qemu-s390x, QEMU Developers

On Mon, 26 Oct 2020 at 11:13, Cornelia Huck <cohuck@redhat.com> wrote:
>
> The following changes since commit 4c5b97bfd0dd54dc27717ae8d1cd10e14eef1430:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/modules-20201022-pull-request' into staging (2020-10-22 12:33:21 +0100)
>
> are available in the Git repository at:
>
>   https://github.com/cohuck/qemu tags/s390x-20201026
>
> for you to fetch changes up to 3ded270a2697852a71961b45291519ae044f25e3:
>
>   s390x: pv: Fix diag318 PV fencing (2020-10-22 15:47:27 +0200)
>
> ----------------------------------------------------------------
> some s390x fixes


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.2
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2020-10-26 15:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 11:13 [PULL 0/3] s390x updates Cornelia Huck
2020-10-26 11:13 ` [PULL 1/3] s390x/s390-virtio-ccw: Reset PCI devices during subsystem reset Cornelia Huck
2020-10-26 11:13 ` [PULL 2/3] s390x: pv: Remove sclp boundary checks Cornelia Huck
2020-10-26 11:13 ` [PULL 3/3] s390x: pv: Fix diag318 PV fencing Cornelia Huck
2020-10-26 15:48 ` [PULL 0/3] s390x updates 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.