* [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore
@ 2021-06-02 9:43 Janosch Frank
2021-06-02 9:47 ` David Hildenbrand
2021-06-02 10:55 ` Cornelia Huck
0 siblings, 2 replies; 4+ messages in thread
From: Janosch Frank @ 2021-06-02 9:43 UTC (permalink / raw)
To: kvm; +Cc: linux-s390, imbrenda, david, thuth, cohuck
The lmg overwrites r3 which we later use to reference the fprs and fpc.
Let's do the lmg at the end where overwriting is fine.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
---
Finding this took me longer than I'd like to admit. :)
---
s390x/cpu.S | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/s390x/cpu.S b/s390x/cpu.S
index e2ad56c8..82b5e25d 100644
--- a/s390x/cpu.S
+++ b/s390x/cpu.S
@@ -81,11 +81,11 @@ sie64a:
stg %r3,__SF_SIE_SAVEAREA(%r15) # save guest register save area
# Load guest's gprs, fprs and fpc
- lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
.irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
ld \i, \i * 8 + SIE_SAVEAREA_GUEST_FPRS(%r3)
.endr
lfpc SIE_SAVEAREA_GUEST_FPC(%r3)
+ lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
# Move scb ptr into r14 for the sie instruction
lg %r14,__SF_SIE_CONTROL(%r15)
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore
2021-06-02 9:43 [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore Janosch Frank
@ 2021-06-02 9:47 ` David Hildenbrand
2021-06-02 10:54 ` Claudio Imbrenda
2021-06-02 10:55 ` Cornelia Huck
1 sibling, 1 reply; 4+ messages in thread
From: David Hildenbrand @ 2021-06-02 9:47 UTC (permalink / raw)
To: Janosch Frank, kvm; +Cc: linux-s390, imbrenda, thuth, cohuck
On 02.06.21 11:43, Janosch Frank wrote:
> The lmg overwrites r3 which we later use to reference the fprs and fpc.
> Let's do the lmg at the end where overwriting is fine.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>
> Finding this took me longer than I'd like to admit. :)
>
> ---
> s390x/cpu.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/s390x/cpu.S b/s390x/cpu.S
> index e2ad56c8..82b5e25d 100644
> --- a/s390x/cpu.S
> +++ b/s390x/cpu.S
> @@ -81,11 +81,11 @@ sie64a:
> stg %r3,__SF_SIE_SAVEAREA(%r15) # save guest register save area
>
> # Load guest's gprs, fprs and fpc
> - lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
> .irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
> ld \i, \i * 8 + SIE_SAVEAREA_GUEST_FPRS(%r3)
> .endr
> lfpc SIE_SAVEAREA_GUEST_FPC(%r3)
> + lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
>
> # Move scb ptr into r14 for the sie instruction
> lg %r14,__SF_SIE_CONTROL(%r15)
>
Oh, that's nasty
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore
2021-06-02 9:47 ` David Hildenbrand
@ 2021-06-02 10:54 ` Claudio Imbrenda
0 siblings, 0 replies; 4+ messages in thread
From: Claudio Imbrenda @ 2021-06-02 10:54 UTC (permalink / raw)
To: David Hildenbrand; +Cc: Janosch Frank, kvm, linux-s390, thuth, cohuck
On Wed, 2 Jun 2021 11:47:12 +0200
David Hildenbrand <david@redhat.com> wrote:
> On 02.06.21 11:43, Janosch Frank wrote:
> > The lmg overwrites r3 which we later use to reference the fprs and
> > fpc. Let's do the lmg at the end where overwriting is fine.
> >
> > Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> > ---
> >
> > Finding this took me longer than I'd like to admit. :)
> >
> > ---
> > s390x/cpu.S | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/s390x/cpu.S b/s390x/cpu.S
> > index e2ad56c8..82b5e25d 100644
> > --- a/s390x/cpu.S
> > +++ b/s390x/cpu.S
> > @@ -81,11 +81,11 @@ sie64a:
> > stg %r3,__SF_SIE_SAVEAREA(%r15) # save
> > guest register save area
> > # Load guest's gprs, fprs and fpc
> > - lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
> > .irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
> > ld \i, \i * 8 + SIE_SAVEAREA_GUEST_FPRS(%r3)
> > .endr
> > lfpc SIE_SAVEAREA_GUEST_FPC(%r3)
> > + lmg %r0,%r13,SIE_SAVEAREA_GUEST_GRS(%r3)
> >
> > # Move scb ptr into r14 for the sie instruction
> > lg %r14,__SF_SIE_CONTROL(%r15)
> >
>
> Oh, that's nasty
>
> Reviewed-by: David Hildenbrand <david@redhat.com>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore
2021-06-02 9:43 [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore Janosch Frank
2021-06-02 9:47 ` David Hildenbrand
@ 2021-06-02 10:55 ` Cornelia Huck
1 sibling, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2021-06-02 10:55 UTC (permalink / raw)
To: Janosch Frank, kvm; +Cc: linux-s390, imbrenda, david, thuth
On Wed, Jun 02 2021, Janosch Frank <frankja@linux.ibm.com> wrote:
> The lmg overwrites r3 which we later use to reference the fprs and fpc.
> Let's do the lmg at the end where overwriting is fine.
>
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>
> Finding this took me longer than I'd like to admit. :)
>
> ---
> s390x/cpu.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-06-02 10:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02 9:43 [kvm-unit-tests PATCH] s390x: sie: Only overwrite r3 if it isn't needed anymore Janosch Frank
2021-06-02 9:47 ` David Hildenbrand
2021-06-02 10:54 ` Claudio Imbrenda
2021-06-02 10:55 ` Cornelia Huck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).