qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	qemu-devel@nongnu.org,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-s390x@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 01/30] s390x/tcg: turn INTERRUPT_EXT into a mask
Date: Tue, 10 Oct 2017 16:20:06 +0200	[thread overview]
Message-ID: <20171010162006.4e541412.cohuck@redhat.com> (raw)
In-Reply-To: <cf1fd114-9b28-88b1-baac-669407631846@redhat.com>

On Fri, 6 Oct 2017 09:08:45 +0200
Thomas Huth <thuth@redhat.com> wrote:

> On 28.09.2017 22:36, David Hildenbrand wrote:
> > External interrupts are currently all handled like floating external
> > interrupts, they are queued. Let's prepare for a split of floating
> > and local interrupts by turning INTERRUPT_EXT into a mask.
> > 
> > While we can have various floating external interrupts of one kind, there
> > is usually only one (or a fixed number) of the local external interrupts.
> > 
> > So turn INTERRUPT_EXT into a mask and properly indicate the kind of
> > external interrupt. Floating interrupts will have to moved out of
> > one CPU instance later once we have SMP support.
> > 
> > The only floating external interrupts used right now are SERVICE
> > interrupts, so let's use that name. Following patches will clean up
> > SERVICE interrupt injection.
> > 
> > This get's rid of the ugly special handling for cpu timer and clock
> > comparator interrupts. And we really only store the parameters as
> > defined by the PoP.
> > 
> > Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> > Signed-off-by: David Hildenbrand <david@redhat.com>
> > ---
> >  target/s390x/cpu.h         | 13 ++++++----
> >  target/s390x/excp_helper.c | 63 +++++++++++++++++++++++-----------------------
> >  target/s390x/helper.c      | 12 ++-------
> >  target/s390x/internal.h    |  2 ++
> >  target/s390x/interrupt.c   | 18 ++++++++++++-
> >  5 files changed, 61 insertions(+), 47 deletions(-)  
> [...]
> > diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c
> > index 058e219fe5..b9c30f86d7 100644
> > --- a/target/s390x/interrupt.c
> > +++ b/target/s390x/interrupt.c
> > @@ -71,7 +71,23 @@ void cpu_inject_ext(S390CPU *cpu, uint32_t code, uint32_t param,
> >      env->ext_queue[env->ext_index].param = param;
> >      env->ext_queue[env->ext_index].param64 = param64;
> >  
> > -    env->pending_int |= INTERRUPT_EXT;
> > +    env->pending_int |= INTERRUPT_EXT_SERVICE;
> > +    cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD);
> > +}
> > +
> > +void cpu_inject_clock_comparator(S390CPU *cpu)
> > +{
> > +    CPUS390XState *env = &cpu->env;
> > +
> > +    env->pending_int |= INTERRUPT_EXT_CLOCK_COMPARATOR;
> > +    cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD);
> > +}
> > +
> > +void cpu_inject_cpu_timer(S390CPU *cpu)
> > +{
> > +    CPUS390XState *env = &cpu->env;
> > +
> > +    env->pending_int |= INTERRUPT_EXT_CPU_TIMER;
> >      cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD);
> >  }  
> 
> The last two function look similar enough that you could merge the
> functions, e.g.:
> 
> void cpu_inject_ext_pending_bit(S390CPU *cpu, int bit)
> {
>     CPUS390XState *env = &cpu->env;
> 
>     env->pending_int |= bit;
>     cpu_interrupt(CPU(cpu), CPU_INTERRUPT_HARD);
> }
> 
> ?
> 
> Apart from that, the patch looks fine to me.
> 
>  Thomas

FWIW, I'd prefer to keep these as separate functions.

  reply	other threads:[~2017-10-10 14:20 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-28 20:36 [Qemu-devel] [PATCH v2 00/30] s390x: SMP for TCG David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 01/30] s390x/tcg: turn INTERRUPT_EXT into a mask David Hildenbrand
