qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineSt


From: David Gibson
Subject: Re: [Qemu-devel] [RFC PATCH v0 1/8] cpu: Store CPU typename in MachineState
Date: Mon, 22 Feb 2016 19:04:37 +1100
User-agent: Mutt/1.5.24 (2015-08-30)

On Mon, Feb 22, 2016 at 10:31:18AM +0530, Bharata B Rao wrote:
> Storing CPU typename in MachineState lets us to create CPU threads
> for all architectures in uniform manner from arch-neutral code.
> 
> TODO: Touching only sPAPR target for now
> 
> Signed-off-by: Bharata B Rao <address@hidden>

As noted elsewhere, I hope we can do away with the need for this, but
I haven't yet figured out enough about the QOM model to see how.

> ---
>  hw/ppc/spapr.c      | 2 ++
>  include/hw/boards.h | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 5bd8fd3..3892a99 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1823,6 +1823,8 @@ static void ppc_spapr_init(MachineState *machine)
>      if (machine->cpu_model == NULL) {
>          machine->cpu_model = kvm_enabled() ? "host" : "POWER7";
>      }
> +    machine->cpu_type = TYPE_POWERPC_CPU;
> +
>      for (i = 0; i < smp_cpus; i++) {
>          cpu = cpu_ppc_init(machine->cpu_model);
>          if (cpu == NULL) {
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 0f30959..cf95d10 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -137,6 +137,7 @@ struct MachineState {
>      char *kernel_cmdline;
>      char *initrd_filename;
>      const char *cpu_model;
> +    const char *cpu_type;
>      AccelState *accelerator;
>  };
>  

-- 
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: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]