aboutsummaryrefslogtreecommitdiff
path: root/target/s390x/cpu.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2018-01-29 13:56:18 +0100
committerCornelia Huck <cohuck@redhat.com>2018-02-09 09:37:13 +0100
commit799478621e28f6d3717a405821bc3c39435794f6 (patch)
tree5231836c35861f581cfe47aba676932d4d98d4ec /target/s390x/cpu.h
parent4d1369efaad3b5297f164d787bda3dd24723c1e2 (diff)
s390x/tcg: STSI overhaul
Current STSI implementation is a mess, so let's rewrite it. Problems fixed by this patch: 1) The order of exceptions/when recognized is wrong. 2) We have to store to virtual address space, not absolute. 3) Alignment check of the block is missing. 3) The SMP information is not indicated. While at it: a) Make the code look nicer - get rid of nesting levels - use struct initialization instead of initializing to zero - rename a misspelled field and rename function code defines - use a union and have only one write statement - use cpu_to_beX() b) Indicate the VM name/extended name + UUID just like KVM does c) Indicate that all LPAR CPUs we fake are dedicated d) Add a comment why we fake being a KVM guest e) Give our guest as default the name "TCGguest" f) Fake the same CPU information we have in our Guest for all layers While at it, get rid of "potential_page_fault()" by forwarding the retaddr properly. The result is best verified by looking at "/proc/sysinfo" in the guest when specifying on the qemu command line -uuid "74738ff5-5367-5958-9aee-98fffdcd1876" \ -name "extra long guest name" Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180129125623.21729-14-david@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/cpu.h')
-rw-r--r--target/s390x/cpu.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 1475d705a4..21ce40d5b6 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -426,11 +426,11 @@ static inline void setcc(S390CPU *cpu, uint64_t cc)
}
/* STSI */
-#define STSI_LEVEL_MASK 0x00000000f0000000ULL
-#define STSI_LEVEL_CURRENT 0x0000000000000000ULL
-#define STSI_LEVEL_1 0x0000000010000000ULL
-#define STSI_LEVEL_2 0x0000000020000000ULL
-#define STSI_LEVEL_3 0x0000000030000000ULL
+#define STSI_R0_FC_MASK 0x00000000f0000000ULL
+#define STSI_R0_FC_CURRENT 0x0000000000000000ULL
+#define STSI_R0_FC_LEVEL_1 0x0000000010000000ULL
+#define STSI_R0_FC_LEVEL_2 0x0000000020000000ULL
+#define STSI_R0_FC_LEVEL_3 0x0000000030000000ULL
#define STSI_R0_RESERVED_MASK 0x000000000fffff00ULL
#define STSI_R0_SEL1_MASK 0x00000000000000ffULL
#define STSI_R1_RESERVED_MASK 0x00000000ffff0000ULL
@@ -465,7 +465,7 @@ typedef struct SysIB_122 {
uint8_t res1[32];
uint32_t capability;
uint16_t total_cpus;
- uint16_t active_cpus;
+ uint16_t conf_cpus;
uint16_t standby_cpus;
uint16_t reserved_cpus;
uint16_t adjustments[2026];
@@ -525,6 +525,16 @@ typedef struct SysIB_322 {
} SysIB_322;
QEMU_BUILD_BUG_ON(sizeof(SysIB_322) != 4096);
+typedef union SysIB {
+ SysIB_111 sysib_111;
+ SysIB_121 sysib_121;
+ SysIB_122 sysib_122;
+ SysIB_221 sysib_221;
+ SysIB_222 sysib_222;
+ SysIB_322 sysib_322;
+} SysIB;
+QEMU_BUILD_BUG_ON(sizeof(SysIB) != 4096);
+
/* MMU defines */
#define _ASCE_ORIGIN ~0xfffULL /* segment table origin */
#define _ASCE_SUBSPACE 0x200 /* subspace group control */