Re: [kvm-unit-tests PATCH 3/5] s390x: SCLP feature checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/18/20 6:50 PM, Cornelia Huck wrote:
> On Tue, 17 Nov 2020 10:42:13 -0500
> Janosch Frank <frankja@xxxxxxxxxxxxx> 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 <frankja@xxxxxxxxxxxxx>
>> ---
>>  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)
>>  {
> 

Attachment: OpenPGP_0xE354E6B8E238B9F8.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux