Re: [kvm-unit-tests PATCH v3 4/5] s390x: STSI tests

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

 



On 8/30/19 2:07 PM, David Hildenbrand wrote:
> On 26.08.19 18:35, Janosch Frank wrote:
>> For now let's concentrate on the error conditions.
>>
>> Signed-off-by: Janosch Frank <frankja@xxxxxxxxxxxxx>
>> ---
[...]
>> +static inline unsigned long stsi_get_fc(void *addr)
>> +{
>> +	register unsigned long r0 asm("0") = 0;
>> +	register unsigned long r1 asm("1") = 0;
>> +	int cc;
>> +
>> +	asm volatile("stsi	0(%3)\n"
>> +		     "ipm	%[cc]\n"
>> +		     "srl	%[cc],28\n"
>> +		     : "+d" (r0), [cc] "=d" (cc)
>> +		     : "d" (r1), "a" (addr)
> 
> maybe [addr], so you can avoid the %3 above

Sure, maybe Thomas can also fix that on picking for the previous patch?

> 
>> +		     : "cc", "memory");
>> +	assert(!cc);
>> +	return r0 >> 28;
> 
> I think I'd prefer "get_configuration_level()" and move it to an header
> - because the fc actually allows more values (0, 15 ...) - however the
> level can be used as an fc.

The rename works for me, but that's currently used only once, so why
should it go to a header file?

I though about starting lib/s390x/asm/misc-instr.h if we have enough (>=
2) instruction definitions which are shared.

> 
> 
>> +}
>> +
>> +static void test_fc(void)
>> +{
>> +	report("invalid fc",  stsi(pagebuf, 7, 0, 0) == 3);
>> +	report("query fc >= 2",  stsi_get_fc(pagebuf) >= 2);
>> +}
>> +
>> +int main(void)
>> +{
>> +	report_prefix_push("stsi");
>> +	test_priv();
>> +	test_specs();
>> +	test_fc();
>> +	return report_summary();
>> +}
>> diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg
>> index 9dd288a..cc79a4e 100644
>> --- a/s390x/unittests.cfg
>> +++ b/s390x/unittests.cfg
>> @@ -68,3 +68,6 @@ file = cpumodel.elf
>>  [diag288]
>>  file = diag288.elf
>>  extra_params=-device diag288,id=watchdog0 --watchdog-action inject-nmi
>> +
>> +[stsi]
>> +file = stsi.elf
>>
> 
> Apart from that
> 
> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>
> 


Attachment: signature.asc
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