8a474dcd07
- Include upstream patches targeted for the next stable release (bug fixes only) block-io-fix-bdrv_co_do_copy_on_readv.patch compat-disable-edid-on-correct-virtio-gp.patch target-ppc-Fix-rlwinm-on-ppc64.patch vhost-correctly-turn-on-VIRTIO_F_IOMMU_P.patch - s390x Protected Virtualization support - start and control guest in secure mode. (note: binary patch from patch series dropped since for s390x we rebuild the patched binary anyways) (bsc#1167075 jsc#SLE-7407) s390-sclp-improve-special-wait-psw-logic.patch s390x-Add-missing-vcpu-reset-functions.patch s390x-Add-SIDA-memory-ops.patch s390x-Add-unpack-facility-feature-to-GA1.patch s390x-Beautify-diag308-handling.patch s390x-Don-t-do-a-normal-reset-on-the-ini.patch s390x-ipl-Consolidate-iplb-validity-chec.patch s390x-kvm-Make-kvm_sclp_service_call-voi.patch s390x-Move-clear-reset.patch s390x-Move-diagnose-308-subcodes-and-rcs.patch s390x-Move-initial-reset.patch s390x-Move-reset-normal-to-shared-reset-.patch s390x-protvirt-Add-migration-blocker.patch s390x-protvirt-Disable-address-checks-fo.patch s390x-protvirt-Handle-SIGP-store-status-.patch s390x-protvirt-Inhibit-balloon-when-swit.patch s390x-protvirt-KVM-intercept-changes.patch s390x-protvirt-Move-diag-308-data-over-S.patch s390x-protvirt-Move-IO-control-structure.patch s390x-protvirt-Move-STSI-data-over-SIDAD.patch s390x-protvirt-SCLP-interpretation.patch s390x-protvirt-Set-guest-IPL-PSW.patch s390x-protvirt-Support-unpack-facility.patch Sync-pv.patch OBS-URL: https://build.opensuse.org/request/show/787000 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=538
65 lines
2.3 KiB
Diff
65 lines
2.3 KiB
Diff
From: Janosch Frank <frankja@linux.ibm.com>
|
|
Date: Tue, 10 Mar 2020 05:09:50 -0400
|
|
Subject: s390x: ipl: Consolidate iplb validity check into one function
|
|
|
|
References: bsc#1167075
|
|
|
|
It's nicer to just call one function than calling a function for each
|
|
possible iplb type.
|
|
|
|
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
|
|
Reviewed-by: David Hildenbrand <david@redhat.com>
|
|
Message-Id: <20200310090950.61172-1-frankja@linux.ibm.com>
|
|
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
|
|
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
|
|
(cherry picked from commit 94c21436e5a89143f8b9cb4d089d1a2f3f4fd377)
|
|
Signed-off-by: Bruce Rogers <brogers@suse.com>
|
|
---
|
|
hw/s390x/ipl.h | 18 +++++++++---------
|
|
target/s390x/diag.c | 2 +-
|
|
2 files changed, 10 insertions(+), 10 deletions(-)
|
|
|
|
diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
|
|
index d4813105db33253fd1eba53cd7e3..3e44abe1c651d8a01f4708c2801c 100644
|
|
--- a/hw/s390x/ipl.h
|
|
+++ b/hw/s390x/ipl.h
|
|
@@ -173,16 +173,16 @@ static inline bool iplb_valid_len(IplParameterBlock *iplb)
|
|
return be32_to_cpu(iplb->len) <= sizeof(IplParameterBlock);
|
|
}
|
|
|
|
-static inline bool iplb_valid_ccw(IplParameterBlock *iplb)
|
|
+static inline bool iplb_valid(IplParameterBlock *iplb)
|
|
{
|
|
- return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN &&
|
|
- iplb->pbt == S390_IPL_TYPE_CCW;
|
|
-}
|
|
-
|
|
-static inline bool iplb_valid_fcp(IplParameterBlock *iplb)
|
|
-{
|
|
- return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN &&
|
|
- iplb->pbt == S390_IPL_TYPE_FCP;
|
|
+ switch (iplb->pbt) {
|
|
+ case S390_IPL_TYPE_FCP:
|
|
+ return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_FCP_LEN;
|
|
+ case S390_IPL_TYPE_CCW:
|
|
+ return be32_to_cpu(iplb->len) >= S390_IPLB_MIN_CCW_LEN;
|
|
+ default:
|
|
+ return false;
|
|
+ }
|
|
}
|
|
|
|
#endif
|
|
diff --git a/target/s390x/diag.c b/target/s390x/diag.c
|
|
index 53c2f81f2a1aad58d417bc3dc79c..0c81d8e1efbfe37a384199488a72 100644
|
|
--- a/target/s390x/diag.c
|
|
+++ b/target/s390x/diag.c
|
|
@@ -100,7 +100,7 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3, uintptr_t ra)
|
|
|
|
cpu_physical_memory_read(addr, iplb, be32_to_cpu(iplb->len));
|
|
|
|
- if (!iplb_valid_ccw(iplb) && !iplb_valid_fcp(iplb)) {
|
|
+ if (!iplb_valid(iplb)) {
|
|
env->regs[r1 + 1] = DIAG_308_RC_INVALID;
|
|
goto out;
|
|
}
|