2017-10-06  7:08   ` Thomas Huth
2017-10-10 14:20     ` Cornelia Huck [this message]
2017-10-10 16:49       ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 02/30] s390x/tcg: cleanup service interrupt injection David Hildenbrand
2017-10-06 13:17   ` Richard Henderson
2017-10-10 14:23   ` Cornelia Huck
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 03/30] s390x/tcg: injection of emergency signals and external calls David Hildenbrand
2017-10-06 13:18   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 04/30] s390x/tcg: rework checking for deliverable interrupts David Hildenbrand
2017-10-06 13:31   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 05/30] s390x/tcg: take care of external interrupt subclasses David Hildenbrand
2017-10-06 13:34   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 06/30] s390x/tcg: STOPPED cpus can never wake up David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 07/30] s390x/tcg: a CPU cannot switch state due to an interrupt David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 08/30] target/s390x: factor out handling of WAIT PSW into s390_handle_wait() David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 09/30] s390x/tcg: handle WAIT PSWs during interrupt injection David Hildenbrand
2017-10-06 13:37   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 10/30] target/s390x: interpret PSW_MASK_WAIT only for TCG David Hildenbrand
2017-10-06 13:37   ` Richard Henderson
2017-10-11  8:05   ` Cornelia Huck
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 11/30] s390x/kvm: pass ipb directly into handle_sigp() David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 12/30] s390x/kvm: generalize SIGP stop and restart interrupt injection David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 13/30] s390x/kvm: factor out storing of CPU status David Hildenbrand
2017-10-06 13:39   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 14/30] s390x/kvm: factor out storing of adtl " David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 15/30] s390x/kvm: drop two debug prints David Hildenbrand
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 16/30] s390x/kvm: factor out SIGP code into sigp.c David Hildenbrand
2017-10-11  8:27   ` Cornelia Huck
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 17/30] MAINTAINERS: use s390 KVM maintainers for target/s390x/sigp.c David Hildenbrand
2017-10-06 13:40   ` Richard Henderson
2017-10-06 14:09     ` Cornelia Huck
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 18/30] s390x/kvm: factor out actual handling of STOP interrupts David Hildenbrand
2017-10-06 13:42   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 19/30] s390x/tcg: implement SIGP SENSE RUNNING STATUS David Hildenbrand
2017-10-06 13:44   ` Richard Henderson
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 20/30] s390x/tcg: implement SIGP SENSE David Hildenbrand
2017-10-06 13:45   ` Richard Henderson
2017-10-11  8:34   ` Cornelia Huck
2017-09-28 20:36 ` [Qemu-devel] [PATCH v2 21/30] s390x/tcg: implement SIGP EXTERNAL CALL David Hildenbrand
2017-10-06 13:46   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 22/30] s390x/tcg: implement SIGP EMERGENCY SIGNAL David Hildenbrand
2017-10-06 13:47   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 23/30] s390x/tcg: implement SIGP CONDITIONAL " David Hildenbrand
2017-10-06 13:49   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 24/30] s390x/tcg: implement STOP and RESET interrupts for TCG David Hildenbrand
2017-10-06 13:59   ` Richard Henderson
2017-10-11  8:45   ` Cornelia Huck
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 25/30] s390x/tcg: flush the tlb on SIGP SET PREFIX David Hildenbrand
2017-10-06 13:59   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 26/30] s390x/tcg: switch to new SIGP handling code David Hildenbrand
2017-10-06 14:02   ` Richard Henderson
2017-10-11  8:50     ` Cornelia Huck
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 27/30] s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu David Hildenbrand
2017-10-06 14:03   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 28/30] s390x/tcg: unlock NMI David Hildenbrand
2017-10-06 14:04   ` Richard Henderson
2017-10-11  9:00   ` Cornelia Huck
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 29/30] s390x/tcg: refactor stfl(e) to use s390_get_feat_block() David Hildenbrand
2017-10-06 14:07   ` Richard Henderson
2017-09-28 20:37 ` [Qemu-devel] [PATCH v2 30/30] target/s390x: special handling when starting a CPU with WAIT PSW David Hildenbrand
2017-10-06 14:10   ` Richard Henderson
2017-10-11 12:07 ` [Qemu-devel] [PATCH v2 00/30] s390x: SMP for TCG Cornelia Huck
2017-10-16  7:14   ` David Hildenbrand

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=20171010162006.4e541412.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --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 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).