summaryrefslogtreecommitdiff
path: root/target-s390x
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2015-06-15 17:57:01 +0200
committerAlexander Graf <agraf@suse.de>2015-06-17 12:40:50 +0200
commitd49f4ab48ec76e590ad72a2d6c3fba8459d3ded7 (patch)
tree9a17a675eb0586938bd0becda845639b5cd6a4fb /target-s390x
parentae52e585bf5e9678a77be033fd4b430a2e78dfed (diff)
downloadqemu-d49f4ab48ec76e590ad72a2d6c3fba8459d3ded7.zip
s390/ioinst: fix endianness in ioinst_schib_valid
The ioinst_schib_valid gets a SCHIB in guest endianness, we should byteswap the fields we access. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-s390x')
-rw-r--r--target-s390x/ioinst.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index e220cea8ab..77f2a1fb96 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -129,12 +129,12 @@ void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1)
static int ioinst_schib_valid(SCHIB *schib)
{
- if ((schib->pmcw.flags & PMCW_FLAGS_MASK_INVALID) ||
- (schib->pmcw.chars & PMCW_CHARS_MASK_INVALID)) {
+ if ((be16_to_cpu(schib->pmcw.flags) & PMCW_FLAGS_MASK_INVALID) ||
+ (be32_to_cpu(schib->pmcw.chars) & PMCW_CHARS_MASK_INVALID)) {
return 0;
}
/* Disallow extended measurements for now. */
- if (schib->pmcw.chars & PMCW_CHARS_MASK_XMWME) {
+ if (be32_to_cpu(schib->pmcw.chars) & PMCW_CHARS_MASK_XMWME) {
return 0;
}
return 1;