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, david@redhat.com,
	borntraeger@de.ibm.com, cohuck@redhat.com,
	imbrenda@linux.ibm.com
Subject: Re: [kvm-unit-tests PATCH 1/3] s390x: Add custom pgm cleanup function
Date: Tue, 21 Jul 2020 09:12:34 +0200	[thread overview]
Message-ID: <c8a26cde-5e1f-5e49-c631-2bed93d911ea@redhat.com> (raw)
In-Reply-To: <20200717145813.62573-2-frankja@linux.ibm.com>

On 17/07/2020 16.58, Janosch Frank wrote:
> Sometimes we need to do cleanup which we don't necessarily want to add
> to interrupt.c, so lets add a way to register a cleanup function.
> 
> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
> ---
>  lib/s390x/asm/interrupt.h | 1 +
>  lib/s390x/interrupt.c     | 9 +++++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/lib/s390x/asm/interrupt.h b/lib/s390x/asm/interrupt.h
> index 4cfade9..b2a7c83 100644
> --- a/lib/s390x/asm/interrupt.h
> +++ b/lib/s390x/asm/interrupt.h
> @@ -15,6 +15,7 @@
>  #define EXT_IRQ_EXTERNAL_CALL	0x1202
>  #define EXT_IRQ_SERVICE_SIG	0x2401
>  
> +void register_pgm_int_func(void (*f)(void));
>  void handle_pgm_int(void);
>  void handle_ext_int(void);
>  void handle_mcck_int(void);
> diff --git a/lib/s390x/interrupt.c b/lib/s390x/interrupt.c
> index 243b9c2..36ba720 100644
> --- a/lib/s390x/interrupt.c
> +++ b/lib/s390x/interrupt.c
> @@ -16,6 +16,7 @@
>  
>  static bool pgm_int_expected;
>  static bool ext_int_expected;
> +static void (*pgm_int_func)(void);
>  static struct lowcore *lc;
>  
>  void expect_pgm_int(void)
> @@ -51,8 +52,16 @@ void check_pgm_int_code(uint16_t code)
>  	       lc->pgm_int_code);
>  }
>  
> +void register_pgm_int_func(void (*f)(void))
> +{
> +	pgm_int_func = f;
> +}
> +
>  static void fixup_pgm_int(void)
>  {
> +	if (pgm_int_func)
> +		return (*pgm_int_func)();
> +
>  	switch (lc->pgm_int_code) {
>  	case PGM_INT_CODE_PRIVILEGED_OPERATION:
>  		/* Normal operation is in supervisor state, so this exception
> 

Reviewed-by: Thomas Huth <thuth@redhat.com>

  parent reply	other threads:[~2020-07-21  7:12 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 14:58 [kvm-unit-tests PATCH 0/3] PV tests part 1 Janosch Frank
2020-07-17 14:58 ` [kvm-unit-tests PATCH 1/3] s390x: Add custom pgm cleanup function Janosch Frank
2020-07-20 10:37   ` Claudio Imbrenda
2020-07-21  7:12   ` Thomas Huth [this message]
2020-07-23 12:01   ` Cornelia Huck
2020-07-23 12:23     ` Janosch Frank
2020-07-23 12:30       ` Cornelia Huck
2020-07-17 14:58 ` [kvm-unit-tests PATCH 2/3] s390x: skrf: Add exception new skey test and add test to unittests.cfg Janosch Frank
2020-07-20 10:42   ` Claudio Imbrenda
2020-07-21  7:28   ` Thomas Huth
2020-07-21  8:52     ` Janosch Frank
2020-07-21 14:28       ` Thomas Huth
2020-07-21 15:03         ` Janosch Frank
2020-07-23 12:10           ` Cornelia Huck
2020-07-23 12:19             ` Janosch Frank
2020-07-17 14:58 ` [kvm-unit-tests PATCH 3/3] s390x: Ultavisor guest API test Janosch Frank
2020-07-20 10:49   ` Claudio Imbrenda
2020-07-20 11:42     ` Janosch Frank
2020-07-20 13:24       ` Claudio Imbrenda
2020-07-20 13:35   ` [kvm-unit-tests PATCH v2] " Janosch Frank
2020-07-21  7:36     ` Thomas Huth
2020-07-21  7:32   ` [kvm-unit-tests PATCH 3/3] " Thomas Huth
2020-07-21 12:55   ` Claudio Imbrenda

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=c8a26cde-5e1f-5e49-c631-2bed93d911ea@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@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 \
    /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.