[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[qemu-s390x] [PULL 3/9] s390x/sclp: fix missing be conversion
From: |
Cornelia Huck |
Subject: |
[qemu-s390x] [PULL 3/9] s390x/sclp: fix missing be conversion |
Date: |
Mon, 22 Jan 2018 13:00:39 +0100 |
From: David Hildenbrand <address@hidden>
Linux crashes right now if maxmem > mem is specified on the command line.
On s390x, the guest can hotplug memory itself right now - very weird -
and e.g. Fedora 27 will simply add all memory it can when booting.
So now, we have at least the same behavior on TCG and KVM.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/sclp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 21351ffffc..276972b59f 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -233,7 +233,7 @@ static void assign_storage(SCLPDevice *sclp, SCCB *sccb)
sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
return;
}
- assign_addr = (assign_info->rn - 1) * mhd->rzm;
+ assign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
if ((assign_addr % MEM_SECTION_SIZE == 0) &&
(assign_addr >= mhd->padded_ram_size)) {
@@ -292,7 +292,7 @@ static void unassign_storage(SCLPDevice *sclp, SCCB *sccb)
sccb->h.response_code = cpu_to_be16(SCLP_RC_INVALID_SCLP_COMMAND);
return;
}
- unassign_addr = (assign_info->rn - 1) * mhd->rzm;
+ unassign_addr = (be16_to_cpu(assign_info->rn) - 1) * mhd->rzm;
/* if the addr is a multiple of 256 MB */
if ((unassign_addr % MEM_SECTION_SIZE == 0) &&
--
2.13.6
- [qemu-s390x] [PULL 0/9] s390x update, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 1/9] s390x/sclp: fixup highest CPU address, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 3/9] s390x/sclp: fix missing be conversion,
Cornelia Huck <=
- [qemu-s390x] [PULL 2/9] s390x/tcg: implement TEST PROTECTION, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 5/9] s390x: fix storage attributes migration for non-small guests, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 4/9] hw/s390x: Replace fprintf(stderr, "*\n" with qemu_log_mask(), Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 6/9] s390x/tcg: fixup TEST PROTECTION, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 7/9] linux-headers: update, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 9/9] s390x/kvm: provide stfle.81, Cornelia Huck, 2018/01/22
- [qemu-s390x] [PULL 8/9] s390x/kvm: Handle bpb feature, Cornelia Huck, 2018/01/22
- Re: [qemu-s390x] [PULL 0/9] s390x update, Peter Maydell, 2018/01/24