diff mbox series

[kvm-unit-tests,6/9] s390x: define a macro for the stack frame size

Message ID 20230116175757.71059-7-mhartmay@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series Some cleanup patches | expand

Commit Message

Marc Hartmayer Jan. 16, 2023, 5:57 p.m. UTC
Define and use a macro for the stack frame size.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
---
 lib/s390x/asm-offsets.c | 1 +
 s390x/cstart64.S        | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Janosch Frank Jan. 18, 2023, 8:27 a.m. UTC | #1
On 1/16/23 18:57, Marc Hartmayer wrote:
> Define and use a macro for the stack frame size.

There are two more instances in s390x/macros.S and there might be some 
in s390x/gs.c.

> 
> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
> ---
>   lib/s390x/asm-offsets.c | 1 +
>   s390x/cstart64.S        | 2 +-
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c
> index f612f3277a95..188dd2e51181 100644
> --- a/lib/s390x/asm-offsets.c
> +++ b/lib/s390x/asm-offsets.c
> @@ -87,6 +87,7 @@ int main(void)
>   	OFFSET(STACK_FRAME_INT_GRS0, stack_frame_int, grs0);
>   	OFFSET(STACK_FRAME_INT_GRS1, stack_frame_int, grs1);
>   	DEFINE(STACK_FRAME_INT_SIZE, sizeof(struct stack_frame_int));
> +	DEFINE(STACK_FRAME_SIZE, sizeof(struct stack_frame));

I'm wondering why we didn't do this when Pierre introduced the int stacks...

>   
>   	return 0;
>   }
> diff --git a/s390x/cstart64.S b/s390x/cstart64.S
> index 6f83da2a6c0a..468ace3ea4df 100644
> --- a/s390x/cstart64.S
> +++ b/s390x/cstart64.S
> @@ -38,7 +38,7 @@ start:
>   	/* setup stack */
>   	larl	%r15, stackptr
>   	/* Clear first stack frame */
> -	xc      0(160,%r15), 0(%r15)
> +	xc      0(STACK_FRAME_SIZE,%r15), 0(%r15)
>   	/* setup initial PSW mask + control registers*/
>   	larl	%r1, initial_psw
>   	lpswe	0(%r1)
Marc Hartmayer Jan. 18, 2023, 9:04 a.m. UTC | #2
Janosch Frank <frankja@linux.ibm.com> writes:

> On 1/16/23 18:57, Marc Hartmayer wrote:
>> Define and use a macro for the stack frame size.
>
> There are two more instances in s390x/macros.S and there might be some 
> in s390x/gs.c.

Thanks, will change them.

>
>> 
>> Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
>> ---
>>   lib/s390x/asm-offsets.c | 1 +
>>   s390x/cstart64.S        | 2 +-
>>   2 files changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c
>> index f612f3277a95..188dd2e51181 100644
>> --- a/lib/s390x/asm-offsets.c
>> +++ b/lib/s390x/asm-offsets.c
>> @@ -87,6 +87,7 @@ int main(void)
>>   	OFFSET(STACK_FRAME_INT_GRS0, stack_frame_int, grs0);
>>   	OFFSET(STACK_FRAME_INT_GRS1, stack_frame_int, grs1);
>>   	DEFINE(STACK_FRAME_INT_SIZE, sizeof(struct stack_frame_int));
>> +	DEFINE(STACK_FRAME_SIZE, sizeof(struct stack_frame));
>
> I'm wondering why we didn't do this when Pierre introduced the int stacks...
>
>>   
>>   	return 0;
>>   }
>> diff --git a/s390x/cstart64.S b/s390x/cstart64.S
>> index 6f83da2a6c0a..468ace3ea4df 100644
>> --- a/s390x/cstart64.S
>> +++ b/s390x/cstart64.S
>> @@ -38,7 +38,7 @@ start:
>>   	/* setup stack */
>>   	larl	%r15, stackptr
>>   	/* Clear first stack frame */
>> -	xc      0(160,%r15), 0(%r15)
>> +	xc      0(STACK_FRAME_SIZE,%r15), 0(%r15)
>>   	/* setup initial PSW mask + control registers*/
>>   	larl	%r1, initial_psw
>>   	lpswe	0(%r1)
>
diff mbox series

Patch

diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c
index f612f3277a95..188dd2e51181 100644
--- a/lib/s390x/asm-offsets.c
+++ b/lib/s390x/asm-offsets.c
@@ -87,6 +87,7 @@  int main(void)
 	OFFSET(STACK_FRAME_INT_GRS0, stack_frame_int, grs0);
 	OFFSET(STACK_FRAME_INT_GRS1, stack_frame_int, grs1);
 	DEFINE(STACK_FRAME_INT_SIZE, sizeof(struct stack_frame_int));
+	DEFINE(STACK_FRAME_SIZE, sizeof(struct stack_frame));
 
 	return 0;
 }
diff --git a/s390x/cstart64.S b/s390x/cstart64.S
index 6f83da2a6c0a..468ace3ea4df 100644
--- a/s390x/cstart64.S
+++ b/s390x/cstart64.S
@@ -38,7 +38,7 @@  start:
 	/* setup stack */
 	larl	%r15, stackptr
 	/* Clear first stack frame */
-	xc      0(160,%r15), 0(%r15)
+	xc      0(STACK_FRAME_SIZE,%r15), 0(%r15)
 	/* setup initial PSW mask + control registers*/
 	larl	%r1, initial_psw
 	lpswe	0(%r1)