Re: [kvm-unit-tests PATCH v7 3/4] s390x: lib: add SPX and STPX instruction wrapper

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

 



On 1/10/20 7:40 PM, Claudio Imbrenda wrote:
> Add a wrapper for the SET PREFIX and STORE PREFIX instructions, and
> use it instead of using inline assembly.
> 
> Signed-off-by: Claudio Imbrenda <imbrenda@xxxxxxxxxxxxx>
> Reviewed-by: Thomas Huth <thuth@xxxxxxxxxx>

Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx>

> @@ -63,14 +60,10 @@ static void test_spx(void)
>  	 * some facility bits there ... at least some of them should be
>  	 * set in our buffer afterwards.
>  	 */
> -	asm volatile (
> -		" stpx	%0\n"
> -		" spx	%1\n"
> -		" stfl	0\n"
> -		" spx	%0\n"
> -		: "+Q"(old_prefix)
> -		: "Q"(new_prefix)
> -		: "memory");
> +	old_prefix = get_prefix();
> +	set_prefix(new_prefix);
> +	asm volatile("	stfl 0" : : : "memory");

Couldn't we also use stfl from facility.h here?
And do we need to add a memory clobber to it?

> +	set_prefix(old_prefix);
>  	report(pagebuf[GEN_LC_STFL] != 0, "stfl to new prefix");
>  
>  	expect_pgm_int();
> 


Attachment: signature.asc
Description: OpenPGP digital signature


[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