All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Janosch Frank <frankja@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	pmorel@linux.ibm.com, david@redhat.com
Subject: Re: [kvm-unit-tests PATCH v2 3/8] RFC: s390x: Define STACK_FRAME_INT_SIZE macro
Date: Wed, 17 Feb 2021 17:10:43 +0100	[thread overview]
Message-ID: <c26cef2f-4081-a04f-222f-e2fef638de25@redhat.com> (raw)
In-Reply-To: <834f2e69-e08b-de15-fb9f-bed73fd2cc04@linux.ibm.com>

On 17/02/2021 17.08, Janosch Frank wrote:
> On 2/17/21 4:38 PM, Thomas Huth wrote:
>> On 17/02/2021 15.41, Janosch Frank wrote:
>>> Using sizeof is safer than using magic constants. However, it doesn't
>>> really fit into asm-offsets.h as it's not an offset so I'm happy to
>>> receive suggestions on where to put it.
>>>
>>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>>> ---
>>>    lib/s390x/asm-offsets.c | 1 +
>>>    s390x/macros.S          | 4 ++--
>>>    2 files changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/lib/s390x/asm-offsets.c b/lib/s390x/asm-offsets.c
>>> index 96cb21cf..2658b59a 100644
>>> --- a/lib/s390x/asm-offsets.c
>>> +++ b/lib/s390x/asm-offsets.c
>>> @@ -86,6 +86,7 @@ int main(void)
>>>    	OFFSET(STACK_FRAME_INT_CRS, stack_frame_int, crs);
>>>    	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));
>>>    
>>>    	return 0;
>>>    }
>>> diff --git a/s390x/macros.S b/s390x/macros.S
>>> index d7eeeb55..a7d62c6f 100644
>>> --- a/s390x/macros.S
>>> +++ b/s390x/macros.S
>>> @@ -43,14 +43,14 @@
>>>    /* Save registers on the stack (r15), so we can have stacked interrupts. */
>>>    	.macro SAVE_REGS_STACK
>>>    	/* Allocate a full stack frame */
>>> -	slgfi   %r15, 32 * 8 + 4 * 8
>>> +	slgfi   %r15, STACK_FRAME_INT_SIZE
>>>    	/* Store registers r0 to r14 on the stack */
>>>    	stmg    %r2, %r15, STACK_FRAME_INT_GRS0(%r15)
>>>    	stg     %r0, STACK_FRAME_INT_GRS1(%r15)
>>>    	stg     %r1, STACK_FRAME_INT_GRS1 + 8(%r15)
>>>    	/* Store the gr15 value before we allocated the new stack */
>>>    	lgr     %r0, %r15
>>> -	algfi   %r0, 32 * 8 + 4 * 8
>>> +	algfi   %r0, STACK_FRAME_INT_SIZE
>>
>> Ah, well, that of course fixes the problem that I had with the previous
>> patch. I'd suggest to merge it into patch 2.
> 
> That was the plan anyway, I had so much pain until I yanked out the int
> offsets in favor of the macros. :)
> 
> Did you have time to read the commit message?
> I'm not completely convinced that asm-offset.c is the right place for
> the DEFINE() so I kept this patch as a discussion starter.

Yes, I read the commit message, and I'm fine with the DEFINE in that file. 
But if you feel uncomfortable, maybe add a comment in front of that line?

  Thomas


  reply	other threads:[~2021-02-17 16:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-17 14:41 [kvm-unit-tests PATCH v2 0/8] s390x: Cleanup exception register save/restore and implement backtrace Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 1/8] s390x: Fix fpc store address in RESTORE_REGS_STACK Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 2/8] s390x: Fully commit to stack save area for exceptions Janosch Frank
2021-02-17 15:35   ` Thomas Huth
2021-02-17 16:54     ` Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 3/8] RFC: s390x: Define STACK_FRAME_INT_SIZE macro Janosch Frank
2021-02-17 15:38   ` Thomas Huth
2021-02-17 16:08     ` Janosch Frank
2021-02-17 16:10       ` Thomas Huth [this message]
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 4/8] s390x: Introduce and use CALL_INT_HANDLER macro Janosch Frank
2021-02-17 15:49   ` Thomas Huth
2021-02-17 15:55   ` Thomas Huth
2021-02-17 16:22     ` Janosch Frank
2021-02-17 17:03       ` Thomas Huth
2021-02-18  9:16         ` Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 5/8] s390x: Provide preliminary backtrace support Janosch Frank
2021-02-17 16:01   ` Thomas Huth
2021-02-17 16:12     ` Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 6/8] s390x: Print more information on program exceptions Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 7/8] s390x: Move diag308_load_reset to stack saving Janosch Frank
2021-02-17 14:41 ` [kvm-unit-tests PATCH v2 8/8] s390x: Remove SAVE/RESTORE_stack Janosch Frank
2021-02-17 16:18   ` Thomas Huth
2021-02-17 16:46     ` Janosch Frank
2021-02-17 16:50       ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c26cef2f-4081-a04f-222f-e2fef638de25@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pmorel@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.