From: Jason Baron <jbaron@redhat.com>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: agraf@suse.de, juzhang@redhat.com,
"Michael S. Tsirkin" <mst@redhat.com>,
jan.kiszka@siemens.com, armbru@redhat.com, qemu-devel@nongnu.org,
blauwirbel@gmail.com, yamahata@valinux.co.jp,
alex.williamson@redhat.com, kevin@koconnor.net, avi@redhat.com,
mkletzan@redhat.com, pbonzini@redhat.com, lcapitulino@redhat.com,
afaerber@suse.de, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v1 00/13] q35 patches for pci tree
Date: Wed, 31 Oct 2012 10:42:38 -0400 [thread overview]
Message-ID: <20121031144238.GA1781@redhat.com> (raw)
In-Reply-To: <87mwz24x8u.fsf@codemonkey.ws>
On Wed, Oct 31, 2012 at 07:55:13AM -0500, Anthony Liguori wrote:
> "Michael S. Tsirkin" <mst@redhat.com> writes:
>
> > On Tue, Oct 30, 2012 at 02:20:35PM -0500, Anthony Liguori wrote:
> >> Jason Baron <jbaron@redhat.com> writes:
> >>
> >> > Hi,
> >> >
> >> > Re-base of my previous q35 patches on top of Michael Tsirkin's pci
> >> > tree.
> >>
> >> I don't want this to come in through the pci tree.
> >
> > OK so you want to merge directly?
>
> Yes.
>
> >
> >> This is not just
> >> another PCI device and the ramifications are pretty big since this will
> >> become the main machine model.
> >
> > OTOH it's not going to be the main machine model in 1.3 so maybe they
> > are not that big, yet.
>
> I think it's important to avoid introducing a lot of unmodelled code
> regardless of whether it's the main machine model or not.
>
> There's plenty of time to fix it for 1.3 though so it shouldn't be a big deal.
>
> Regards,
>
> Anthony Liguori
>
> >
I was looking at some of past pc refactoring patches, and they are
fairly involved:
Subject: [Qemu-devel] [PATCH 0/6] refactor PC machine, i440fx and piix3 to take advantage of QOM
http://lists.gnu.org/archive/html/qemu-devel/2012-03/msg04711.html
I'm not sure that level of modeling/refactoring can be safely be done in
1.3. I'm hoping you had something less invasive in mind.
It might be helpful to look at the core 'q35' data structures:
'Northbridge':
q35.h:
typedef struct GMCHPCIHost {
PCIExpressHost host;
PCIDevice *dev; //points to the GMCHPCIState
} GMCHPCIHost;
q35.h:
typedef struct GMCHPCIState {
PCIDevice d;
/*
* GMCH_PCIHost *gmch_host;
* In order to get GMCH_PCIHost
* PCIDevice -> qdev -> parent_bus -> qdev -upcast-> GMCH_PCIHost
*/
MemoryRegion *ram_memory;
MemoryRegion *pci_address_space;
MemoryRegion *system_memory;
PAMMemoryRegion pam_regions[13];
MemoryRegion smram_region;
MemoryRegion pci_hole;
MemoryRegion pci_hole_64bit;
uint8_t smm_enabled;
} GMCHPCIState;
So the memory controller is really the GMCHPCIState structure. We could
create a generic 'MemoryController' class and embed it in GMCHPCIState,
and then embed GMCHPCIState into GMCHPCIHost. Adding the PAM routines
to the 'MemoryController'.
Then when we initialize GMCHPCIHost, we can also initialize GMCHPCIState
and the 'MemoryController'. Next, set the user passed parameters and then
finishing initializing all 3 structures?
'SouthBride':
ich9.h:
typedef struct ICH9LPCState {
/* ICH9 LPC PCI to ISA bridge */
PCIDevice d;
/* (pci device, intx) -> pirq
* In real chipset case, the unused slots are never used
* as ICH9 supports only D25-D32 irq routing.
* On the other hand in qemu case, any slot/function can be
* populated
* via command line option.
* So fallback interrupt routing for any devices in any slots is
* necessary.
*/
uint8_t irr[PCI_SLOT_MAX][PCI_NUM_PINS];
APMState apm;
ICH9LPCPMRegs pm;
uint32_t sci_level; /* track sci level */
/* 10.1 Chipset Configuration registers(Memory Space)
which is pointed by RCBA */
uint8_t chip_config[ICH9_CC_SIZE];
/* isa bus */
ISABus *isa_bus;
MemoryRegion rbca_mem;
qemu_irq *pic;
qemu_irq *ioapic;
} ICH9LPCState;
hw/smbus_ich9.c:
typedef struct ICH9SMBState {
PCIDevice dev;
PMSMBus smb;
MemoryRegion mem_bar;
} ICH9SMBState;
hw/ide/ahci.h:
typedef struct AHCIPCIState {
PCIDevice card;
AHCIState ahci;
} AHCIPCIState;
Here too, we probably could create a generic 'ICH9' device and embed the
LPC, SMB, and ahci controller in it. Initialize all the devices, set
the desired parameters, and finalize their creation.
That would still be a lot of code churn. Maybe you can be more specific
about what you're looking for?
Also, will this include refactoring i440fx/piix3?
Thanks,
-Jason
prev parent reply other threads:[~2012-10-31 15:22 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-30 2:11 [Qemu-devel] [PATCH v1 00/13] q35 patches for pci tree Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 01/13] pc/piix_pci: factor out smram/pam logic Jason Baron
2012-10-30 19:07 ` Anthony Liguori
2012-10-30 20:26 ` Andreas Färber
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 03/13] blockdev: Introduce QEMUMachine->default_drive_if Jason Baron
2012-10-30 19:08 ` Anthony Liguori
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 02/13] Back out add of i21154 Jason Baron
2012-10-31 9:54 ` Michael S. Tsirkin
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 04/13] blockdev: Introduce IF_AHCI Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 06/13] pc: Move ioapic_init() from pc_piix.c to pc.c Jason Baron
2012-10-31 10:02 ` Michael S. Tsirkin
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 05/13] pc, pc_piix: split out pc nic initialization Jason Baron
2012-10-30 19:09 ` Anthony Liguori
2012-10-31 9:57 ` Michael S. Tsirkin
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 07/13] q35: Introduce q35 pc based chipset emulator Jason Baron
2012-10-30 19:18 ` Anthony Liguori
2012-10-31 10:04 ` Michael S. Tsirkin
2012-10-31 12:53 ` Anthony Liguori
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 09/13] q35: Add kvmclock support Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 08/13] q35: Suppress SMM BIOS initialization under KVM Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 10/13] Add a fallback bios file search, if -L fails Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 11/13] q35: automatically load the q35 dsdt table Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 12/13] q35: fill in usb pci slots with -usb Jason Baron
2012-10-30 6:34 ` Gerd Hoffmann
2012-10-30 15:19 ` Jason Baron
2012-10-30 16:19 ` Gerd Hoffmann
2012-10-30 18:00 ` Jason Baron
2012-10-30 2:11 ` [Qemu-devel] [PATCH v1 13/13] Fixup q35/ich9 Licenses Jason Baron
2012-10-31 8:59 ` Michael S. Tsirkin
2012-10-31 9:34 ` Isaku Yamahata
2012-10-31 9:57 ` Michael S. Tsirkin
2012-10-30 19:20 ` [Qemu-devel] [PATCH v1 00/13] q35 patches for pci tree Anthony Liguori
2012-10-31 8:42 ` Michael S. Tsirkin
2012-10-31 12:55 ` Anthony Liguori
2012-10-31 14:42 ` Jason Baron [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=20121031144238.GA1781@redhat.com \
--to=jbaron@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=alex.williamson@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=juzhang@redhat.com \
--cc=kevin@koconnor.net \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mkletzan@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=yamahata@valinux.co.jp \
/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).