From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 00/13] piix_pci cleanup
Date: Fri, 28 Aug 2009 01:15:04 +0200 [thread overview]
Message-ID: <cover.1251414727.git.quintela@redhat.com> (raw)
Hi
v3:
- rebase to today git. Fix conflicts with avi pic/isa cleanup.
v2:
- bit the bullet, change irq_opaque to void *, instead of qemu_irq *
that allows us to pass anything there.
- Rearrange piix_pci to be able to add piix3_dev to the irq_state
- Once rearrangmente is fixed, make sane SaveVM *_load/_save() functions.
We can still load old state, but we only write the sane one.
mips_malta can do a similar cleanup, it is not difficult to do. But I can't
test it.
About irq_state in i440fx_init(). It would have been easier, if there were a
way to create i440FX-pcihost giving it the already allocated variable.
Basically:
pci_bus = pci_register_bus() -> needs irq_state
i440fx = pci_create_simple(pci_bus, ..) -> needs pci_bus
piix3 = pci_create_simple (pci_bus, ...) -> needs pci_bus
irq_state -> needs piix3
We have a nice circular dependency here. to fix it, I just create an empty
irq_state, passed it to pci_register_bus() and fill it later.
It would have been a bit cleaner if there were a finction like
i440fx = pci_create_simple_here(..., &i440fx).
Later, Juan.
v1:
- split piix4 from piix_pci. The only shared code where piix_save/load, i.e.
almost nothing. Once there, compile piix4.o only for mips (it was not used
anywhere else).
- Move global variables to PCII440FXState. Nice and clean until....
- pci_irq_levels: This is great:
* it is saved/loaded from i440fx
* it is cleaned during reset in piix3
* it is used in piix3_set_irq, that don't receive neither i440fx nor
piix state, it needs to be a global variable. (created a global link
until a better solution appear).
I looked where to "hide" pci_irq_levels and piix3_dev (both needed in
piix3_set_irq), and didn't found where to pass them, out of:
- hack i8259 to hide it into PicState2 (that one got passed through the pic)
ugly for words, but will work
- try to add <something> at setup_irq time, but at that point we have:
* opaque -> pci_dev of device that we are working with
* from there we can get to the bus that the device is attached to,
but no way to go from there to the Host bridge (that is what we wanted
in the 1st place)
Later, Juan.
Juan Quintela (13):
piix4 don't use pci_irq_levels at all
Split piix4 support from piix_pci.c
low_set_irq is not used anywhere
Use PCII440FXState instead of generic PCIDevice
Move smm_enabled and isa_memory_mappings to PCII440FXState
We want the argument pass to set_irq to be opaque
Create PIIX3State instead of using PCIDevice for PIIX3
Introduce PIIX3IrqState for piix3 irq's state
Fold piix3_init() intto i440fx_init
We can add piix3_dev now to PIIX3IrqState
Save irq_state into PCII440FXState
pci_irq_levels[] belong to PIIX3State
Update SaveVM versions
Makefile.target | 2 +-
hw/apb_pci.c | 4 +-
hw/grackle_pci.c | 4 +-
hw/gt64xxx.c | 3 +-
hw/pc.c | 5 +-
hw/pc.h | 11 ++-
hw/pci.c | 8 +-
hw/pci.h | 6 +-
hw/piix4.c | 127 +++++++++++++++++++++++++++
hw/piix_pci.c | 246 +++++++++++++++++++++-------------------------------
hw/ppc4xx_pci.c | 4 +-
hw/ppce500_pci.c | 4 +-
hw/prep_pci.c | 4 +-
hw/r2d.c | 4 +-
hw/sh_pci.c | 4 +-
hw/unin_pci.c | 4 +-
hw/versatile_pci.c | 4 +-
17 files changed, 270 insertions(+), 174 deletions(-)
create mode 100644 hw/piix4.c
next reply other threads:[~2009-08-28 0:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-27 23:15 Juan Quintela [this message]
2009-08-27 23:15 ` [Qemu-devel] [PATCH 01/13] piix4 don't use pci_irq_levels at all Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 02/13] Split piix4 support from piix_pci.c Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 03/13] low_set_irq is not used anywhere Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 04/13] Use PCII440FXState instead of generic PCIDevice Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 05/13] Move smm_enabled and isa_memory_mappings to PCII440FXState Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 06/13] We want the argument pass to set_irq to be opaque Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 07/13] Create PIIX3State instead of using PCIDevice for PIIX3 Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 08/13] Introduce PIIX3IrqState for piix3 irq's state Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 09/13] Fold piix3_init() intto i440fx_init Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 10/13] We can add piix3_dev now to PIIX3IrqState Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 11/13] Save irq_state into PCII440FXState Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 12/13] pci_irq_levels[] belong to PIIX3State Juan Quintela
2009-08-27 23:15 ` [Qemu-devel] [PATCH 13/13] Update SaveVM versions Juan Quintela
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=cover.1251414727.git.quintela@redhat.com \
--to=quintela@redhat.com \
--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).