qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: "Alex Bennée" <alex.bennee@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org, "Joel Stanley" <joel@jms.id.au>,
	qemu-arm@nongnu.org, "Cédric Le Goater" <clg@kaod.org>,
	"David Hildenbrand" <david@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Troy Lee" <leetroy@gmail.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Helge Deller" <deller@gmx.de>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Peter Xu" <peterx@redhat.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Jamin Lin" <jamin_lin@aspeedtech.com>
Subject: Re: [PATCH 0/6] hw: Log unassigned MMIO accesses with unassigned_mem_ops
Date: Mon, 27 Oct 2025 13:26:31 +0000	[thread overview]
Message-ID: <CAFEAcA-hWZei6ytAik5sjFcsYqbKaM6K5mzHepmGQpggAdbQmw@mail.gmail.com> (raw)
In-Reply-To: <87pla8xzd2.fsf@draig.linaro.org>

On Mon, 27 Oct 2025 at 13:12, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> Philippe Mathieu-Daudé <philmd@linaro.org> writes:
>
> > Do not log unassigned MMIO accesses as I/O ones:
> > expose unassigned_mem_ops then use it instead of
> > unassigned_io_ops.
>
> But why? Is it because ioport.c is a x86 io thing?


There is a behaviour difference: unassigned_mem_ops
will fault (because of unassigned_mem_accepts()),
but unassigned_io_ops will be "reads as -1, writes
are ignored". This patch series doesn't mention any
intention of introducing a behaviour difference, so
I suspect this is not intended...

There are a couple of different but related concepts
here that we need to keep straight:

(1) x86 I/O ops, which are different CPU instructions
that talk to a different memory-space than MMIO
accesses. In QEMU we model these as accesses to the
address_space_io AddressSpace. I believe no other
target CPU has an equivalent to this.

(2) PCI "I/O" BARs. PCI devices can have both MMIO
and IO BARs. A PCI controller on x86 maps IO BARs
into the IO space, I think. On non-x86 the IO BARs
typically appear in a different window for MMIO
accesses. Behaviour of PCI I/O accesses to unimplemented
regions is probably defined by the PCI spec somewhere.
Behaviour of PCI accesses to unimplemented MMIO
window areas is I think technically left unspecified
by the PCI standard, but "write ignore/read -1" is
what x86 does and what most software expects, so
hardware that implements something else is making
its life unnecessarily difficult.

I suspect we entangle the PCI IO BAR concept and
implementation a bit more with the x86 I/O ops
implementation than we ideally ought to.

-- PMM


  parent reply	other threads:[~2025-10-27 13:28 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-27 12:36 [PATCH 0/6] hw: Log unassigned MMIO accesses with unassigned_mem_ops Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 1/6] system/memory: Expose unassigned_mem_ops symbol Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 2/6] hw/display/vga: Log unassigned MMIO accesses with unassigned_mem_ops Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 3/6] hw/pci-host/gpex: " Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 4/6] hw/pci-host/aspeed: " Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 5/6] hw/pci-host/astro: " Philippe Mathieu-Daudé
2025-10-27 12:36 ` [PATCH 6/6] hw/sparc64/ebus: " Philippe Mathieu-Daudé
2025-10-27 13:12 ` [PATCH 0/6] hw: " Alex Bennée
2025-10-27 13:21   ` Philippe Mathieu-Daudé
2025-10-27 13:26   ` Peter Maydell [this message]
2025-10-27 13:33     ` Philippe Mathieu-Daudé
2025-10-27 13:47       ` Peter Maydell

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=CAFEAcA-hWZei6ytAik5sjFcsYqbKaM6K5mzHepmGQpggAdbQmw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=andrew@codeconstruct.com.au \
    --cc=atar4qemu@gmail.com \
    --cc=clg@kaod.org \
    --cc=david@redhat.com \
    --cc=deller@gmx.de \
    --cc=jamin_lin@aspeedtech.com \
    --cc=joel@jms.id.au \
    --cc=kraxel@redhat.com \
    --cc=leetroy@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=steven_lee@aspeedtech.com \
    /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).