Re: [RFCv2 07/37] KVM: s390: add new variants of UV CALL

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

 




On 04.02.20 14:27, Thomas Huth wrote:
>> +/*
>> + * Low level uv_call that takes r1 and r2 as parameter and avoids
>> + * stalls for long running busy conditions by doing schedule
>> + */
>> +static inline int uv_call_sched(unsigned long r1, unsigned long r2)
>> +{
>> +	int cc = 3;
>> +
>> +	while (cc > 1) {
>> +		asm volatile(
>> +			"0:	.insn rrf,0xB9A40000,%[r1],%[r2],0,0\n"
>> +			"		ipm	%[cc]\n"
>> +			"		srl	%[cc],28\n"
>> +			: [cc] "=d" (cc)
>> +			: [r1] "a" (r1), [r2] "a" (r2)
> 
> You could use "d" instead of "a" for both, r1 and r2, here.

Indeed. Fixed.

> 
>> +			: "memory", "cc");
>> +		if (need_resched())
>> +			schedule();
>> +	}
> 
> It's a matter of taste, but I'd rather do:
> 
>    int cc;
>    do {
>        ...
>    } while (cc > 1);
> 
> (i.e. no need to pre-initialize cc with 3)

Yes, I like that better.
> 
>> +	return cc;
>> +}
> 
>  Thomas
> 




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux