* [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
@ 2013-08-21 16:45 Andreas Färber
2013-08-28 15:19 ` Andreas Färber
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2013-08-21 16:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Andreas Färber, Paul Brook
This simplifies the loop and aids with refactoring of CPU list.
Requested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
hw/cpu/a15mpcore.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
index af182da..9abba67 100644
--- a/hw/cpu/a15mpcore.c
+++ b/hw/cpu/a15mpcore.c
@@ -50,7 +50,6 @@ static int a15mp_priv_init(SysBusDevice *dev)
SysBusDevice *busdev;
const char *gictype = "arm_gic";
int i;
- CPUState *cpu;
if (kvm_irqchip_in_kernel()) {
gictype = "kvm-arm-gic";
@@ -72,8 +71,8 @@ static int a15mp_priv_init(SysBusDevice *dev)
/* Wire the outputs from each CPU's generic timer to the
* appropriate GIC PPI inputs
*/
- for (i = 0, cpu = first_cpu; i < s->num_cpu; i++, cpu = cpu->next_cpu) {
- DeviceState *cpudev = DEVICE(cpu);
+ for (i = 0; i < s->num_cpu; i++) {
+ DeviceState *cpudev = DEVICE(qemu_get_cpu(i));
int ppibase = s->num_irq - 32 + i * 32;
/* physical timer; we wire it up to the non-secure timer's ID,
* since a real A15 always has TrustZone but QEMU doesn't.
--
1.8.1.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
2013-08-21 16:45 [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers Andreas Färber
@ 2013-08-28 15:19 ` Andreas Färber
2013-08-28 15:22 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2013-08-28 15:19 UTC (permalink / raw)
To: qemu-devel; +Cc: Peter Maydell, Paul Brook
Am 21.08.2013 18:45, schrieb Andreas Färber:
> This simplifies the loop and aids with refactoring of CPU list.
>
> Requested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
> hw/cpu/a15mpcore.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Seeing no objection or pick-up from PMM I've applied this to qom-cpu
now, to move forward with CPU list refactoring.
https://github.com/afaerber/qemu-cpu/commits/qom-cpu
Andreas
>
> diff --git a/hw/cpu/a15mpcore.c b/hw/cpu/a15mpcore.c
> index af182da..9abba67 100644
> --- a/hw/cpu/a15mpcore.c
> +++ b/hw/cpu/a15mpcore.c
> @@ -50,7 +50,6 @@ static int a15mp_priv_init(SysBusDevice *dev)
> SysBusDevice *busdev;
> const char *gictype = "arm_gic";
> int i;
> - CPUState *cpu;
>
> if (kvm_irqchip_in_kernel()) {
> gictype = "kvm-arm-gic";
> @@ -72,8 +71,8 @@ static int a15mp_priv_init(SysBusDevice *dev)
> /* Wire the outputs from each CPU's generic timer to the
> * appropriate GIC PPI inputs
> */
> - for (i = 0, cpu = first_cpu; i < s->num_cpu; i++, cpu = cpu->next_cpu) {
> - DeviceState *cpudev = DEVICE(cpu);
> + for (i = 0; i < s->num_cpu; i++) {
> + DeviceState *cpudev = DEVICE(qemu_get_cpu(i));
> int ppibase = s->num_irq - 32 + i * 32;
> /* physical timer; we wire it up to the non-secure timer's ID,
> * since a real A15 always has TrustZone but QEMU doesn't.
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
2013-08-28 15:19 ` Andreas Färber
@ 2013-08-28 15:22 ` Peter Maydell
2013-08-28 15:35 ` Andreas Färber
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2013-08-28 15:22 UTC (permalink / raw)
To: Andreas Färber; +Cc: QEMU Developers, Paul Brook
On 28 August 2013 16:19, Andreas Färber <afaerber@suse.de> wrote:
> Am 21.08.2013 18:45, schrieb Andreas Färber:
>> This simplifies the loop and aids with refactoring of CPU list.
>>
>> Requested-by: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>> ---
>> hw/cpu/a15mpcore.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> Seeing no objection or pick-up from PMM I've applied this to qom-cpu
> now, to move forward with CPU list refactoring.
I wasn't sure how this patch fit with your larger series
that redoes the a15mpcore/gic/etc (which I think I'm
still waiting for an applyable patch set so I can review
it); I think I thought it was an apply-afterwards thing.
Anyway, I have no objection to it.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
2013-08-28 15:22 ` Peter Maydell
@ 2013-08-28 15:35 ` Andreas Färber
2013-08-28 16:11 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: Andreas Färber @ 2013-08-28 15:35 UTC (permalink / raw)
To: Peter Maydell; +Cc: Cornelia Huck, Alexander Graf, QEMU Developers, Paul Brook
Am 28.08.2013 17:22, schrieb Peter Maydell:
> On 28 August 2013 16:19, Andreas Färber <afaerber@suse.de> wrote:
>> Am 21.08.2013 18:45, schrieb Andreas Färber:
>>> This simplifies the loop and aids with refactoring of CPU list.
>>>
>>> Requested-by: Peter Maydell <peter.maydell@linaro.org>
>>> Signed-off-by: Andreas Färber <afaerber@suse.de>
>>> ---
>>> hw/cpu/a15mpcore.c | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> Seeing no objection or pick-up from PMM I've applied this to qom-cpu
>> now, to move forward with CPU list refactoring.
>
> I wasn't sure how this patch fit with your larger series
> that redoes the a15mpcore/gic/etc (which I think I'm
> still waiting for an applyable patch set so I can review
> it); I think I thought it was an apply-afterwards thing.
This one needs to go before my qom-cpu-12 series to avoid the CPU loop
ugliness. That's in my CPU tree, and seeing no objections I still need
to test the p_greetings2.c sample for the CPU-removed case in linux-user
and will then merge that before we get more CPU loops.
For the MPCore series in my ARM/Tegra tree you wanted an assert for
object_initialize(). I am waiting for you to comment on my more
invasive/complete series (last part being optional), which would then
with any suggested changes go through my QOM tree before I add more uses
of object_initialize() that would need to be converted.
Based on that I will respin the MPCore, virtio and other QOM series.
> Anyway, I have no objection to it.
Thanks, want me to add some *-by?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
2013-08-28 15:35 ` Andreas Färber
@ 2013-08-28 16:11 ` Peter Maydell
2013-08-28 16:16 ` Andreas Färber
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2013-08-28 16:11 UTC (permalink / raw)
To: Andreas Färber
Cc: Cornelia Huck, Alexander Graf, QEMU Developers, Paul Brook
On 28 August 2013 16:35, Andreas Färber <afaerber@suse.de> wrote:
> For the MPCore series in my ARM/Tegra tree you wanted an assert for
> object_initialize(). I am waiting for you to comment on my more
> invasive/complete series (last part being optional), which would then
> with any suggested changes go through my QOM tree before I add more uses
> of object_initialize() that would need to be converted.
Ah, OK. I'm moving house this week so probably won't get to
detailed review til next week, but I think in general it looked OK.
Having to pass "&X, sizeof(X)" in the most common case is
a little unfortunate but I think the bus related code and so on
convinced me it was necessary.
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers
2013-08-28 16:11 ` Peter Maydell
@ 2013-08-28 16:16 ` Andreas Färber
0 siblings, 0 replies; 6+ messages in thread
From: Andreas Färber @ 2013-08-28 16:16 UTC (permalink / raw)
To: Peter Maydell; +Cc: Cornelia Huck, QEMU Developers, Alexander Graf
Am 28.08.2013 18:11, schrieb Peter Maydell:
> On 28 August 2013 16:35, Andreas Färber <afaerber@suse.de> wrote:
>> For the MPCore series in my ARM/Tegra tree you wanted an assert for
>> object_initialize(). I am waiting for you to comment on my more
>> invasive/complete series (last part being optional), which would then
>> with any suggested changes go through my QOM tree before I add more uses
>> of object_initialize() that would need to be converted.
>
> Ah, OK. I'm moving house this week so probably won't get to
> detailed review til next week, but I think in general it looked OK.
> Having to pass "&X, sizeof(X)" in the most common case is
> a little unfortunate but I think the bus related code and so on
> convinced me it was necessary.
Yeah, it turned into more work than I expected ;) but there were at
least two cases (still need to reply) where the macro-fied version
would've checked the wrong thing and my patches are intentionally
deviating from the usual pattern - main_system_bus and a sec_bus.
Thanks,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-28 16:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 16:45 [Qemu-devel] [PATCH qom-cpu/arm-devs] hw/cpu/a15mpcore: Use qemu_get_cpu() for generic timers Andreas Färber
2013-08-28 15:19 ` Andreas Färber
2013-08-28 15:22 ` Peter Maydell
2013-08-28 15:35 ` Andreas Färber
2013-08-28 16:11 ` Peter Maydell
2013-08-28 16:16 ` Andreas Färber
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).