qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Clément Chigot" <chigot@adacore.com>
Cc: qemu-devel@nongnu.org, Frederic Konrad <konrad.frederic@yahoo.fr>
Subject: Re: [PATCH 3/9] intc/grlib_irqmp: implements the multiprocessor status register
Date: Fri, 5 Jan 2024 14:37:22 +0100	[thread overview]
Message-ID: <a103ed7a-aeeb-4d51-b0e7-996897e30658@linaro.org> (raw)
In-Reply-To: <CAJ307EiJ1SEdnnqEFFL-=YeO3XNtAJLLctixvxxFasQBhu0eFQ@mail.gmail.com>

On 5/1/24 14:23, Clément Chigot wrote:
> On Fri, Jan 5, 2024 at 12:32 PM Philippe Mathieu-Daudé
> <philmd@linaro.org> wrote:
>>
>> Hi Clément,
>>
>> On 5/1/24 11:24, Clément Chigot wrote:
>>> This implements the multiprocessor status register in grlib-irqmp and bind
>>> it to a start signal, which will be later wired in leon3-generic to
>>> start a cpu.
>>>
>>> Co-developed-by: Frederic Konrad <konrad.frederic@yahoo.fr>
>>> Signed-off-by: Clément Chigot <chigot@adacore.com>
>>> ---
>>>    hw/intc/grlib_irqmp.c | 22 +++++++++++++++++++---
>>>    1 file changed, 19 insertions(+), 3 deletions(-)
>>
>>
>>> @@ -323,6 +334,8 @@ static void grlib_irqmp_reset(DeviceState *d)
>>>
>>>        memset(irqmp->state, 0, sizeof *irqmp->state);
>>>        irqmp->state->parent = irqmp;
>>> +    irqmp->state->mpstatus = ((irqmp->ncpus - 1) << 28)
>>
>> Can you #define this magic '28' number?
>>
>>> +        | ((1 << irqmp->ncpus) - 2);
>>>    }
>>>
>>>    static void grlib_irqmp_realize(DeviceState *dev, Error **errp)
>>> @@ -336,6 +349,9 @@ static void grlib_irqmp_realize(DeviceState *dev, Error **errp)
>>>        }
>>>
>>>        qdev_init_gpio_in(dev, grlib_irqmp_set_irq, MAX_PILS);
>>> +    /* Transitionning from 0 to 1 starts the CPUs.  */
>>
>> What about 1 -> 0?
> 
> It does nothing. I have updated the comment to mention it.
> For the doc (also mention it in the commit message now).
>    | [15:1] Power-down status of CPU [n]: reads ‘1’ = power-down, ‘0’ = running.
>    | Write to start processor n: ‘1’=to start ‘0'=has no effect.

Then grlib_irqmp_write() could be simplified as:

      case MP_STATUS_OFFSET:
-        /* Read Only (no SMP support) */
+        state->mpstatus = deposit32(state->mpstatus,
+                                    value, 0, IRQMP_MAX_CPU);
+        for (unsigned i = 0; i < irqmp->ncpus; i++) {
+            qemu_set_irq(irqmp->start_signal[i],
+                         extract32(value, i, 1));
+        }
          return;


  reply	other threads:[~2024-01-05 13:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 10:24 [PATCH 0/9] sparc/leon3: Add support for -smp Clément Chigot
2024-01-05 10:24 ` [PATCH 1/9] sparc/grlib: split out the headers for each peripherals Clément Chigot
2024-01-05 14:00   ` Philippe Mathieu-Daudé
2024-01-05 14:39     ` Clément Chigot
2024-01-05 10:24 ` [PATCH 2/9] intc/grlib_irqmp: add ncpus property Clément Chigot
2024-01-05 11:25   ` Philippe Mathieu-Daudé
2024-01-05 10:24 ` [PATCH 3/9] intc/grlib_irqmp: implements the multiprocessor status register Clément Chigot
2024-01-05 11:32   ` Philippe Mathieu-Daudé
2024-01-05 13:23     ` Clément Chigot
2024-01-05 13:37       ` Philippe Mathieu-Daudé [this message]
2024-01-05 14:15         ` Clément Chigot
2024-01-05 10:24 ` [PATCH 4/9] intc/grlib_irqmp: implements multicore irq Clément Chigot
2024-01-05 14:15   ` Philippe Mathieu-Daudé
2024-01-05 10:24 ` [PATCH 5/9] target/sparc: implement asr17 feature for smp Clément Chigot
2024-01-09 17:31   ` Richard Henderson
2024-01-05 10:24 ` [PATCH 6/9] target/sparc: simplify qemu_irq_ack Clément Chigot
2024-01-05 11:33   ` Philippe Mathieu-Daudé
2024-01-05 10:24 ` [PATCH 7/9] leon3: implement multiprocessor Clément Chigot
2024-01-05 10:24 ` [PATCH 8/9] leon3: check cpu_id in the tiny bootloader Clément Chigot
2024-01-05 10:24 ` [PATCH 9/9] MAINTAINERS: replace Fabien by myself as Leon3 maintainer Clément Chigot
2024-01-05 10:29   ` Clément Chigot
2024-01-05 10:42     ` Fabien Chouteau

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=a103ed7a-aeeb-4d51-b0e7-996897e30658@linaro.org \
    --to=philmd@linaro.org \
    --cc=chigot@adacore.com \
    --cc=konrad.frederic@yahoo.fr \
    --cc=qemu-devel@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).