From: Richard Henderson <richard.henderson@linaro.org>
To: yangxiaojuan <yangxiaojuan@loongson.cn>, qemu-devel@nongnu.org
Cc: gaosong@loongson.cn, maobibo@loongson.cn,
mark.cave-ayland@ilande.co.uk, f4bug@amsat.org,
peter.maydell@linaro.org
Subject: Re: [PATCH v2 3/3] hw/intc: Fix LoongArch ipi device emulation
Date: Wed, 28 Sep 2022 21:12:17 -0700 [thread overview]
Message-ID: <5db38749-bb80-6b51-1959-b6e6216376c2@linaro.org> (raw)
In-Reply-To: <d792e3f7-ea97-47b7-e556-8ebf1576d501@loongson.cn>
On 9/28/22 20:23, yangxiaojuan wrote:
>
> 在 2022/9/29 上午10:42, Richard Henderson 写道:
>> On 9/26/22 23:12, Xiaojuan Yang wrote:
>>> In ipi_send function, it should not to set irq before
>>> writing data to dest cpu iocsr space, as the irq will
>>> trigger after data writing.
>>>
>>> Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
>>> ---
>>> hw/intc/loongarch_ipi.c | 1 -
>>> 1 file changed, 1 deletion(-)
>>>
>>> diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c
>>> index 4f3c58f872..aa4bf9eb74 100644
>>> --- a/hw/intc/loongarch_ipi.c
>>> +++ b/hw/intc/loongarch_ipi.c
>>> @@ -88,7 +88,6 @@ static void ipi_send(uint64_t val)
>>> cs = qemu_get_cpu(cpuid);
>>> cpu = LOONGARCH_CPU(cs);
>>> env = &cpu->env;
>>> - loongarch_cpu_set_irq(cpu, IRQ_IPI, 1);
>>> address_space_stl(&env->address_space_iocsr, 0x1008,
>>> data, MEMTXATTRS_UNSPECIFIED, NULL);
>>
>> Did you mean to move the call below the set?
>> Otherwise, where does the irq get raised?
>>
> When call this function 'address_space_stl(&env->address_space_iocsr, 0x1008, ... ...)',
> it will trigger loongarch_ipi_writel(), the addr arg is 0x1008 ('CORE_SET_OFFSET'), and
> qemu_irq_raise will be called in this case.
Ah, I see now, connected to
qdev_connect_gpio_out(ipi, cpu, qdev_get_gpio_in(cpudev, IRQ_IPI));
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
prev parent reply other threads:[~2022-09-29 4:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 6:12 [PATCH v2 0/3] Add memmap and fix bugs for LoongArch Xiaojuan Yang
2022-09-27 6:12 ` [PATCH v2 1/3] hw/loongarch: Add memmap for LoongArch virt machine Xiaojuan Yang
2022-09-29 2:25 ` Richard Henderson
2022-09-27 6:12 ` [PATCH v2 2/3] hw/intc: Fix LoongArch extioi function Xiaojuan Yang
2022-09-29 2:38 ` Richard Henderson
2022-09-27 6:12 ` [PATCH v2 3/3] hw/intc: Fix LoongArch ipi device emulation Xiaojuan Yang
2022-09-29 2:42 ` Richard Henderson
2022-09-29 3:23 ` yangxiaojuan
2022-09-29 4:12 ` Richard Henderson [this message]
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=5db38749-bb80-6b51-1959-b6e6216376c2@linaro.org \
--to=richard.henderson@linaro.org \
--cc=f4bug@amsat.org \
--cc=gaosong@loongson.cn \
--cc=maobibo@loongson.cn \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--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).