qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Crosthwaite <crosthwaitepeter@gmail.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, rth@twiddle.net,
	edgar.iglesias@gmail.com, afaerber@suse.de,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v3 31/35] microblaze: enable multi-arch
Date: Sat, 18 Jul 2015 14:35:26 +0200	[thread overview]
Message-ID: <55AA480E.8070502@redhat.com> (raw)
In-Reply-To: <ecf1188996fc215622981c9c40163b81f234c997.1437212383.git.crosthwaite.peter@gmail.com>



On 18/07/2015 11:40, Peter Crosthwaite wrote:
> Multi-arch conversion consisting of:
>  * Compiling out all target-microblaze private contents of cpu.h
>    when doing multi-arch build
>  * Defining the QOM cpu hooks
>  * Add microblazeel to multi-support list
> 
> Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
> ---
> I guess I could split to multi patches but it will bloat this series!
> 
> Changed since RFCv2:
> Remove macro undefs (obsoleted)
> Remove arch prefixing redefinitions of cpu-defs symbols (obsoleted)
> Compile out SR_PC in multi-arch
> Remove configury changes
> Remove arch-obj conversions
> ---
>  multi-support/microblazeel      |  0
>  target-microblaze/Makefile.objs |  6 +++---
>  target-microblaze/cpu-qom.h     |  2 ++
>  target-microblaze/cpu.c         |  2 ++
>  target-microblaze/cpu.h         | 28 ++++++++++++++++++++++++----
>  5 files changed, 31 insertions(+), 7 deletions(-)
>  create mode 100644 multi-support/microblazeel
> 
> diff --git a/multi-support/microblazeel b/multi-support/microblazeel
> new file mode 100644
> index 0000000..e69de29
> diff --git a/target-microblaze/Makefile.objs b/target-microblaze/Makefile.objs
> index f3d7b44..f70163d 100644
> --- a/target-microblaze/Makefile.objs
> +++ b/target-microblaze/Makefile.objs
> @@ -1,3 +1,3 @@
> -obj-y += translate.o op_helper.o helper.o cpu.o
> -obj-y += gdbstub.o
> -obj-$(CONFIG_SOFTMMU) += mmu.o
> +arch-obj-y += translate.o op_helper.o helper.o cpu.o
> +arch-obj-y += gdbstub.o
> +arch-obj-$(CONFIG_SOFTMMU) += mmu.o
> diff --git a/target-microblaze/cpu-qom.h b/target-microblaze/cpu-qom.h
> index 34f6273..783095c 100644
> --- a/target-microblaze/cpu-qom.h
> +++ b/target-microblaze/cpu-qom.h
> @@ -79,9 +79,11 @@ static inline MicroBlazeCPU *mb_env_get_cpu(CPUMBState *env)
>      return container_of(env, MicroBlazeCPU, env);
>  }
>  
> +#ifndef TARGET_MULTI
>  #define ENV_GET_CPU(e) CPU(mb_env_get_cpu(e))
>  
>  #define ENV_OFFSET offsetof(MicroBlazeCPU, env)
> +#endif /* !TARGET_MULTI */

Would it make sense to split the headers in two instead of adding
#ifndefs?  In other words, move everything outside the #ifndef to
cpu-qom.h, and everything inside it to cpu.h.  Then include cpu-qom.h
only from the hw/ files.

Paolo

