[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/10] s390/ioinst: fix endianness in ioinst_schib_v
From: |
Aurelien Jarno |
Subject: |
[Qemu-devel] [PATCH 02/10] s390/ioinst: fix endianness in ioinst_schib_valid |
Date: |
Mon, 15 Jun 2015 17:57:01 +0200 |
From: Alexander Graf <address@hidden>
The ioinst_schib_valid gets a SCHIB in guest endianness, we should
byteswap the fields we access.
Cc: Christian Borntraeger <address@hidden>
Cc: Cornelia Huck <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
Signed-off-by: Aurelien Jarno <address@hidden>
---
target-s390x/ioinst.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Note that it creates some asymmetry with the ioinst_orb_valid function.
We might want to move the copy_schib_from_guest from hw/s390x/css.c to
target-s390x/ioinst.c and do the byteswapping only once.
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;
--
2.1.4
- [Qemu-devel] [PATCH 00/10] target-s390x: add support for CCW in TCG mode, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 02/10] s390/ioinst: fix endianness in ioinst_schib_valid,
Aurelien Jarno <=
- [Qemu-devel] [PATCH 07/10] target-s390x: fix s390_cpu_initial_reset, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 06/10] target-s390x: initialize I/O interrupt queue, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 05/10] target-s390x: correctly initialize ext interrupt queue, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 01/10] s390/ioinst: fix IO_INT_WORD_ISC macro, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 08/10] target-s390x: wire up DIAG IPL in TCG mode, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 03/10] virtio-ccw: disable ioevent bit when ioeventfds are not enabled, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 10/10] target-s390x: wire up I/O instructions in TCG mode, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 04/10] target-s390x: fix setcc in TCG mode, Aurelien Jarno, 2015/06/15
- [Qemu-devel] [PATCH 09/10] target-s390x: wire up DIAG REIPL in TCG mode, Aurelien Jarno, 2015/06/15