[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 32/46] s390x/kvm: factor out build_channel_report_mci
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 32/46] s390x/kvm: factor out build_channel_report_mcic() into cpu.h |
Date: |
Thu, 14 Dec 2017 18:09:50 +0100 |
From: David Hildenbrand <address@hidden>
We'll need it later on in two places. Refactor it to just indicate the
validity bits. While at it, introduce a define for the used CR14 bit (we'll
also need later on).
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
target/s390x/cpu.h | 23 +++++++++++++++++++++++
target/s390x/kvm.c | 25 ++-----------------------
2 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 9cfbbbac04..f9d4d62c48 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -351,6 +351,9 @@ extern const struct VMStateDescription vmstate_s390_cpu;
#define CR0_CPU_TIMER_SC 0x0000000000000400ULL
#define CR0_SERVICE_SC 0x0000000000000200ULL
+/* Control register 14 bits */
+#define CR14_CHANNEL_REPORT_SC 0x0000000010000000ULL
+
/* MMU */
#define MMU_PRIMARY_IDX 0
#define MMU_SECONDARY_IDX 1
@@ -674,6 +677,26 @@ struct sysib_322 {
#define MCIC_VB_CT 0x0000000000020000ULL
#define MCIC_VB_CC 0x0000000000010000ULL
+static inline uint64_t s390_build_validity_mcic(void)
+{
+ uint64_t mcic;
+
+ /*
+ * Indicate all validity bits (no damage) only. Other bits have to be
+ * added by the caller. (storage errors, subclasses and subclass modifiers)
+ */
+ mcic = MCIC_VB_WP | MCIC_VB_MS | MCIC_VB_PM | MCIC_VB_IA | MCIC_VB_FP |
+ MCIC_VB_GR | MCIC_VB_CR | MCIC_VB_ST | MCIC_VB_AR | MCIC_VB_PR |
+ MCIC_VB_FC | MCIC_VB_CT | MCIC_VB_CC;
+ if (s390_has_feat(S390_FEAT_VECTOR)) {
+ mcic |= MCIC_VB_VR;
+ }
+ if (s390_has_feat(S390_FEAT_GUARDED_STORAGE)) {
+ mcic |= MCIC_VB_GS;
+ }
+ return mcic;
+}
+
/* cpu.c */
int s390_get_clock(uint8_t *tod_high, uint64_t *tod_low);
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 97c45d5537..9b8b59f2a2 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -1852,33 +1852,12 @@ void kvm_s390_io_interrupt(uint16_t subchannel_id,
kvm_s390_floating_interrupt(&irq);
}
-static uint64_t build_channel_report_mcic(void)
-{
- uint64_t mcic;
-
- /* subclass: indicate channel report pending */
- mcic = MCIC_SC_CP |
- /* subclass modifiers: none */
- /* storage errors: none */
- /* validity bits: no damage */
- MCIC_VB_WP | MCIC_VB_MS | MCIC_VB_PM | MCIC_VB_IA | MCIC_VB_FP |
- MCIC_VB_GR | MCIC_VB_CR | MCIC_VB_ST | MCIC_VB_AR | MCIC_VB_PR |
- MCIC_VB_FC | MCIC_VB_CT | MCIC_VB_CC;
- if (s390_has_feat(S390_FEAT_VECTOR)) {
- mcic |= MCIC_VB_VR;
- }
- if (s390_has_feat(S390_FEAT_GUARDED_STORAGE)) {
- mcic |= MCIC_VB_GS;
- }
- return mcic;
-}
-
void kvm_s390_crw_mchk(void)
{
struct kvm_s390_irq irq = {
.type = KVM_S390_MCHK,
- .u.mchk.cr14 = 1 << 28,
- .u.mchk.mcic = build_channel_report_mcic(),
+ .u.mchk.cr14 = CR14_CHANNEL_REPORT_SC,
+ .u.mchk.mcic = s390_build_validity_mcic() | MCIC_SC_CP,
};
kvm_s390_floating_interrupt(&irq);
}
--
2.13.6
- [qemu-s390x] [PULL 22/46] s390x/pci: factor out endianess conversion, (continued)
- [qemu-s390x] [PULL 22/46] s390x/pci: factor out endianess conversion, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 23/46] s390x/pci: rework PCI STORE, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 24/46] s390x/pci: rework PCI LOAD, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 25/46] s390x/pci: rework PCI STORE BLOCK, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 26/46] s390x/pci: move the memory region read from pcilg, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 27/46] s390x/pci: move the memory region write from pcistg, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 28/46] s390x/pci: search for subregion inside the BARs, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 29/46] s390x/css: unrestrict cssids, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 30/46] s390x: deprecate s390-squash-mcss machine prop, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 31/46] s390x/css: attach css bridge, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 32/46] s390x/kvm: factor out build_channel_report_mcic() into cpu.h,
Cornelia Huck <=
- [qemu-s390x] [PULL 33/46] s390x/tcg: fix and cleanup mcck injection, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 34/46] s390x/tcg: implement SET CLOCK PROGRAMMABLE FIELD, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 35/46] s390x/tcg: indicate value of TODPR in STCKE, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 36/46] s390x/tcg: wire up STORE CHANNEL REPORT WORD, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 37/46] s390x/tcg: ASI/ASGI/ALSI/ALSGI are atomic with Interlocked-acccess facility 1, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 39/46] s390x/tcg: wire up SET ADDRESS LIMIT, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 38/46] s390x/tcg: implement Interlocked-Access Facility 2, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 40/46] s390x/tcg: wire up SET CHANNEL MONITOR, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 41/46] s390x/tcg: Implement STORE CHANNEL PATH STATUS, Cornelia Huck, 2017/12/14
- [qemu-s390x] [PULL 42/46] s390x/tcg: Implement SIGNAL ADAPTER instruction, Cornelia Huck, 2017/12/14