All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com,
	linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	thuth@redhat.com
Subject: [kvm-unit-tests PATCH v2 1/3] s390x: sclp: Only fetch read info byte 134 if cpu entries are above it
Date: Wed, 19 May 2021 08:26:46 +0000	[thread overview]
Message-ID: <20210519082648.46803-2-frankja@linux.ibm.com> (raw)
In-Reply-To: <20210519082648.46803-1-frankja@linux.ibm.com>

The cpu offset tells us where the cpu entries are in the sclp read
info structure.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
---
 lib/s390x/sclp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c
index 7a9b2c52..f11c2035 100644
--- a/lib/s390x/sclp.c
+++ b/lib/s390x/sclp.c
@@ -138,7 +138,8 @@ void sclp_facilities_setup(void)
 	assert(read_info);
 
 	cpu = sclp_get_cpu_entries();
-	sclp_facilities.has_diag318 = read_info->byte_134_diag318;
+	if (read_info->offset_cpu > 134)
+		sclp_facilities.has_diag318 = read_info->byte_134_diag318;
 	for (i = 0; i < read_info->entries_cpu; i++, cpu++) {
 		/*
 		 * The logic for only reading the facilities from the
-- 
2.30.2


  reply	other threads:[~2021-05-19  8:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  8:26 [kvm-unit-tests PATCH v2 0/3] s390x: cpumodel: Add sclp checks Janosch Frank
2021-05-19  8:26 ` Janosch Frank [this message]
2021-05-19  8:26 ` [kvm-unit-tests PATCH v2 2/3] lib: s390x: sclp: Extend feature probing Janosch Frank
2021-05-19  9:06   ` David Hildenbrand
2021-05-19 10:17   ` Cornelia Huck
2021-05-19 10:43     ` Janosch Frank
2021-05-19  8:26 ` [kvm-unit-tests PATCH v2 3/3] s390x: cpumodel: FMT2 and FMT4 SCLP test Janosch Frank
2021-05-19 10:19   ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210519082648.46803-2-frankja@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.