All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: aik@ozlabs.ru, Bharata B Rao <bharata@linux.vnet.ibm.com>,
	mdroth@linux.vnet.ibm.com, agraf@suse.de, qemu-ppc@nongnu.org,
	tyreld@linux.vnet.ibm.com, nfont@linux.vnet.ibm.com,
	imammedo@redhat.com, afaerber@suse.de,
	david@gibson.dropbear.id.au
Subject: [Qemu-devel] [RFC PATCH v3 10/24] ppc: Update cpu_model in MachineState
Date: Fri, 24 Apr 2015 12:17:32 +0530	[thread overview]
Message-ID: <1429858066-12088-11-git-send-email-bharata@linux.vnet.ibm.com> (raw)
In-Reply-To: <1429858066-12088-1-git-send-email-bharata@linux.vnet.ibm.com>

Keep cpu_model field in MachineState uptodate so that it can be used
from the CPU hotplug path.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
---
 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(-)

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 = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
@@ -182,14 +181,15 @@ static void ppc_core99_init(MachineState *machine)
     linux_boot = (kernel_filename != NULL);
 
     /* init CPUs */
-    if (cpu_model == NULL)
+    if (machine->cpu_model == NULL) {
 #ifdef TARGET_PPC64
-        cpu_model = "970fx";
+        machine->cpu_model = "970fx";
 #else
-        cpu_model = "G4";
+        machine->cpu_model = "G4";
 #endif
+    }
     for (i = 0; i < smp_cpus; i++) {
-        cpu = cpu_ppc_init(cpu_model);
+        cpu = cpu_ppc_init(machine->cpu_model);
         if (cpu == 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 = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
@@ -107,10 +106,10 @@ static void ppc_heathrow_init(MachineState *machine)
     linux_boot = (kernel_filename != NULL);
 
     /* init CPUs */
-    if (cpu_model == NULL)
-        cpu_model = "G3";
+    if (machine->cpu_model == NULL)
+        machine->cpu_model = "G3";
     for (i = 0; i < smp_cpus; i++) {
-        cpu = cpu_ppc_init(cpu_model);
+        cpu = cpu_ppc_init(machine->cpu_model);
         if (cpu == 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 = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
@@ -184,10 +183,10 @@ static void bamboo_init(MachineState *machine)
     int i;
 
     /* Setup CPU. */
-    if (cpu_model == NULL) {
-        cpu_model = "440EP";
+    if (machine->cpu_model == NULL) {
+        machine->cpu_model = "440EP";
     }
-    cpu = cpu_ppc_init(cpu_model);
+    cpu = cpu_ppc_init(machine->cpu_model);
     if (cpu == 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 = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
@@ -396,10 +395,10 @@ static void ppc_prep_init(MachineState *machine)
     linux_boot = (kernel_filename != NULL);
 
     /* init CPUs */
-    if (cpu_model == NULL)
-        cpu_model = "602";
+    if (machine->cpu_model == NULL)
+        machine->cpu_model = "602";
     for (i = 0; i < smp_cpus; i++) {
-        cpu = cpu_ppc_init(cpu_model);
+        cpu = cpu_ppc_init(machine->cpu_model);
         if (cpu == 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 = SPAPR_MACHINE_GET_CLASS(machine);
     ram_addr_t ram_size = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     const char *initrd_filename = machine->initrd_filename;
@@ -1567,11 +1566,11 @@ static void ppc_spapr_init(MachineState *machine)
     }
 
     /* init CPUs */
-    if (cpu_model == NULL) {
-        cpu_model = kvm_enabled() ? "host" : "POWER7";
+    if (machine->cpu_model == NULL) {
+        machine->cpu_model = kvm_enabled() ? "host" : "POWER7";
     }
     for (i = 0; i < smp_cpus; i++) {
-        cpu = cpu_ppc_init(cpu_model);
+        cpu = cpu_ppc_init(machine->cpu_model);
         if (cpu == 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 = machine->ram_size;
-    const char *cpu_model = machine->cpu_model;
     const char *kernel_filename = machine->kernel_filename;
     const char *kernel_cmdline = machine->kernel_cmdline;
     hwaddr initrd_base = 0;
@@ -214,11 +213,11 @@ static void virtex_init(MachineState *machine)
     int i;
 
     /* init CPUs */
-    if (cpu_model == NULL) {
-        cpu_model = "440-Xilinx";
+    if (machine->cpu_model == NULL) {
+        machine->cpu_model = "440-Xilinx";
     }
 
-    cpu = ppc440_init_xilinx(&ram_size, 1, cpu_model, 400000000);
+    cpu = ppc440_init_xilinx(&ram_size, 1, machine->cpu_model, 400000000);
     env = &cpu->env;
     qemu_register_reset(main_cpu_reset, cpu);
 
-- 
2.1.0

  parent reply	other threads:[~2015-04-24  6:51 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24  6:47 [Qemu-devel] [RFC PATCH v3 00/24] CPU and Memory hotplug for PowerPC sPAPR guests Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 01/24] spapr: enable PHB/CPU/LMB hotplug for pseries-2.3 Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 02/24] spapr: Add DRC dt entries for CPUs Bharata B Rao
2015-05-04 11:46   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 03/24] spapr: Consider max_cpus during xics initialization Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 04/24] spapr: Support ibm, lrdr-capacity device tree property Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 05/24] spapr: Reorganize CPU dt generation code Bharata B Rao
2015-04-26 11:47   ` Bharata B Rao
2015-04-27  5:36     ` Bharata B Rao
2015-05-04 12:01       ` David Gibson
2015-05-04 11:59   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 06/24] spapr: Consolidate cpu init code into a routine Bharata B Rao
2015-05-04 16:10   ` Thomas Huth
2015-05-06  4:28     ` Bharata B Rao
2015-05-06  6:32       ` Thomas Huth
2015-05-06  8:45         ` Bharata B Rao
2015-05-06  9:37           ` Thomas Huth
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 07/24] cpu: Prepare Socket container type Bharata B Rao
2015-05-05  1:47   ` David Gibson
2015-05-06  4:36     ` Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 08/24] ppc: Prepare CPU socket/core abstraction Bharata B Rao
2015-05-04 15:15   ` Thomas Huth
2015-05-06  4:40     ` Bharata B Rao
2015-05-06  6:52       ` Thomas Huth
2015-05-05  6:46   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 09/24] spapr: Add CPU hotplug handler Bharata B Rao
2015-04-24  6:47 ` Bharata B Rao [this message]
2015-05-05  6:49   ` [Qemu-devel] [RFC PATCH v3 10/24] ppc: Update cpu_model in MachineState David Gibson
2015-05-06  4:49     ` Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 11/24] ppc: Create sockets and cores for CPUs Bharata B Rao
2015-05-05  6:52   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 12/24] spapr: CPU hotplug support Bharata B Rao
2015-05-04 15:53   ` Thomas Huth
2015-05-06  5:37     ` Bharata B Rao
2015-05-05  6:59   ` David Gibson
2015-05-06  6:14     ` Bharata B Rao
2015-05-07  1:03       ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 13/24] cpus: Add Error argument to cpu_exec_init() Bharata B Rao
2015-05-05  7:01   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 14/24] cpus: Convert cpu_index into a bitmap Bharata B Rao
2015-05-05  7:10   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 15/24] ppc: Move cpu_exec_init() call to realize function Bharata B Rao
2015-05-05  7:12   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 16/24] qom: Introduce object_has_no_children() API Bharata B Rao
2015-05-05  7:13   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 17/24] cpus: Reclaim vCPU objects Bharata B Rao
2015-05-05  7:20   ` David Gibson
2015-05-06  6:37     ` Bharata B Rao
2015-05-07  1:06       ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 18/24] xics_kvm: Don't enable KVM_CAP_IRQ_XICS if already enabled Bharata B Rao
2015-05-05  7:22   ` David Gibson
2015-05-06  5:42     ` Bharata B Rao
2015-05-07  1:07       ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 19/24] xics_kvm: Add cpu_destroy method to XICS Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 20/24] spapr: CPU hot unplug support Bharata B Rao
2015-05-05  7:28   ` David Gibson
2015-05-06  7:55     ` Bharata B Rao
2015-05-07  1:09       ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 21/24] spapr: Initialize hotplug memory address space Bharata B Rao
2015-05-05  7:33   ` David Gibson
2015-05-06  7:58     ` Bharata B Rao
2015-05-05  8:48   ` Igor Mammedov
2015-05-06  8:23     ` Bharata B Rao
2015-05-07  1:12       ` David Gibson
2015-05-07  5:01         ` Bharata B Rao
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 22/24] numa: API to lookup NUMA node by address Bharata B Rao
2015-05-05  7:35   ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 23/24] spapr: Support ibm, dynamic-reconfiguration-memory Bharata B Rao
2015-05-05  7:40   ` David Gibson
2015-05-06  8:27     ` Bharata B Rao
2015-05-07  1:13       ` David Gibson
2015-04-24  6:47 ` [Qemu-devel] [RFC PATCH v3 24/24] spapr: Memory hotplug support Bharata B Rao
2015-05-05  7:45   ` David Gibson
2015-05-06  8:30     ` Bharata B Rao

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=1429858066-12088-11-git-send-email-bharata@linux.vnet.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aik@ozlabs.ru \
    --cc=david@gibson.dropbear.id.au \
    --cc=imammedo@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nfont@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=tyreld@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.