All of lore.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: Pierre Morel <pmorel@linux.ibm.com>, kvm@vger.kernel.org
Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.com,
	cohuck@redhat.com
Subject: Re: [kvm-unit-tests PATCH v4 1/9] s390x: saving regs for interrupts
Date: Thu, 12 Dec 2019 10:24:50 +0100	[thread overview]
Message-ID: <19f572f1-5855-154a-af2b-1273d485be51@linux.ibm.com> (raw)
In-Reply-To: <1576079170-7244-2-git-send-email-pmorel@linux.ibm.com>


[-- Attachment #1.1: Type: text/plain, Size: 1985 bytes --]

On 12/11/19 4:46 PM, Pierre Morel wrote:
> If we use multiple source of interrupts, for exemple, using SCLP

s/exemple/example/

> console to print information while using I/O interrupts, we need
> to have a re-entrant register saving interruption handling.
> 
> Instead of saving at a static memory address, let's save the base
> registers and the floating point registers on the stack.
> 
> Note that we keep the static register saving to recover from the
> RESET tests.
> 
> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
> ---
>  s390x/cstart64.S | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/s390x/cstart64.S b/s390x/cstart64.S
> index 86dd4c4..ff05f9b 100644
> --- a/s390x/cstart64.S
> +++ b/s390x/cstart64.S
> @@ -118,6 +118,25 @@ memsetxc:
>  	lmg	%r0, %r15, GEN_LC_SW_INT_GRS
>  	.endm
> > +	.macro SAVE_IRQ_REGS

Maybe add comments to the start of the macros like:
"Save registers on the stack, so we can have stacked interrupts."

> +	slgfi   %r15, 15 * 8
> +	stmg    %r0, %r14, 0(%r15)
> +	slgfi   %r15, 16 * 8
> +	.irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
> +	std	\i, \i * 8(%r15)
> +	.endr
> +	lgr     %r2, %r15

What's that doing?

> +	.endm
> +
> +	.macro RESTORE_IRQ_REGS
> +	.irp i, 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
> +	ld	\i, \i * 8(%r15)
> +	.endr
> +	algfi   %r15, 16 * 8
> +	lmg     %r0, %r14, 0(%r15)
> +	algfi   %r15, 15 * 8
> +	.endm
> +
>  .section .text
>  /*
>   * load_reset calling convention:
> @@ -154,6 +173,8 @@ diag308_load_reset:
>  	lpswe	GEN_LC_SW_INT_PSW
>  1:	br	%r14
>  
> +
> +

Still not fixed

>  .globl smp_cpu_setup_state
>  smp_cpu_setup_state:
>  	xgr	%r1, %r1
> @@ -180,9 +201,9 @@ mcck_int:
>  	lpswe	GEN_LC_MCCK_OLD_PSW
>  
>  io_int:
> -	SAVE_REGS
> +	SAVE_IRQ_REGS
>  	brasl	%r14, handle_io_int
> -	RESTORE_REGS
> +	RESTORE_IRQ_REGS
>  	lpswe	GEN_LC_IO_OLD_PSW
>  
>  svc_int:
> 



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-12-12  9:24 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 15:46 [kvm-unit-tests PATCH v4 0/9] s390x: Testing the Channel Subsystem I/O Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 1/9] s390x: saving regs for interrupts Pierre Morel
2019-12-12  9:24   ` Janosch Frank [this message]
2019-12-12 13:32     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 2/9] s390x: Use PSW bits definitions in cstart Pierre Morel
2019-12-12  9:31   ` Janosch Frank
2019-12-12 13:34     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 3/9] s390x: interrupt registration Pierre Morel
2019-12-12  9:39   ` Janosch Frank
2019-12-12 13:35     ` Pierre Morel
2019-12-12  9:41   ` Janosch Frank
2019-12-12 13:35     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 4/9] s390x: export the clock get_clock_ms() utility Pierre Morel
2019-12-12  9:40   ` Janosch Frank
2019-12-12 13:36     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 5/9] s390x: Library resources for CSS tests Pierre Morel
2019-12-12  9:51   ` Janosch Frank
2019-12-12 13:43     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 6/9] s390x: css: stsch, enumeration test Pierre Morel
2019-12-12 10:18   ` Cornelia Huck
2019-12-12 13:50     ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 7/9] s390x: css: msch, enable test Pierre Morel
2019-12-12 12:01   ` Cornelia Huck
2019-12-12 14:01     ` Pierre Morel
2019-12-12 14:10       ` Cornelia Huck
2019-12-12 14:21         ` Pierre Morel
2019-12-12 14:33           ` Cornelia Huck
2019-12-12 16:05             ` Pierre Morel
2019-12-12 17:33               ` Pierre Morel
2019-12-13  9:33                 ` Cornelia Huck
2019-12-13 14:40                   ` Pierre Morel
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 8/9] s390x: css: ssch/tsch with sense and interrupt Pierre Morel
2019-12-12 12:26   ` Cornelia Huck
2019-12-12 14:10     ` Pierre Morel
2019-12-12 18:20       ` Pierre Morel
2019-12-13  9:43         ` Cornelia Huck
2019-12-13 15:24           ` Pierre Morel
2019-12-13 15:53             ` Cornelia Huck
2019-12-11 15:46 ` [kvm-unit-tests PATCH v4 9/9] s390x: css: ping pong Pierre Morel
2019-12-13  9:50   ` Cornelia Huck
2019-12-13 16:50     ` Pierre Morel
2019-12-16 10:54       ` Cornelia Huck

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=19f572f1-5855-154a-af2b-1273d485be51@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pmorel@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.