qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Fabiano Rosas <farosas@linux.ibm.com>
Cc: qemu-devel@nongnu.org, philmd@redhat.com,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Richard Henderson <rth@twiddle.net>,
	Peter Maydell <peter.maydell@linaro.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	James Hogan <jhogan@kernel.org>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Aleksandar Markovic <amarkovic@wavecomp.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	David Hildenbrand <david@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v2 1/3] target/ppc: Add macro definitions for relocated interrupt vectors offsets
Date: Fri, 23 Nov 2018 00:22:38 +1100	[thread overview]
Message-ID: <20181122132238.GL10448@umbus.fritz.box> (raw)
In-Reply-To: <20181121181347.24035-2-farosas@linux.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 2176 bytes --]

On Wed, Nov 21, 2018 at 04:13:45PM -0200, Fabiano Rosas wrote:
> The PowerISA prescribes that depending on the values of MSR_IR,
> MSR_DR, MSR_HV and LPCR_AIL, the interrupt vectors might be relocated
> by specific offsets.
> 
> This patch defines macros for these offsets so that they can be used
> by another part of the code in a future patch.
> 
> Signed-off-by: Fabiano Rosas <farosas@linux.ibm.com>
> ---
>  target/ppc/cpu.h         | 3 +++
>  target/ppc/excp_helper.c | 4 ++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
> index ab68abe8a2..5147db4460 100644
> --- a/target/ppc/cpu.h
> +++ b/target/ppc/cpu.h
> @@ -2390,6 +2390,9 @@ enum {
>      AIL_C000_0000_0000_4000 = 3,
>  };
>  
> +#define AIL_0001_8000_OFFSET 0x18000
> +#define AIL_C000_0000_0000_4000_OFFSET 0xc000000000004000ull

Hrm.  Is there really a point making a #define, if the name spells out
the value?  It's not like you can change the value without having to
change the places that use it that way?


>  /*****************************************************************************/
>  
>  #define is_isa300(ctx) (!!(ctx->insns_flags2 & PPC2_ISA300))
> diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
> index 0ec7ae1ad4..49bdf7dd54 100644
> --- a/target/ppc/excp_helper.c
> +++ b/target/ppc/excp_helper.c
> @@ -687,10 +687,10 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
>          new_msr |= (1 << MSR_IR) | (1 << MSR_DR);
>          switch(ail) {
>          case AIL_0001_8000:
> -            vector |= 0x18000;
> +            vector |= AIL_0001_8000_OFFSET;
>              break;
>          case AIL_C000_0000_0000_4000:
> -            vector |= 0xc000000000004000ull;
> +            vector |= AIL_C000_0000_0000_4000_OFFSET;
>              break;
>          default:
>              cpu_abort(cs, "Invalid AIL combination %d\n", ail);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

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

  reply	other threads:[~2018-11-22 14:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-21 18:13 [Qemu-devel] [RFC PATCH v2 0/3] target/ppc: single step for KVM HV Fabiano Rosas
2018-11-21 18:13 ` [Qemu-devel] [RFC PATCH v2 1/3] target/ppc: Add macro definitions for relocated interrupt vectors offsets Fabiano Rosas
2018-11-22 13:22   ` David Gibson [this message]
2018-11-22 18:10     ` Fabiano Rosas
2018-11-21 18:13 ` [Qemu-devel] [RFC PATCH v2 2/3] kvm-all: Introduce kvm_set_singlestep Fabiano Rosas
2018-11-21 18:40   ` Philippe Mathieu-Daudé
2018-11-23  8:57   ` Cornelia Huck
2018-11-25  7:54   ` David Gibson
2018-11-21 18:13 ` [Qemu-devel] [RFC PATCH v2 3/3] target/ppc: support single stepping with KVM HV Fabiano Rosas
2018-11-26  7:41   ` David Gibson
2018-11-30 20:46     ` Fabiano Rosas
2018-12-02  9:13       ` David Gibson
2018-12-10 12:52         ` Fabiano Rosas
2018-12-11  1:20           ` David Gibson

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=20181122132238.GL10448@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=david@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=farosas@linux.ibm.com \
    --cc=jhogan@kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).