From: Paolo Bonzini <pbonzini@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Peter Xu" <peterx@redhat.com>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philippe.mathieu-daude@linaro.org>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: Re: should ioapic_service really be modelling cpu writes?
Date: Fri, 11 Nov 2022 16:57:07 +0100 [thread overview]
Message-ID: <CABgObfZ0Kd+BRyqi0tnYoafevtkOAaWU6d6jJ-DJJoqHF9tooA@mail.gmail.com> (raw)
In-Reply-To: <87iljld1vh.fsf@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
Il ven 11 nov 2022, 15:03 Alex Bennée <alex.bennee@linaro.org> ha scritto:
>
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
> > On 11/11/22 13:26, Alex Bennée wrote:
> >> if (addr > 0xfff || !index) {
> >> switch (attrs.requester_type) {
> >> }
> >> MSIMessage msi = { .address = addr, .data = val };
> >> apic_send_msi(&msi);
> >> return MEMTX_OK;
> >> }
> >
> >
> >> which at least gets things booting properly. Does this seem like a
> >> better modelling of the APIC behaviour?
> >
> > Yes and you don't even need the "if", just do MTRT_CPU vs everything
> > else.
>
> Can the CPU trigger MSIs by writing to this area of memory?
No, it's a different bus. If it can in QEMU that's a bug.
I went for
> the explicit switch for clarity but are you saying:
>
> if (attrs.requester_type != MTRT_CPU) {
> MSIMessage msi = { .address = addr, .data = val };
> apic_send_msi(&msi);
> return MEMTX_OK;
> } else {
> return MEMTX_ACESSS_ERROR;
> }
>
> for the MSI range?
>
Yes that would work. It can be tightened even further by removing the "if
(addr ...)" completely and only checking the requester type (which in turn
I would do with a function like "return APIC based on txattrs requester
type and id, or return NULL if requester not MTRT_CPU"), but no need to
hurry.
Thanks,
Paolo
>
> >
> > Paolo
>
>
> --
> Alex Bennée
>
>
[-- Attachment #2: Type: text/html, Size: 2730 bytes --]
prev parent reply other threads:[~2022-11-11 15:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 17:01 should ioapic_service really be modelling cpu writes? Alex Bennée
2022-11-10 17:55 ` Alex Bennée
2022-11-10 22:42 ` Peter Xu
2022-11-11 11:08 ` Paolo Bonzini
2022-11-11 12:26 ` Alex Bennée
2022-11-11 13:14 ` Paolo Bonzini
2022-11-11 14:00 ` Alex Bennée
2022-11-11 15:57 ` Paolo Bonzini [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=CABgObfZ0Kd+BRyqi0tnYoafevtkOAaWU6d6jJ-DJJoqHF9tooA@mail.gmail.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=mst@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philippe.mathieu-daude@linaro.org \
--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).