>  void mb_cpu_do_interrupt(CPUState *cs);
>  bool mb_cpu_exec_interrupt(CPUState *cs, int int_req);
> diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
> index 9ac509a..d460f69 100644
> --- a/target-microblaze/cpu.c
> +++ b/target-microblaze/cpu.c
> @@ -25,6 +25,7 @@
>  #include "qemu-common.h"
>  #include "hw/qdev-properties.h"
>  #include "migration/vmstate.h"
> +#include "tcg/tcg.h"
>  
>  static const struct {
>      const char *name;
> @@ -195,6 +196,7 @@ static void mb_cpu_initfn(Object *obj)
>      CPUMBState *env = &cpu->env;
>      static bool tcg_initialized;
>  
> +    CPU_SET_QOM_HOOKS(cs);
>      cs->env_ptr = env;
>      cpu_exec_init(cs, &error_abort);
>  
> diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h
> index 9bac856..c3085d5 100644
> --- a/target-microblaze/cpu.h
> +++ b/target-microblaze/cpu.h
> @@ -35,6 +35,8 @@ typedef struct CPUMBState CPUMBState;
>  #include "mmu.h"
>  #endif
>  
> +#ifndef TARGET_MULTI
> +
>  #define EXCP_MMU        1
>  #define EXCP_IRQ        2
>  #define EXCP_BREAK      3
> @@ -44,13 +46,17 @@ typedef struct CPUMBState CPUMBState;
>  /* MicroBlaze-specific interrupt pending bits.  */
>  #define CPU_INTERRUPT_NMI       CPU_INTERRUPT_TGT_EXT_3
>  
> +#endif /* TARGET_MULTI */
> +
>  /* Meanings of the MBCPU object's two inbound GPIO lines */
>  #define MB_CPU_IRQ 0
>  #define MB_CPU_FIR 1
>  
> -/* Register aliases. R0 - R15 */
> -#define R_SP     1
> +#ifndef TARGET_MULTI
> +
> +/* Register aliases. R1 - R15 */
>  #define SR_PC    0
> +#define R_SP     1
>  #define SR_MSR   1
>  #define SR_EAR   3
>  #define SR_ESR   5
> @@ -111,6 +117,11 @@ typedef struct CPUMBState CPUMBState;
>  #define FSR_UF          (1<<1) /* Underflow */
>  #define FSR_DO          (1<<0) /* Denormalized operand error */
>  
> +/* The Microblaze bootloader configures some of the PVRs in a board specific
> + * way as a reset process. This should go away with PVR property QOMification
> + * and then the PVRs can be made private to CPUs.
> + */
> +
>  /* Version reg.  */
>  /* Basic PVR mask */
>  #define PVR0_PVR_FULL_MASK              0x80000000
> @@ -211,10 +222,14 @@ typedef struct CPUMBState CPUMBState;
>  /* MSR Reset value PVR mask */
>  #define PVR11_MSR_RESET_VALUE_MASK      0x000007FF
>  
> +#endif /* TARGET_MULTI */
> +
>  #define C_PVR_NONE                      0
>  #define C_PVR_BASIC                     1
>  #define C_PVR_FULL                      2
>  
> +#ifndef TARGET_MULTI
> +
>  /* CPU flags.  */
>  
>  /* Condition codes.  */
> @@ -225,14 +240,16 @@ typedef struct CPUMBState CPUMBState;
>  #define CC_NE  1
>  #define CC_EQ  0
>  
> -#define NB_MMU_MODES    3
> -
>  #define STREAM_EXCEPTION (1 << 0)
>  #define STREAM_ATOMIC    (1 << 1)
>  #define STREAM_TEST      (1 << 2)
>  #define STREAM_CONTROL   (1 << 3)
>  #define STREAM_NONBLOCK  (1 << 4)
>  
> +#endif /* TARGET_MULTI */
> +
> +#define NB_MMU_MODES    3
> +
>  struct CPUMBState {
>      uint32_t debug;
>      uint32_t btaken;
> @@ -278,6 +295,8 @@ struct CPUMBState {
>  
>  #include "cpu-qom.h"
>  
> +#ifndef TARGET_MULTI
> +
>  void mb_tcg_init(void);
>  MicroBlazeCPU *cpu_mb_init(const char *cpu_model);
>  /* you can call this signal handler from your SIGBUS and SIGSEGV
> @@ -339,4 +358,5 @@ void mb_cpu_unassigned_access(CPUState *cpu, hwaddr addr,
>  
>  #include "exec/exec-all.h"
>  
> +#endif /* !TARGET_MULTI */
>  #endif
> 

  reply	other threads:[~2015-07-18 12:35 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-18  9:40 [Qemu-devel] [PATCH v3 00/35] Multi Architecture System Emulation Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 01/35] cpu-exec: Migrate some generic fns to cpu-exec-common Peter Crosthwaite
2015-07-18 12:44   ` Paolo Bonzini
2015-09-07  5:22     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 02/35] translate: Listify tcg_exec_init() Peter Crosthwaite
2015-09-07  5:24   ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 03/35] translate-all: Move tcg_handle_interrupt() to -common Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 04/35] tcg: split tcg_op_defs " Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 05/35] tcg: Move tcg_tb_ptr " Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 06/35] translate: move real_host_page setting " Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 07/35] cpus: Listify cpu_list() function Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 08/35] translate-common: Listify tcg_enabled() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 09/35] core: Convert tcg_enabled() users to tcg_(any|all)_enabled() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 10/35] exec-all: Move cpu_can_do_io() to qom/cpu.h Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 11/35] cputlb: move CPU_LOOP() for tlb_reset() to exec.c Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 12/35] cputlb: Change tlb_set_dirty() arg to cpu Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 13/35] include/exec: Move cputlb exec.c defs out Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 14/35] cpu-common: Define tb_page_addr_t for everyone Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 15/35] include/exec: Split target_long def to new header Peter Crosthwaite
2015-07-18 12:16   ` Paolo Bonzini
2015-07-18 12:37     ` Paolo Bonzini
2015-07-18 15:37       ` Peter Crosthwaite
2015-07-18 16:01         ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 16/35] cpu-defs: Allow multiple inclusions Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 17/35] monitor: uninclude cpu_ldst Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 18/35] target-*: Don't redefine cpu_exec() Peter Crosthwaite
2016-06-21 11:19   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 19/35] target-*: cpu.h: Undefine core code symbols Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 20/35] Makefile.target: Introduce arch-obj Peter Crosthwaite
2015-07-18 12:23   ` Paolo Bonzini
2015-07-18 12:29   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 21/35] core: virtualise CPU interfaces completely Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 22/35] core: Introduce multi-arch build Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 23/35] arm: cpu: static inline cpu_arm_init() Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 24/35] target-arm: Split cp helper API to new C file Peter Crosthwaite
2015-07-18 12:30   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 25/35] arm: register cpu_list() function Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 26/35] arm: enable multi-arch Peter Crosthwaite
2015-07-18 12:32   ` Paolo Bonzini
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 27/35] hw: arm: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 28/35] arm: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-07-18 12:33   ` Paolo Bonzini
2015-08-15 23:29     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 29/35] hw: mb: Explicitly include cpu.h for consumers Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 30/35] mb: Remove ELF_MACHINE from cpu.h Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 31/35] microblaze: enable multi-arch Peter Crosthwaite
2015-07-18 12:35   ` Paolo Bonzini [this message]
2015-07-18 20:04     ` Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 32/35] arm: boot: Don't assume all CPUs are ARM Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 34/35] HACK: mb: boot: Assume using -firmware for mb software Peter Crosthwaite
2015-07-18  9:40 ` [Qemu-devel] [PATCH v3 35/35] HACK: mb: boot: Disable dtb load in multi-arch Peter Crosthwaite
2015-07-18 12:44 ` [Qemu-devel] [PATCH v3 00/35] Multi Architecture System Emulation Paolo Bonzini
2015-07-18 15:45   ` Peter Crosthwaite

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=55AA480E.8070502@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=peter.maydell@linaro.org \
    --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).