[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 12/24] hw: acpi: Export the MCFG getter
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [PATCH v5 12/24] hw: acpi: Export the MCFG getter |
Date: |
Tue, 27 Nov 2018 14:54:15 +0100 |
On Thu, 22 Nov 2018 00:21:06 +0100
Samuel Ortiz <address@hidden> wrote:
> Hi Igor,
>
> On Thu, Nov 15, 2018 at 01:36:58PM +0100, Igor Mammedov wrote:
> > On Mon, 5 Nov 2018 02:40:35 +0100
> > Samuel Ortiz <address@hidden> wrote:
> >
> > > From: Yang Zhong <address@hidden>
> > >
> > > The ACPI MCFG getter is not x86 specific and could be called from
> > > anywhere within generic ACPI API, so let's export it.
> > So far it's x86 or more exactly q35 specific thing,
> It's property based, and it's using a generic PCIE property afaict.
> So it's up to each machine type to define those properties.
> I'm curious here: What's the idiomatic way to define a machine
> setting/attribute/property, let each instance define it or not, and
> make it available at run time?
> Would you be getting the PCI host pointer from the ACPI build state and
> getting that information back from there?
Cleaner way would be make arm/virt board set PCIE_HOST_MCFG_BASE/
PCIE_HOST_MCFG_SIZE properties and then use common build_mcfg()(in aml-build.c).
Something like this:
acpi_setup_reduced()
AcpiMcfgInfo mcfg_info = {
.base = object_property_get_uint(pcie, PCIE_HOST_MCFG_BASE, NULL),
.size = object_property_get_uint(pcie, PCIE_HOST_MCFG_SIZE, NULL)
};
acpi_build() {
build_mcfg("MCFG", &info);
}
}
and for legacy q35
acpi_build() {
if (pcie) {
AcpiMcfgInfo mcfg_info = {
.base = object_property_get_uint(pcie, PCIE_HOST_MCFG_BASE, NULL),
.size = object_property_get_uint(pcie, PCIE_HOST_MCFG_SIZE, NULL)
};
if (mcfg_info.base != PCIE_BASE_ADDR_UNMAPPED)
build_mcfg("MCFG", &info);
else
/* move comment here why we are doing it */
build_mcfg("QEMU", &info);
}
}
The thing I don't like about acpi_get_mcfg() is that it
does lookup acpi_get_i386_pci_host() each time it's called
and judges if it's PCI-E host by presence of properties.
I'd rather be explicit where PCI host be fetched once somewhere
in acpi_setup() or possibly passed down from the board as an argument
and board telling to i386/acpi_setup() if it's PCI or PCI-E host
so we don't have to guess it in acpi code.
> Cheers,
> Samuel.
[Qemu-devel] [PATCH v5 14/24] hw: i386: Make the hotpluggable memory size property more generic, Samuel Ortiz, 2018/11/04
[Qemu-devel] [PATCH v5 15/24] hw: i386: Export the i386 ACPI SRAT build method, Samuel Ortiz, 2018/11/04