qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Song Gao <gaosong@loongson.cn>
To: Jiaxun Yang <jiaxun.yang@flygoat.com>, qemu-devel@nongnu.org
Cc: yangxiaojuan@loongson.cn, philmd@linaro.org,
	chenhuacai@kernel.org, crosa@redhat.com, wainersm@redhat.com,
	bleal@redhat.com
Subject: Re: [PATCH 1/4] hw/intc/loongarch_ipi: Bring back all 4 IPI mailboxes
Date: Sat, 3 Jun 2023 16:37:56 +0800	[thread overview]
Message-ID: <e325ebf2-26ea-995b-3a70-bb6cea2c2022@loongson.cn> (raw)
In-Reply-To: <20230521102307.87081-2-jiaxun.yang@flygoat.com>



在 2023/5/21 下午6:23, Jiaxun Yang 写道:
> As per "Loongson 3A5000/3B5000 Processor Reference Manual",
> Loongson 3A5000's IPI implementation have 4 mailboxes per
> core.
>
> However, in 78464f023b54 ("hw/loongarch/virt: Modify ipi as
> percpu device"), the number of IPI mailboxes was reduced to
> one, which mismatches actual hardware.
>
> It won't affect LoongArch based system as LoongArch boot code
> only uses the first mailbox, however MIPS based Loongson boot
> code uses all 4 mailboxes.
>
> Fixes: 78464f023b54 ("hw/loongarch/virt: Modify ipi as percpu device")
> Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> ---
>   hw/intc/loongarch_ipi.c         | 6 +++---
>   include/hw/intc/loongarch_ipi.h | 4 +++-
>   2 files changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Song Gao <gaosong@loongson.cn>

Thanks.
Song Gao
> diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c
> index d6ab91721ea1..3e453816524e 100644
> --- a/hw/intc/loongarch_ipi.c
> +++ b/hw/intc/loongarch_ipi.c
> @@ -238,14 +238,14 @@ static void loongarch_ipi_init(Object *obj)
>   
>   static const VMStateDescription vmstate_ipi_core = {
>       .name = "ipi-single",
> -    .version_id = 1,
> -    .minimum_version_id = 1,
> +    .version_id = 2,
> +    .minimum_version_id = 2,
>       .fields = (VMStateField[]) {
>           VMSTATE_UINT32(status, IPICore),
>           VMSTATE_UINT32(en, IPICore),
>           VMSTATE_UINT32(set, IPICore),
>           VMSTATE_UINT32(clear, IPICore),
> -        VMSTATE_UINT32_ARRAY(buf, IPICore, 2),
> +        VMSTATE_UINT32_ARRAY(buf, IPICore, IPI_MBX_NUM * 2),
>           VMSTATE_END_OF_LIST()
>       }
>   };
> diff --git a/include/hw/intc/loongarch_ipi.h b/include/hw/intc/loongarch_ipi.h
> index 664e050b926e..6c6194786e80 100644
> --- a/include/hw/intc/loongarch_ipi.h
> +++ b/include/hw/intc/loongarch_ipi.h
> @@ -28,6 +28,8 @@
>   #define MAIL_SEND_OFFSET      0
>   #define ANY_SEND_OFFSET       (IOCSR_ANY_SEND - IOCSR_MAIL_SEND)
>   
> +#define IPI_MBX_NUM           4
> +
>   #define TYPE_LOONGARCH_IPI "loongarch_ipi"
>   OBJECT_DECLARE_SIMPLE_TYPE(LoongArchIPI, LOONGARCH_IPI)
>   
> @@ -37,7 +39,7 @@ typedef struct IPICore {
>       uint32_t set;
>       uint32_t clear;
>       /* 64bit buf divide into 2 32bit buf */
> -    uint32_t buf[2];
> +    uint32_t buf[IPI_MBX_NUM * 2];
>       qemu_irq irq;
>   } IPICore;
>   



  parent reply	other threads:[~2023-06-03  8:38 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 10:23 [PATCH 0/4] hw/mips/loongson3_virt: Wire up loongarch_ipi device Jiaxun Yang
2023-05-21 10:23 ` [PATCH 1/4] hw/intc/loongarch_ipi: Bring back all 4 IPI mailboxes Jiaxun Yang
2023-05-22  3:52   ` Huacai Chen
2023-05-22 11:47     ` Jiaxun Yang
2023-05-22 13:44       ` Philippe Mathieu-Daudé
2023-05-23  1:25         ` Song Gao
2023-05-23  3:22           ` Jiaxun Yang
2023-05-23 10:01             ` Song Gao
2023-05-23 11:18               ` Jiaxun Yang
2023-05-23 13:07                 ` Philippe Mathieu-Daudé
2023-06-03  7:38                   ` bibo, mao
2023-06-02 17:28   ` Peter Maydell
2023-06-03  7:06     ` Jiaxun Yang
2023-06-03  7:21       ` Song Gao
2023-06-03  8:37   ` Song Gao [this message]
2023-05-21 10:23 ` [PATCH 2/4] hw/intc/loongarch_ipi: Guard LoongArch only features with ifdef Jiaxun Yang
2023-05-22  2:32   ` Song Gao
2023-05-21 10:23 ` [PATCH 3/4] hw/mips/loongson3_virt: Wire up loongarch_ipi device Jiaxun Yang
2023-05-21 10:23 ` [PATCH 4/4] tests/avocado: Add boot_linux_console test for loongson3-virt Jiaxun Yang

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=e325ebf2-26ea-995b-3a70-bb6cea2c2022@loongson.cn \
    --to=gaosong@loongson.cn \
    --cc=bleal@redhat.com \
    --cc=chenhuacai@kernel.org \
    --cc=crosa@redhat.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.com \
    --cc=yangxiaojuan@loongson.cn \
    /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).