qemu-trivial.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Like Xu <like.xu@linux.intel.com>
To: Alistair Francis <alistair23@gmail.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	like.xu@intel.com,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH 7/9] cpu/topology: add riscv support for smp machine properties
Date: Mon, 1 Apr 2019 10:10:09 +0800	[thread overview]
Message-ID: <f18ff267-e23d-7853-c092-c9211ca7823b@linux.intel.com> (raw)
In-Reply-To: <CAKmqyKPqKqdBpeyJMbrZq3b2pe5V-yHJAsNDugOEWrdKr0buqg@mail.gmail.com>

On 2019/3/30 7:01, Alistair Francis wrote:
> On Fri, Mar 29, 2019 at 1:59 AM Like Xu <like.xu@linux.intel.com> wrote:
>>
>> Signed-off-by: Like Xu <like.xu@linux.intel.com>
>> ---
>>   hw/openrisc/openrisc_sim.c | 1 +
>>   hw/riscv/sifive_e.c        | 4 ++++
>>   hw/riscv/sifive_plic.c     | 3 +++
>>   hw/riscv/sifive_u.c        | 4 ++++
>>   hw/riscv/spike.c           | 2 ++
>>   hw/riscv/virt.c            | 1 +
>>   6 files changed, 15 insertions(+)
>>
>> diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c
>> index 7d3b734..ecfc973 100644
>> --- a/hw/openrisc/openrisc_sim.c
>> +++ b/hw/openrisc/openrisc_sim.c
>> @@ -131,6 +131,7 @@ static void openrisc_sim_init(MachineState *machine)
>>       qemu_irq *cpu_irqs[2];
>>       qemu_irq serial_irq;
>>       int n;
>> +    unsigned int smp_cpus = machine->topo.smp_cpus;
> 
> OpenRISC and RISC-V are not the same thing, it's probably worth
> splitting this out into a separate patch.
> 
> Alistair
You're right and thanks.
I may fix it in next version.

