On 11/18/20 6:50 PM, Cornelia Huck wrote: > On Tue, 17 Nov 2020 10:42:13 -0500 > Janosch Frank wrote: > >> Availability of SIE is announced via a feature bit in a SCLP info CPU >> entry. Let's add a framework that allows us to easily check for such >> facilities. >> >> Signed-off-by: Janosch Frank >> --- >> lib/s390x/io.c | 1 + >> lib/s390x/sclp.c | 19 +++++++++++++++++++ >> lib/s390x/sclp.h | 15 +++++++++++++++ >> 3 files changed, 35 insertions(+) > > (...) Btw. I also wanted to add this to the struct sclp_facilities: u64 reserved : 63: > >> +void sclp_facilities_setup(void) >> +{ >> + unsigned short cpu0_addr = stap(); >> + CPUEntry *cpu; >> + int i; >> + >> + assert(read_info); >> + >> + cpu = (void *)read_info + read_info->offset_cpu; >> + for (i = 0; i < read_info->entries_cpu; i++, cpu++) { >> + if (cpu->address == cpu0_addr) { >> + sclp_facilities.has_sief2 = test_bit_inv(SCLP_CPU_FEATURE_SIEF2_BIT, (void *)&cpu->address); > > Can you wrap this? This line is really overlong. Sure > > (Also, just to understand: Is sief2 only indicated for cpu0, and not > for the other cpus?) That's an excellent question I don't know the answer to. I had a look at the kernel's implementation of this and that's what they're doing so I figured they had a reason for it. The documentation doesn't seem to say anything about that, but there's a lot of it I haven't yet read. > >> + break; >> + } >> + } >> +} >> + >> /* Perform service call. Return 0 on success, non-zero otherwise. */ >> int sclp_service_call(unsigned int command, void *sccb) >> { >