qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Bernhard Beschow" <shentey@gmail.com>
Subject: [PATCH 0/5] Implement port 92 in south bridges
Date: Sun, 18 Feb 2024 14:16:56 +0100	[thread overview]
Message-ID: <20240218131701.91132-1-shentey@gmail.com> (raw)

This series attempts to make QEMU's south bridge families PIIX, ICH9, and VIA
82xx more self-contained by integrating IO port 92 like the originals do.

In QEMU, the IO port is currently instantiated as a dedicated device in common
PC code. While this works and even results in less code, it seems cleaner to
model the behavior of the real devices. For example, software running on the
Malta machine, which uses PIIX4, needs to take port 92 into account, even if it
doesn't use it (does it?). Moreover, the FDC37M81x used in the original Malta
machine provides a port 92 too, which can be activated. If QEMU implemented the
FDC37M81x more closely, one could check if Yamon (or any alternative boot
loader) deals correctly with these ports.

Moving port 92 into the south bridges might also help with configuration-driven
machine creation. In such a scenario it is probably desirable if machine code
had less of its own idea of which devices it creates. Moving port 92 from
machine code into a potentially user-creaeable device (where it is part of per
datasheet) seems like a good direction. Of course, machine code still wires up
port 92 and I don't have a good idea on how to make this user-configurable.
Such insights might provide some input for discussions around
configuration-driven machine creation.

This series is structured as follows: Patch 1 moves TYPE_PORT92 into the isa
directory to make it reusable by other architectures. It also adds a
configuration switch. Patch 2 integrates TYPE_PORT92 into the PC south bridges
and adapts PC code accordingly. While at it, patch 3 cleans up wiring of the
A20 line with the keyboard controller. Patch 4 simply adds TYPE_PORT92 to the
VIA south bridges which is also needed when using the VIA south bridges in the
pc machine.

Testing done:
* `qemu-system-x86_64 -M {q35,pc},i8042={true,false} ...`
  -> `info mtree` confirms port92 to be present iff i8042=true
* `make check`
* `make check-avocado`
* Start amigaone and pegasos2 machines as described in
    https://patchew.org/QEMU/20240216001019.69A524E601F@zero.eik.bme.hu/
  -> no regressions compared to master

Best regards,
Bernhard

Bernhard Beschow (5):
  hw/isa/meson.build: Sort alphabetically
  hw/i386/port92: Allow for TYPE_PORT92 to be embedded in devices
  hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines
  hw/i386/pc: Inline i8042_setup_a20_line() and remove it
  hw/isa/vt82c686: Embed TYPE_PORT92

 include/hw/i386/pc.h          |  7 +------
 include/hw/input/i8042.h      |  1 -
 include/hw/isa/port92.h       | 30 ++++++++++++++++++++++++++++++
 include/hw/southbridge/ich9.h |  4 ++++
 include/hw/southbridge/piix.h |  3 +++
 hw/i386/pc.c                  | 21 ++++++++++++++-------
 hw/i386/pc_piix.c             |  9 +++++++--
 hw/i386/pc_q35.c              |  8 +++++---
 hw/input/pckbd.c              |  5 -----
 hw/isa/lpc_ich9.c             |  9 +++++++++
 hw/isa/piix.c                 |  9 +++++++++
 hw/{i386 => isa}/port92.c     | 14 +-------------
 hw/isa/vt82c686.c             |  7 +++++++
 hw/i386/Kconfig               |  1 +
 hw/i386/meson.build           |  3 +--
 hw/i386/trace-events          |  4 ----
 hw/isa/Kconfig                |  6 ++++++
 hw/isa/meson.build            |  3 ++-
 hw/isa/trace-events           |  4 ++++
 19 files changed, 104 insertions(+), 44 deletions(-)
 create mode 100644 include/hw/isa/port92.h
 rename hw/{i386 => isa}/port92.c (91%)

-- 
2.43.2



             reply	other threads:[~2024-02-18 13:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-18 13:16 Bernhard Beschow [this message]
2024-02-18 13:16 ` [PATCH 1/5] hw/isa/meson.build: Sort alphabetically Bernhard Beschow
2024-02-20  7:21   ` Philippe Mathieu-Daudé
2024-02-21 11:42   ` Mark Cave-Ayland
2024-02-18 13:16 ` [PATCH 2/5] hw/i386/port92: Allow for TYPE_PORT92 to be embedded in devices Bernhard Beschow
2024-02-21 11:43   ` Mark Cave-Ayland
2024-02-18 13:16 ` [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines Bernhard Beschow
2024-02-21 11:53   ` Mark Cave-Ayland
2024-02-21 12:23     ` BALATON Zoltan
2024-02-27 19:20     ` Bernhard Beschow
2024-02-27 21:54       ` BALATON Zoltan
2024-02-27 23:34         ` Bernhard Beschow
2024-02-28  0:30           ` BALATON Zoltan
2024-02-28 13:02             ` BALATON Zoltan
2024-03-02 12:14               ` Bernhard Beschow
2024-03-02 12:38                 ` BALATON Zoltan
2024-02-18 13:17 ` [PATCH 4/5] hw/i386/pc: Inline i8042_setup_a20_line() and remove it Bernhard Beschow
2024-02-20  7:23   ` Philippe Mathieu-Daudé
2024-02-21 17:37   ` Philippe Mathieu-Daudé
2024-02-18 13:17 ` [PATCH 5/5] hw/isa/vt82c686: Embed TYPE_PORT92 Bernhard Beschow
2024-02-18 16:12 ` [PATCH 0/5] Implement port 92 in south bridges BALATON Zoltan
2024-02-19 22:42   ` Bernhard Beschow
2024-03-12 15:47 ` Michael S. Tsirkin
2024-03-13 10:09   ` Bernhard Beschow

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=20240218131701.91132-1-shentey@gmail.com \
    --to=shentey@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=balaton@eik.bme.hu \
    --cc=eduardo@habkost.net \
    --cc=hpoussin@reactos.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).