All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Janosch Frank <frankja@linux.ibm.com>
Cc: Thomas Huth <thuth@redhat.com>, Nico Boehr <nrb@linux.ibm.com>,
	kvm@vger.kernel.org, linux-s390@vger.kernel.org,
	david@redhat.com
Subject: Re: [PATCH kvm-unit-tests 1/2] s390x: diag288: Add missing clobber
Date: Fri, 17 Dec 2021 15:23:05 +0100	[thread overview]
Message-ID: <20211217152305.2be9c9cf@p-imbrenda> (raw)
In-Reply-To: <329aced6-df4f-2802-cbc6-99469c5f9462@linux.ibm.com>

On Fri, 17 Dec 2021 15:16:34 +0100
Janosch Frank <frankja@linux.ibm.com> wrote:

> On 12/17/21 14:47, Thomas Huth wrote:
> > On 17/12/2021 11.31, Nico Boehr wrote:  
> >> We clobber r0 and thus should let the compiler know we're doing so.
> >>
> >> Because we change from basic to extended ASM, we need to change the
> >> register names, as %r0 will be interpreted as a token in the assembler
> >> template.
> >>
> >> For consistency, we align with the common style in kvm-unit-tests which
> >> is just 0.
> >>
> >> Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
> >> ---
> >>    s390x/diag288.c | 7 ++++---
> >>    1 file changed, 4 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/s390x/diag288.c b/s390x/diag288.c
> >> index 072c04a5cbd6..da7b06c365bf 100644
> >> --- a/s390x/diag288.c
> >> +++ b/s390x/diag288.c
> >> @@ -94,11 +94,12 @@ static void test_bite(void)
> >>    	/* Arm watchdog */
> >>    	lc->restart_new_psw.mask = extract_psw_mask() & ~PSW_MASK_EXT;
> >>    	diag288(CODE_INIT, 15, ACTION_RESTART);
> >> -	asm volatile("		larl	%r0, 1f\n"
> >> -		     "		stg	%r0, 424\n"
> >> +	asm volatile("		larl	0, 1f\n"
> >> +		     "		stg	0, 424\n"  
> > 
> > Would it work to use %%r0 instead?  
> 
> Yes, but I told him that looks weird, so that one is on me.
> @claudio @thomas What's your preferred way of dealing with this?

I would prefer just 0 since that's what we use everywhere else too,
but I won't oppose %%r0 if there are strong arguments for it (but then
we need to decide a policy and stick to it)

> 
> >   
> >>    		     "0:	nop\n"
> >>    		     "		j	0b\n"
> >> -		     "1:");
> >> +		     "1:"
> >> +		     : : : "0");
> >>    	report_pass("restart");
> >>    }  
> > 
> > Anyway:
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> >   
> 


  reply	other threads:[~2021-12-17 14:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-17 10:31 [PATCH kvm-unit-tests 0/2] s390x: diag288: Improve readability Nico Boehr
2021-12-17 10:31 ` [PATCH kvm-unit-tests 1/2] s390x: diag288: Add missing clobber Nico Boehr
2021-12-17 13:47   ` Thomas Huth
2021-12-17 14:16     ` Janosch Frank
2021-12-17 14:23       ` Claudio Imbrenda [this message]
2021-12-17 14:24       ` Thomas Huth
2021-12-17 10:31 ` [PATCH kvm-unit-tests 2/2] s390x: diag288: Improve readability Nico Boehr
2021-12-17 11:08   ` Heiko Carstens
2021-12-17 14:15     ` Janosch Frank

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=20211217152305.2be9c9cf@p-imbrenda \
    --to=imbrenda@linux.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=thuth@redhat.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.