> 
>>
>>       for (n = 0; n < smp_cpus; n++) {
>>           cpu = OPENRISC_CPU(cpu_create(machine->cpu_type));
>> diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c
>> index b1cd113..c65c7b5 100644
>> --- a/hw/riscv/sifive_e.c
>> +++ b/hw/riscv/sifive_e.c
>> @@ -137,6 +137,8 @@ static void riscv_sifive_e_init(MachineState *machine)
>>
>>   static void riscv_sifive_e_soc_init(Object *obj)
>>   {
>> +    MachineState *ms = MACHINE(qdev_get_machine());
>> +    unsigned int smp_cpus = ms->topo.smp_cpus;
>>       SiFiveESoCState *s = RISCV_E_SOC(obj);
>>
>>       object_initialize_child(obj, "cpus", &s->cpus,
>> @@ -150,6 +152,8 @@ static void riscv_sifive_e_soc_init(Object *obj)
>>
>>   static void riscv_sifive_e_soc_realize(DeviceState *dev, Error **errp)
>>   {
>> +    MachineState *ms = MACHINE(qdev_get_machine());
>> +    unsigned int smp_cpus = ms->topo.smp_cpus;
>>       const struct MemmapEntry *memmap = sifive_e_memmap;
>>
>>       SiFiveESoCState *s = RISCV_E_SOC(dev);
>> diff --git a/hw/riscv/sifive_plic.c b/hw/riscv/sifive_plic.c
>> index ac768e6..161fbd9 100644
>> --- a/hw/riscv/sifive_plic.c
>> +++ b/hw/riscv/sifive_plic.c
>> @@ -23,6 +23,7 @@
>>   #include "qemu/error-report.h"
>>   #include "hw/sysbus.h"
>>   #include "hw/pci/msi.h"
>> +#include "hw/boards.h"
>>   #include "target/riscv/cpu.h"
>>   #include "sysemu/sysemu.h"
>>   #include "hw/riscv/sifive_plic.h"
>> @@ -432,6 +433,8 @@ static void sifive_plic_irq_request(void *opaque, int irq, int level)
>>
>>   static void sifive_plic_realize(DeviceState *dev, Error **errp)
>>   {
>> +    MachineState *ms = MACHINE(qdev_get_machine());
>> +    unsigned int smp_cpus = ms->topo.smp_cpus;
>>       SiFivePLICState *plic = SIFIVE_PLIC(dev);
>>       int i;
>>
>> diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
>> index 5ecc47c..b4a8d66 100644
>> --- a/hw/riscv/sifive_u.c
>> +++ b/hw/riscv/sifive_u.c
>> @@ -321,6 +321,8 @@ static void riscv_sifive_u_init(MachineState *machine)
>>
>>   static void riscv_sifive_u_soc_init(Object *obj)
>>   {
>> +    MachineState *ms = MACHINE(qdev_get_machine());
>> +    unsigned int smp_cpus = ms->topo.smp_cpus;
>>       SiFiveUSoCState *s = RISCV_U_SOC(obj);
>>
>>       object_initialize_child(obj, "cpus", &s->cpus, sizeof(s->cpus),
>> @@ -336,6 +338,8 @@ static void riscv_sifive_u_soc_init(Object *obj)
>>
>>   static void riscv_sifive_u_soc_realize(DeviceState *dev, Error **errp)
>>   {
>> +    MachineState *ms = MACHINE(qdev_get_machine());
>> +    unsigned int smp_cpus = ms->topo.smp_cpus;
>>       SiFiveUSoCState *s = RISCV_U_SOC(dev);
>>       const struct MemmapEntry *memmap = sifive_u_memmap;
>>       MemoryRegion *system_memory = get_system_memory();
>> diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
>> index 2a000a5..5fe441c 100644
>> --- a/hw/riscv/spike.c
>> +++ b/hw/riscv/spike.c
>> @@ -171,6 +171,7 @@ static void spike_v1_10_0_board_init(MachineState *machine)
>>       MemoryRegion *main_mem = g_new(MemoryRegion, 1);
>>       MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
>>       int i;
>> +    unsigned int smp_cpus = machine->topo.smp_cpus;
>>
>>       /* Initialize SOC */
>>       object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
>> @@ -253,6 +254,7 @@ static void spike_v1_09_1_board_init(MachineState *machine)
>>       MemoryRegion *main_mem = g_new(MemoryRegion, 1);
>>       MemoryRegion *mask_rom = g_new(MemoryRegion, 1);
>>       int i;
>> +    unsigned int smp_cpus = machine->topo.smp_cpus;
>>
>>       /* Initialize SOC */
>>       object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
>> diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
>> index fc4c6b3..9d4d305 100644
>> --- a/hw/riscv/virt.c
>> +++ b/hw/riscv/virt.c
>> @@ -395,6 +395,7 @@ static void riscv_virt_board_init(MachineState *machine)
>>       char *plic_hart_config;
>>       size_t plic_hart_config_len;
>>       int i;
>> +    unsigned int smp_cpus = machine->topo.smp_cpus;
>>       void *fdt;
>>
>>       /* Initialize SOC */
>> --
>> 1.8.3.1
>>
>>
> 



  parent reply	other threads:[~2019-04-01  2:10 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29  8:48 [Qemu-trivial] [Qemu-devel] [PATCH 0/9] refactor cpu topo into machine properties Like Xu
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 1/9] cpu/topology: add struct CpuTopology to MachineState Like Xu
2019-03-29  9:22   ` Alex Bennée
2019-04-01  2:07     ` Like Xu
2019-04-04 11:37   ` Igor Mammedov
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 2/9] cpu/topology: add general support for machine properties Like Xu
2019-04-04 14:25   ` Igor Mammedov
2019-04-04 16:21     ` Dr. David Alan Gilbert
2019-04-30  7:30     ` Like Xu
2019-05-02 15:09       ` Igor Mammedov
2019-05-03  1:08         ` Eduardo Habkost
2019-05-03  1:01       ` Eduardo Habkost
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 3/9] cpu/topology: add uncommon arch support for smp " Like Xu
2019-04-08 12:54   ` Igor Mammedov
2019-04-16  8:47     ` Like Xu
2019-04-16 12:00       ` Igor Mammedov
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 4/9] cpu/topology: add ARM " Like Xu
2019-03-29  9:27   ` Alex Bennée
2019-03-29 11:20     ` Philippe Mathieu-Daudé
2019-04-01  2:27       ` Like Xu
2019-04-01  2:56     ` Like Xu
2019-04-01 23:38       ` Eduardo Habkost
2019-04-02  2:35         ` Like Xu
2019-04-02  4:45           ` Peter Maydell
2019-04-02  5:20             ` Like Xu
2019-04-02  5:27               ` Peter Maydell
2019-04-08 13:11   ` Igor Mammedov
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 5/9] cpu/topology: add i386 " Like Xu
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 6/9] cpu/topology: add PPC " Like Xu
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 7/9] cpu/topology: add riscv " Like Xu
     [not found]   ` <CAKmqyKPqKqdBpeyJMbrZq3b2pe5V-yHJAsNDugOEWrdKr0buqg@mail.gmail.com>
2019-04-01  2:10     ` Like Xu [this message]
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 8/9] cpu/topology: add s390x " Like Xu
2019-03-29  8:48 ` [Qemu-trivial] [Qemu-devel] [PATCH 9/9] cpu/topology: replace smp global variables with machine propertie Like Xu
2019-03-29  9:07 ` [Qemu-trivial] [Qemu-devel] [PATCH 0/9] refactor cpu topo into machine properties no-reply
2019-03-29 10:21 ` Igor Mammedov
2019-04-04  3:26   ` Like Xu
2019-04-08 13:26     ` Igor Mammedov
2019-04-08 14:38       ` Like Xu

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=f18ff267-e23d-7853-c092-c9211ca7823b@linux.intel.com \
    --to=like.xu@linux.intel.com \
    --cc=alistair23@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=like.xu@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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).