diff mbox series

[kvm-unit-tests,v2,7/7] s390x: smp: Dirty fpc before initial reset test

Message ID 20200116120513.2244-8-frankja@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series s390x: smp: Improve smp code and reset checks | expand

Commit Message

Janosch Frank Jan. 16, 2020, 12:05 p.m. UTC
Let's dirty the fpc, before we test if the initial reset sets it to 0.

Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
---
 s390x/smp.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

David Hildenbrand Jan. 17, 2020, 10:20 a.m. UTC | #1
On 16.01.20 13:05, Janosch Frank wrote:
> Let's dirty the fpc, before we test if the initial reset sets it to 0.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  s390x/smp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/s390x/smp.c b/s390x/smp.c
> index ce3215d..97a9dda 100644
> --- a/s390x/smp.c
> +++ b/s390x/smp.c
> @@ -179,6 +179,9 @@ static void test_emcall(void)
>  /* Used to dirty registers of cpu #1 before it is reset */
>  static void test_func_initial(void)
>  {
> +	asm volatile(
> +		"	sfpc	%0\n"
> +		: : "d" (0x11) : );

FWIW, I'd make this one easier to read

asm volatile("sfpc %0\n" :: "d" (0x11));

or sth like that

Reviewed-by: David Hildenbrand <david@redhat.com>

>  	lctlg(1, 0x42000UL);
>  	lctlg(7, 0x43000UL);
>  	lctlg(13, 0x44000UL);
>
Thomas Huth Jan. 17, 2020, 10:29 a.m. UTC | #2
On 17/01/2020 11.20, David Hildenbrand wrote:
> On 16.01.20 13:05, Janosch Frank wrote:
>> Let's dirty the fpc, before we test if the initial reset sets it to 0.
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>>  s390x/smp.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/s390x/smp.c b/s390x/smp.c
>> index ce3215d..97a9dda 100644
>> --- a/s390x/smp.c
>> +++ b/s390x/smp.c
>> @@ -179,6 +179,9 @@ static void test_emcall(void)
>>  /* Used to dirty registers of cpu #1 before it is reset */
>>  static void test_func_initial(void)
>>  {
>> +	asm volatile(
>> +		"	sfpc	%0\n"
>> +		: : "d" (0x11) : );
> 
> FWIW, I'd make this one easier to read
> 
> asm volatile("sfpc %0\n" :: "d" (0x11));

By the way, since it's only one line, you can also drop the \n here.

 Thomas
Janosch Frank Jan. 17, 2020, 10:41 a.m. UTC | #3
On 1/17/20 11:29 AM, Thomas Huth wrote:
> On 17/01/2020 11.20, David Hildenbrand wrote:
>> On 16.01.20 13:05, Janosch Frank wrote:
>>> Let's dirty the fpc, before we test if the initial reset sets it to 0.
>>>
>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>>> Reviewed-by: Cornelia Huck <cohuck@redhat.com>
>>> ---
>>>  s390x/smp.c | 3 +++
>>>  1 file changed, 3 insertions(+)
>>>
>>> diff --git a/s390x/smp.c b/s390x/smp.c
>>> index ce3215d..97a9dda 100644
>>> --- a/s390x/smp.c
>>> +++ b/s390x/smp.c
>>> @@ -179,6 +179,9 @@ static void test_emcall(void)
>>>  /* Used to dirty registers of cpu #1 before it is reset */
>>>  static void test_func_initial(void)
>>>  {
>>> +	asm volatile(
>>> +		"	sfpc	%0\n"
>>> +		: : "d" (0x11) : );
>>
>> FWIW, I'd make this one easier to read
>>
>> asm volatile("sfpc %0\n" :: "d" (0x11));
> 
> By the way, since it's only one line, you can also drop the \n here.
> 
>  Thomas
> 

Both suggestions applied :)
Thanks!
diff mbox series

Patch

diff --git a/s390x/smp.c b/s390x/smp.c
index ce3215d..97a9dda 100644
--- a/s390x/smp.c
+++ b/s390x/smp.c
@@ -179,6 +179,9 @@  static void test_emcall(void)
 /* Used to dirty registers of cpu #1 before it is reset */
 static void test_func_initial(void)
 {
+	asm volatile(
+		"	sfpc	%0\n"
+		: : "d" (0x11) : );
 	lctlg(1, 0x42000UL);
 	lctlg(7, 0x43000UL);
 	lctlg(13, 0x44000UL);