From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YpXXS-0001e2-KV for qemu-devel@nongnu.org; Tue, 05 May 2015 03:45:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YpXXO-0002z9-Jl for qemu-devel@nongnu.org; Tue, 05 May 2015 03:45:10 -0400 Date: Tue, 5 May 2015 16:49:08 +1000 From: David Gibson Message-ID: <20150505064908.GH14090@voom.redhat.com> References: <1429858066-12088-1-git-send-email-bharata@linux.vnet.ibm.com> <1429858066-12088-11-git-send-email-bharata@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CEUtFxTsmBsHRLs3" Content-Disposition: inline In-Reply-To: <1429858066-12088-11-git-send-email-bharata@linux.vnet.ibm.com> Subject: Re: [Qemu-devel] [RFC PATCH v3 10/24] ppc: Update cpu_model in MachineState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bharata B Rao Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com, imammedo@redhat.com, afaerber@suse.de --CEUtFxTsmBsHRLs3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Apr 24, 2015 at 12:17:32PM +0530, Bharata B Rao wrote: > Keep cpu_model field in MachineState uptodate so that it can be used > from the CPU hotplug path. >=20 > Signed-off-by: Bharata B Rao > Reviewed-by: David Gibson As before, this looks fine to me, but I'm not sure which tree it should go through. Alex, do you want to take it directly, or send an Acked-by and I'll take it through spapr-next? > --- > hw/ppc/mac_newworld.c | 10 +++++----- > hw/ppc/mac_oldworld.c | 7 +++---- > hw/ppc/ppc440_bamboo.c | 7 +++---- > hw/ppc/prep.c | 7 +++---- > hw/ppc/spapr.c | 7 +++---- > hw/ppc/virtex_ml507.c | 7 +++---- > 6 files changed, 20 insertions(+), 25 deletions(-) >=20 > diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c > index 624b4ab..fe18bce 100644 > --- a/hw/ppc/mac_newworld.c > +++ b/hw/ppc/mac_newworld.c > @@ -145,7 +145,6 @@ static void ppc_core99_reset(void *opaque) > static void ppc_core99_init(MachineState *machine) > { > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > const char *initrd_filename =3D machine->initrd_filename; > @@ -182,14 +181,15 @@ static void ppc_core99_init(MachineState *machine) > linux_boot =3D (kernel_filename !=3D NULL); > =20 > /* init CPUs */ > - if (cpu_model =3D=3D NULL) > + if (machine->cpu_model =3D=3D NULL) { > #ifdef TARGET_PPC64 > - cpu_model =3D "970fx"; > + machine->cpu_model =3D "970fx"; > #else > - cpu_model =3D "G4"; > + machine->cpu_model =3D "G4"; > #endif > + } > for (i =3D 0; i < smp_cpus; i++) { > - cpu =3D cpu_ppc_init(cpu_model); > + cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > fprintf(stderr, "Unable to find PowerPC CPU definition\n"); > exit(1); > diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c > index 3079510..2732319 100644 > --- a/hw/ppc/mac_oldworld.c > +++ b/hw/ppc/mac_oldworld.c > @@ -75,7 +75,6 @@ static void ppc_heathrow_reset(void *opaque) > static void ppc_heathrow_init(MachineState *machine) > { > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > const char *initrd_filename =3D machine->initrd_filename; > @@ -107,10 +106,10 @@ static void ppc_heathrow_init(MachineState *machine) > linux_boot =3D (kernel_filename !=3D NULL); > =20 > /* init CPUs */ > - if (cpu_model =3D=3D NULL) > - cpu_model =3D "G3"; > + if (machine->cpu_model =3D=3D NULL) > + machine->cpu_model =3D "G3"; > for (i =3D 0; i < smp_cpus; i++) { > - cpu =3D cpu_ppc_init(cpu_model); > + cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > fprintf(stderr, "Unable to find PowerPC CPU definition\n"); > exit(1); > diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c > index 778970a..032fa80 100644 > --- a/hw/ppc/ppc440_bamboo.c > +++ b/hw/ppc/ppc440_bamboo.c > @@ -159,7 +159,6 @@ static void main_cpu_reset(void *opaque) > static void bamboo_init(MachineState *machine) > { > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > const char *initrd_filename =3D machine->initrd_filename; > @@ -184,10 +183,10 @@ static void bamboo_init(MachineState *machine) > int i; > =20 > /* Setup CPU. */ > - if (cpu_model =3D=3D NULL) { > - cpu_model =3D "440EP"; > + if (machine->cpu_model =3D=3D NULL) { > + machine->cpu_model =3D "440EP"; > } > - cpu =3D cpu_ppc_init(cpu_model); > + cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > fprintf(stderr, "Unable to initialize CPU!\n"); > exit(1); > diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c > index 15df7f3..55e9643 100644 > --- a/hw/ppc/prep.c > +++ b/hw/ppc/prep.c > @@ -364,7 +364,6 @@ static PortioList prep_port_list; > static void ppc_prep_init(MachineState *machine) > { > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > const char *initrd_filename =3D machine->initrd_filename; > @@ -396,10 +395,10 @@ static void ppc_prep_init(MachineState *machine) > linux_boot =3D (kernel_filename !=3D NULL); > =20 > /* init CPUs */ > - if (cpu_model =3D=3D NULL) > - cpu_model =3D "602"; > + if (machine->cpu_model =3D=3D NULL) > + machine->cpu_model =3D "602"; > for (i =3D 0; i < smp_cpus; i++) { > - cpu =3D cpu_ppc_init(cpu_model); > + cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > fprintf(stderr, "Unable to find PowerPC CPU definition\n"); > exit(1); > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index f2c4fbd..8cc55fe 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -1473,7 +1473,6 @@ static void ppc_spapr_init(MachineState *machine) > { > sPAPRMachineClass *smc =3D SPAPR_MACHINE_GET_CLASS(machine); > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > const char *initrd_filename =3D machine->initrd_filename; > @@ -1567,11 +1566,11 @@ static void ppc_spapr_init(MachineState *machine) > } > =20 > /* init CPUs */ > - if (cpu_model =3D=3D NULL) { > - cpu_model =3D kvm_enabled() ? "host" : "POWER7"; > + if (machine->cpu_model =3D=3D NULL) { > + machine->cpu_model =3D kvm_enabled() ? "host" : "POWER7"; > } > for (i =3D 0; i < smp_cpus; i++) { > - cpu =3D cpu_ppc_init(cpu_model); > + cpu =3D cpu_ppc_init(machine->cpu_model); > if (cpu =3D=3D NULL) { > fprintf(stderr, "Unable to find PowerPC CPU definition\n"); > exit(1); > diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c > index 6ebd5be..f33d398 100644 > --- a/hw/ppc/virtex_ml507.c > +++ b/hw/ppc/virtex_ml507.c > @@ -197,7 +197,6 @@ static int xilinx_load_device_tree(hwaddr addr, > static void virtex_init(MachineState *machine) > { > ram_addr_t ram_size =3D machine->ram_size; > - const char *cpu_model =3D machine->cpu_model; > const char *kernel_filename =3D machine->kernel_filename; > const char *kernel_cmdline =3D machine->kernel_cmdline; > hwaddr initrd_base =3D 0; > @@ -214,11 +213,11 @@ static void virtex_init(MachineState *machine) > int i; > =20 > /* init CPUs */ > - if (cpu_model =3D=3D NULL) { > - cpu_model =3D "440-Xilinx"; > + if (machine->cpu_model =3D=3D NULL) { > + machine->cpu_model =3D "440-Xilinx"; > } > =20 > - cpu =3D ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000); > + cpu =3D ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 4000000= 00); > env =3D &cpu->env; > qemu_register_reset(main_cpu_reset, cpu); > =20 --=20 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 --CEUtFxTsmBsHRLs3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVSGfkAAoJEGw4ysog2bOSW+YP/2SvrCGdM8V/Wo1GqYye4wsk sjNfwFSNuxCj9L3x4/YSJ6bYH1ObQRaovntrw5o4Epo+sLGghWQnOylxo8/PAI3Y Yeq5E8hei3jqYKFnX8wnQ28KDGo38oON6TecV7zqlBvPI1GDkhlv75XnBEV9f4LL 0T0f6vTCaA7sIinbchGVg3wyD83kdqP1ecA0gamnziq0onKbdQetZJToGU+lNda7 GmteMPvguD5hWmMbnnxe7ojJOVyYQYyj027GxWIW5SkRhT9yUL2rFy0tSa7S1UQc E5bA8w+MTfJsiEPmdKK6nc65bh5QrHkkZI6i7ugiD9qUllbrtGCAs97bfBM6e83p MT7VeMJn/6hEQkQ0gwjdk1yVDQTGUUIkMbnWXLTUyvsrLQwTVpCWnnX8Dth5C2pZ eSeJAXmGeHmNPkuyiMd5q3wVbkmWhGx/pNABHY9lHAmo9EEzQW1Wo8dWh3eJ43Jd vR4IV2grg2h2iD6ac/FIaMbwq8eWhnxO/HQjP670fx44OHYomwx4b++DAa/pc/QY vsNqpIKlSYfyeVT8IYcUMg7Rq1BbxGlxpHVzY0LYGMrA5ExrxnVBnuFIgUkloc9Z jCm7PJKjXdMyDZYjvaHk2ViQjxPNQkT64T1HZ7SwRC+7B/1X1oo37SC0RosT/Vqe dgChqOdlnDHoOaT70U9f =h7Ku -----END PGP SIGNATURE----- --CEUtFxTsmBsHRLs3--