[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/19] s390/sclp: use cpu offset to locate cpu entries
From: |
Cornelia Huck |
Subject: |
[PULL 06/19] s390/sclp: use cpu offset to locate cpu entries |
Date: |
Fri, 2 Oct 2020 14:11:05 +0200 |
From: Collin Walling <walling@linux.ibm.com>
The start of the CPU entry region in the Read SCP Info response data is
denoted by the offset_cpu field. As such, QEMU needs to begin creating
entries at this address.
This is in preparation for when Read SCP Info inevitably introduces new
bytes that push the start of the CPUEntry field further away.
Read CPU Info is unlikely to ever change, so let's not bother
accounting for the offset there.
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <20200915194416.107460-6-walling@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
hw/s390x/sclp.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 0d54075309d5..1df67c99bfb9 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -89,6 +89,8 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
int rnsize, rnmax;
IplParameterBlock *ipib = s390_ipl_get_iplb();
int required_len = SCCB_REQ_LEN(ReadInfo, machine->possible_cpus->len);
+ int offset_cpu = offsetof(ReadInfo, entries);
+ CPUEntry *entries_start = (void *)sccb + offset_cpu;
if (be16_to_cpu(sccb->h.length) < required_len) {
sccb->h.response_code = cpu_to_be16(SCLP_RC_INSUFFICIENT_SCCB_LENGTH);
@@ -96,9 +98,9 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
}
/* CPU information */
- prepare_cpu_entries(machine, read_info->entries, &cpu_count);
+ prepare_cpu_entries(machine, entries_start, &cpu_count);
read_info->entries_cpu = cpu_to_be16(cpu_count);
- read_info->offset_cpu = cpu_to_be16(offsetof(ReadInfo, entries));
+ read_info->offset_cpu = cpu_to_be16(offset_cpu);
read_info->highest_cpu = cpu_to_be16(machine->smp.max_cpus - 1);
read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
--
2.25.4
- [PULL 00/19] s390x changes, Cornelia Huck, 2020/10/02
- [PULL 01/19] hw/s390x/css: Remove double initialization, Cornelia Huck, 2020/10/02
- [PULL 02/19] s390/sclp: get machine once during read scp/cpu info, Cornelia Huck, 2020/10/02
- [PULL 04/19] s390/sclp: read sccb from mem based on provided length, Cornelia Huck, 2020/10/02
- [PULL 07/19] s390/sclp: add extended-length sccb support for kvm guest, Cornelia Huck, 2020/10/02
- [PULL 03/19] s390/sclp: rework sclp boundary checks, Cornelia Huck, 2020/10/02
- [PULL 05/19] s390/sclp: check sccb len before filling in data, Cornelia Huck, 2020/10/02
- [PULL 08/19] s390: guest support for diagnose 0x318, Cornelia Huck, 2020/10/02
- [PULL 06/19] s390/sclp: use cpu offset to locate cpu entries,
Cornelia Huck <=
- [PULL 09/19] s390x/tcg: Implement MONITOR CALL, Cornelia Huck, 2020/10/02
- [PULL 10/19] vfio-ccw: plug memory leak while getting region info, Cornelia Huck, 2020/10/02
- [PULL 13/19] s390x/tcg: Implement SUBTRACT HALFWORD (SGH), Cornelia Huck, 2020/10/02
- [PULL 11/19] s390x/cpumodel: S390_FEAT_MISC_INSTRUCTION_EXT -> S390_FEAT_MISC_INSTRUCTION_EXT2, Cornelia Huck, 2020/10/02
- [PULL 12/19] s390x/tcg: Implement ADD HALFWORD (AGH), Cornelia Huck, 2020/10/02
- [PULL 14/19] s390x/tcg: Implement MULTIPLY (MG, MGRK), Cornelia Huck, 2020/10/02
- [PULL 15/19] s390x/tcg: Implement MULTIPLY HALFWORD (MGH), Cornelia Huck, 2020/10/02
- [PULL 16/19] s390x/tcg: Implement BRANCH INDIRECT ON CONDITION (BIC), Cornelia Huck, 2020/10/02
- [PULL 17/19] s390x/tcg: Implement MULTIPLY SINGLE (MSC, MSGC, MSGRKC, MSRKC), Cornelia Huck, 2020/10/02
- [PULL 18/19] s390x/tcg: We support Miscellaneous-Instruction-Extensions Facility 2, Cornelia Huck, 2020/10/02