From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5AoQ-0004bG-LN for qemu-devel@nongnu.org; Wed, 17 Jun 2015 06:43:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5AoJ-0005V2-OZ for qemu-devel@nongnu.org; Wed, 17 Jun 2015 06:43:18 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52234 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5AoJ-0005UN-Hh for qemu-devel@nongnu.org; Wed, 17 Jun 2015 06:43:11 -0400 From: Alexander Graf Date: Wed, 17 Jun 2015 12:42:45 +0200 Message-Id: <1434537789-63782-3-git-send-email-agraf@suse.de> In-Reply-To: <1434537789-63782-1-git-send-email-agraf@suse.de> References: <1434537789-63782-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PULL 02/26] s390/ioinst: fix endianness in ioinst_schib_valid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Aurelien Jarno The ioinst_schib_valid gets a SCHIB in guest endianness, we should byteswap the fields we access. Signed-off-by: Alexander Graf Signed-off-by: Aurelien Jarno Signed-off-by: Alexander Graf --- target-s390x/ioinst.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c index e220cea..77f2a1f 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; -- 1.7.12.4