From: "Christoph Schlameuss" <schlameuss@linux.ibm.com>
To: "Nico Boehr" <nrb@linux.ibm.com>,
"Christoph Schlameuss" <schlameuss@linux.ibm.com>,
<linux-s390@vger.kernel.org>
Cc: "Janosch Frank" <frankja@linux.ibm.com>,
"Claudio Imbrenda" <imbrenda@linux.ibm.com>,
"David Hildenbrand" <david@kernel.org>,
"Thomas Huth" <thuth@redhat.com>, <kvm@vger.kernel.org>,
"Nina Schoetterl-Glausch" <nsg@linux.ibm.com>
Subject: Re: [kvm-unit-tests PATCH v2 4/5] s390x: sclp: Add detection of alternate STFLE facilities
Date: Fri, 17 Apr 2026 17:28:03 +0200 [thread overview]
Message-ID: <DHVJB8HIEM2P.IEP85VEWA4KA@linux.ibm.com> (raw)
In-Reply-To: <DHTP3011DZ4W.3HVEWE0UNIYTY@linux.ibm.com>
On Wed Apr 15, 2026 at 1:34 PM CEST, Nico Boehr wrote:
> On Tue Mar 24, 2026 at 4:28 PM CET, Christoph Schlameuss wrote:
> [...]
>> diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c
>> index d624872cba608fcbbd0c482a25f091fe19475a43..77b2a5ec00d68ec7ee82da295f2f31c539b5c00c 100644
>> --- a/lib/s390x/sclp.c
>> +++ b/lib/s390x/sclp.c
> [...]
>> if (read_info->offset_cpu <= 134)
>> return;
>> sclp_facilities.has_diag318 = read_info->byte_134_diag318;
>> +
>> + if (read_info->offset_cpu <= 139)
>> + return;
>> + sclp_facilities.has_astfleie2 = sclp_feat_check(139, SCLP_FEAT_139_BIT_ASTFLEIE2);
>
> Help me understand which case is the odd one, the diag318 one where we access
> read_info directly or this one where we use sclp_feat_check()?
>
> Or is there a particular reason to do it this way that I didn't see?
Both methods will read from the location read_info is pointing to. Which
actually is pointing to _read_info, which is a 2 page buffer. The actual sclp
info is read into _read_info dependent on facility 140 as either 1 or 2 pages.
So the data will then in either case be there in _read_info, either from the 2
page sclp read or as zeros behind the 1 page sclp read.
As for byte_134_diag318 in struct ReadInfo I dont think there is a golden way.
Without fac140 byte_134_diag318 does not exist but is in the struct. And with
fac140 and using sclp_feat_check we are reaching behind struct ReadInfo into
_read_info.
Both not optimal.
In the end the difference is if we go the extra mile and define all the feature
bits in struct ReadInfo or just use sclp_feat_check to check the bit directly.
Simply because I think clp_facilities_setup looks cleaner that way and it is
easier to add more feature bits.
I agree that we should use the same method for all high feature bits.
So I propose to add another patch here to use sclp_feat_check directly for
diag318 as well. And also remove byte_134_diag318 from struct ReadInfo.
Cheers,
Christoph
next prev parent reply other threads:[~2026-04-17 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 15:28 [kvm-unit-tests PATCH v2 0/5] s390x: Add test for STFLE interpretive execution (format-2) Christoph Schlameuss
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 1/5] s390x: snippets: Add reset_guest() to lib Christoph Schlameuss
2026-04-15 11:00 ` Nico Boehr
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 2/5] s390x: sclp: Remove unnecessary padding from struct sclp_facilities Christoph Schlameuss
2026-03-25 9:20 ` Janosch Frank
2026-04-15 11:10 ` Nico Boehr
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 3/5] s390x: sclp: Rework sclp_facilities_setup() for simpler control flow Christoph Schlameuss
2026-04-15 11:27 ` Nico Boehr
2026-04-17 15:28 ` Christoph Schlameuss
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 4/5] s390x: sclp: Add detection of alternate STFLE facilities Christoph Schlameuss
2026-04-15 11:34 ` Nico Boehr
2026-04-17 15:28 ` Christoph Schlameuss [this message]
2026-03-24 15:28 ` [kvm-unit-tests PATCH v2 5/5] s390x: Add test for STFLE interpretive execution (format-2) Christoph Schlameuss
2026-03-25 10:18 ` Janosch Frank
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=DHVJB8HIEM2P.IEP85VEWA4KA@linux.ibm.com \
--to=schlameuss@linux.ibm.com \
--cc=david@kernel.org \
--cc=frankja@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=nrb@linux.ibm.com \
--cc=nsg@linux.ibm.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox