Re: [Xen-devel] [Qemu-devel] [PATCH v5 05/24] hw: acpi: Implement XSDT support for RSDP

2018-11-23 Thread Samuel Ortiz
On Thu, Nov 22, 2018 at 05:26:52PM +0100, Igor Mammedov wrote: > On Wed, 21 Nov 2018 15:42:11 +0100 > Samuel Ortiz wrote: > > > Hi Igor, > > > > On Thu, Nov 08, 2018 at 03:16:23PM +0100, Igor Mammedov wrote: > > > On Mon, 5 Nov 2018 02:4

Re: [Xen-devel] [Qemu-devel] [PATCH v5 00/24] ACPI reorganization for hardware-reduced API addition

2018-11-21 Thread Samuel Ortiz
On Wed, Nov 21, 2018 at 03:15:26PM +0100, Igor Mammedov wrote: > On Wed, 21 Nov 2018 07:35:47 -0500 > "Michael S. Tsirkin" wrote: > > > On Mon, Nov 19, 2018 at 04:31:10PM +0100, Igor Mammedov wrote: > > > On Fri, 16 Nov 2018 17:37:54 +0100 > > > Paolo Bonzini wrote: > > > > > > > On 16/11/18

Re: [Xen-devel] [Qemu-devel] [PATCH v5 20/24] hw: acpi: Define ACPI tables builder interface

2018-11-21 Thread Samuel Ortiz
On Fri, Nov 16, 2018 at 05:02:26PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:43 +0100 > Samuel Ortiz wrote: > > > In order to decouple ACPI APIs from specific machine types, we are > > creating an ACPI builder interface that each ACPI platform can choose to &g

Re: [Xen-devel] [Qemu-devel] [PATCH v5 15/24] hw: i386: Export the i386 ACPI SRAT build method

2018-11-21 Thread Samuel Ortiz
On Thu, Nov 15, 2018 at 02:28:54PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:38 +0100 > Samuel Ortiz wrote: > > > This is the standard way of building SRAT on x86 platfoms. But future > > machine types could decide to define their own custom SRAT build method

Re: [Xen-devel] [Qemu-devel] [PATCH v5 12/24] hw: acpi: Export the MCFG getter

2018-11-21 Thread Samuel Ortiz
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 wrote: > > > From: Yang Zhong > > > > The ACPI MCFG getter is not x86 specific and could be called from > > anywhere within generic A

Re: [Xen-devel] [Qemu-devel] [PATCH v5 11/24] hw: acpi: Export and generalize the PCI host AML API

2018-11-21 Thread Samuel Ortiz
Hi Igor, On Wed, Nov 14, 2018 at 11:55:37AM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:34 +0100 > Samuel Ortiz wrote: > > > From: Yang Zhong > > > > The AML build routines for the PCI host bridge and the corresponding > > DSDT addition are neither

Re: [Xen-devel] [Qemu-devel] [PATCH v5 10/24] hw: acpi: Export the PCI host and holes getters

2018-11-21 Thread Samuel Ortiz
On Tue, Nov 13, 2018 at 04:59:18PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:33 +0100 > Samuel Ortiz wrote: > > > This is going to be needed by the hardware reduced implementation, so > > let's export it. > > Once the ACPI builder methods and

Re: [Xen-devel] [Qemu-devel] [PATCH v5 07/24] hw: acpi: Generalize AML build routines

2018-11-21 Thread Samuel Ortiz
Hi Igor, On Fri, Nov 09, 2018 at 02:37:33PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:30 +0100 > Samuel Ortiz wrote: > > > From: Yang Zhong > > > > Most of the AML build routines under acpi-build are not even > > architecture specific. They ca

Re: [Xen-devel] [Qemu-devel] [PATCH v5 01/24] hw: i386: Decouple the ACPI build from the PC machine type

2018-11-21 Thread Samuel Ortiz
Hi Igor, On Fri, Nov 09, 2018 at 03:23:16PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:24 +0100 > Samuel Ortiz wrote: > > > ACPI tables are platform and machine type and even architecture > > agnostic, and as such we want to provide an internal ACPI API tha

Re: [Xen-devel] [PATCH v5 02/24] hw: acpi: Export ACPI build alignment API

2018-11-21 Thread Samuel Ortiz
On Fri, Nov 09, 2018 at 03:27:16PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:25 +0100 > Samuel Ortiz wrote: > > > This is going to be needed by the Hardware-reduced ACPI routines. > > > > Reviewed-by: Philippe Mathieu-Daudé > > Tested-by: Philippe

Re: [Xen-devel] [Qemu-devel] [PATCH v5 05/24] hw: acpi: Implement XSDT support for RSDP

2018-11-21 Thread Samuel Ortiz
Hi Igor, On Thu, Nov 08, 2018 at 03:16:23PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:28 +0100 > Samuel Ortiz wrote: > > > XSDT is the 64-bit version of the legacy ACPI RSDT (Root System > > Description Table). RSDT only allow for 32-bit addressses a

Re: [Xen-devel] [Qemu-devel] [PATCH v5 00/24] ACPI reorganization for hardware-reduced API addition

2018-11-21 Thread Samuel Ortiz
Igor, On Wed, Nov 21, 2018 at 03:15:26PM +0100, Igor Mammedov wrote: > On Wed, 21 Nov 2018 07:35:47 -0500 > "Michael S. Tsirkin" wrote: > > > On Mon, Nov 19, 2018 at 04:31:10PM +0100, Igor Mammedov wrote: > > > On Fri, 16 Nov 2018 17:37:54 +0100 > > > Paolo Bonzini wrote: > > > > > > > On 16

Re: [Xen-devel] [Qemu-devel] [PATCH v5 00/24] ACPI reorganization for hardware-reduced API addition

2018-11-21 Thread Samuel Ortiz
Hi Michael, On Wed, Nov 21, 2018 at 07:35:47AM -0500, Michael S. Tsirkin wrote: > On Mon, Nov 19, 2018 at 04:31:10PM +0100, Igor Mammedov wrote: > > On Fri, 16 Nov 2018 17:37:54 +0100 > > Paolo Bonzini wrote: > > > > > On 16/11/18 17:29, Igor Mammedov wrote: > > > > General suggestions for this

Re: [Xen-devel] [PATCH v5 05/24] hw: acpi: Implement XSDT support for RSDP

2018-11-08 Thread Samuel Ortiz
Hi Igor, On Thu, Nov 08, 2018 at 03:16:23PM +0100, Igor Mammedov wrote: > On Mon, 5 Nov 2018 02:40:28 +0100 > Samuel Ortiz wrote: > > > XSDT is the 64-bit version of the legacy ACPI RSDT (Root System > > Description Table). RSDT only allow for 32-bit addressses a

Re: [Xen-devel] [PATCH v5 03/24] hw: acpi: The RSDP build API can return void

2018-11-06 Thread Samuel Ortiz
On Tue, Nov 06, 2018 at 11:23:39AM +0100, Paolo Bonzini wrote: > On 05/11/2018 02:40, Samuel Ortiz wrote: > > /* RSDP */ > > -static GArray * > > +static void > > build_rsdp(GArray *rsdp_table, BIOSLinker *linker, unsigned > > xsdt_tbl_offset) > &g

[Xen-devel] [PATCH v5 23/24] hw: i386: Set ACPI configuration PCI host pointer

2018-11-04 Thread Samuel Ortiz
For both PC and Q35 machine types, we can set it at the PCI host bridge creation time. Signed-off-by: Samuel Ortiz --- hw/i386/pc_piix.c | 1 + hw/i386/pc_q35.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index f5b139a3eb..f1f0de3585 100644 --- a

[Xen-devel] [PATCH v5 19/24] hw: acpi: Retrieve the PCI bus from AcpiPciHpState

2018-11-04 Thread Samuel Ortiz
From: Sebastien Boeuf Instead of using the machine type specific method find_i440fx() to retrieve the PCI bus, this commit aims to rely on the fact that the PCI bus is known by the structure AcpiPciHpState. When the structure is initialized through acpi_pcihp_init() call, it saves the PCI bus, w

[Xen-devel] [PATCH v5 22/24] hw: pci-host: piix: Return PCI host pointer instead of PCI bus

2018-11-04 Thread Samuel Ortiz
For building the MCFG table, we need to track a given machine type PCI host pointer, and we can't get it from the bus pointer alone. As piix returns a PCI bus pointer, we simply modify its builder to return a PCI host pointer instead. Signed-off-by: Samuel Ortiz --- include/hw/i386/pc.h

[Xen-devel] [PATCH v5 20/24] hw: acpi: Define ACPI tables builder interface

2018-11-04 Thread Samuel Ortiz
the existing implementation only to add small variations to it. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Ortiz --- include/hw/acpi/builder.h | 100 ++ hw/acpi/builder.c | 97

[Xen-devel] [PATCH v5 15/24] hw: i386: Export the i386 ACPI SRAT build method

2018-11-04 Thread Samuel Ortiz
build method. Signed-off-by: Samuel Ortiz --- hw/i386/acpi-build.h | 5 + hw/i386/acpi-build.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/i386/acpi-build.h b/hw/i386/acpi-build.h index 065a1d8250..d73c41fe8f 100644 --- a/hw/i386/acpi-build.h +++ b/hw/i386/acpi

[Xen-devel] [PATCH v5 16/24] hw: acpi: Fix memory hotplug AML generation error

2018-11-04 Thread Samuel Ortiz
From: Yang Zhong When using the generated memory hotplug AML, the iasl compiler would give the following error: dsdt.dsl 266: Return (MOST (_UID, Arg0, Arg1, Arg2)) Error 6080 - Called method returns no value ^ Signed-off-by: Yang Zhong --- hw/acpi/memory_hotplug.c | 10 +- 1 file cha

[Xen-devel] [PATCH v5 21/24] hw: i386: Implement the ACPI builder interface for PC

2018-11-04 Thread Samuel Ortiz
: Philippe Mathieu-Daudé Signed-off-by: Samuel Ortiz --- hw/i386/acpi-build.c | 14 +- hw/i386/pc.c | 19 +++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 4b1d8fbe3f..93d89b96f1 100644 --- a/hw/i386

[Xen-devel] [PATCH v5 17/24] hw: acpi: Export the PCI hotplug API

2018-11-04 Thread Samuel Ortiz
From: Sebastien Boeuf The ACPI hotplug support for PCI devices APIs are not x86 or even machine type specific. In order for future machine types to be able to re-use that code, we export it through the architecture agnostic hw/acpi folder. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe

[Xen-devel] [PATCH v5 24/24] hw: i386: Refactor PCI host getter

2018-11-04 Thread Samuel Ortiz
From: Yang Zhong Now that the ACPI builder methods are added, we can reach the ACPI configuration pointer from the MachineState pointer. From there we can get to the PCI host pointer and return it. This makes the PCI host getter an ACPI, architecture agnostic function. Signed-off-by: Yang Zhong

[Xen-devel] [PATCH v5 18/24] hw: i386: Export the MADT build method

2018-11-04 Thread Samuel Ortiz
-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Ortiz --- include/hw/i386/acpi.h | 28 hw/arm/virt-acpi-build.c | 4 ++-- hw/i386/acpi-build.c | 4 ++-- 3 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 include/hw/i386

[Xen-devel] [PATCH v5 14/24] hw: i386: Make the hotpluggable memory size property more generic

2018-11-04 Thread Samuel Ortiz
This property is currently defined under i386/pc while it only describes a region size that's eventually fetched from the AML ACPI code. We can make it more generic and shareable across machine types by moving it to memory-device.h instead. Signed-off-by: Samuel Ortiz --- include/hw/i386

[Xen-devel] [PATCH v5 08/24] hw: acpi: Factorize _OSC AML across architectures

2018-11-04 Thread Samuel Ortiz
From: Yang Zhong The _OSC AML table is almost identical between the i386 Q35 and arm virt machine types. We can make it slightly more generic and share it across all PCIe architectures. Signed-off-by: Yang Zhong --- include/hw/acpi/acpi-defs.h | 14 +++ include/hw/acpi/aml-build.h | 2 +-

[Xen-devel] [PATCH v5 09/24] hw: i386: Move PCI host definitions to pci_host.h

2018-11-04 Thread Samuel Ortiz
The PCI hole properties are not pc or i386 specific. They belong to the PCI host header instead. Signed-off-by: Samuel Ortiz --- include/hw/i386/pc.h | 5 - include/hw/pci/pci_host.h | 6 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/hw/i386/pc.h b

[Xen-devel] [PATCH v5 12/24] hw: acpi: Export the MCFG getter

2018-11-04 Thread Samuel Ortiz
From: Yang Zhong The ACPI MCFG getter is not x86 specific and could be called from anywhere within generic ACPI API, so let's export it. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Yang Zhong --- include/hw/acpi/aml-build.h | 1 + hw/acpi/aml-build.c

[Xen-devel] [PATCH v5 06/24] hw: acpi: Factorize the RSDP build API implementation

2018-11-04 Thread Samuel Ortiz
We can now share the RSDP build between the ARM and x86 architectures. Here we make the default RSDP build use XSDT and keep the existing x86 ACPI build implementation using the legacy RSDT version. Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 8 hw/acpi/aml-build.c

[Xen-devel] [PATCH v5 07/24] hw: acpi: Generalize AML build routines

2018-11-04 Thread Samuel Ortiz
From: Yang Zhong Most of the AML build routines under acpi-build are not even architecture specific. They can be moved to the more generic hw/acpi folder where they could be shared across machine types and architectures. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Sig

[Xen-devel] [PATCH v5 13/24] hw: acpi: Do not create hotplug method when handler is not defined

2018-11-04 Thread Samuel Ortiz
name is not NULL. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Ortiz --- hw/acpi/cpu.c| 8 +--- hw/acpi/memory_hotplug.c | 11 +++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c

[Xen-devel] [PATCH v5 05/24] hw: acpi: Implement XSDT support for RSDP

2018-11-04 Thread Samuel Ortiz
version 2.0, RSDPs should add an extended checksum, a complete table length and a version field to the table. Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 3 +++ hw/acpi/aml-build.c | 37 + 2 files changed, 40 insertions(+) diff --git a

[Xen-devel] [PATCH v5 01/24] hw: i386: Decouple the ACPI build from the PC machine type

2018-11-04 Thread Samuel Ortiz
apic_xrupt_override unsigned apic_id_limit uint64_t numa_nodes uint64_t numa_mem Signed-off-by: Samuel Ortiz --- hw/i386/acpi-build.h | 4 +- include/hw/acpi/acpi.h | 44 ++ include/hw/i386/pc.h | 19 ++--- hw/acpi/cpu_hotplug.c| 9 +- hw/arm/virt-acpi-build.c | 10 --- hw

[Xen-devel] [PATCH v5 11/24] hw: acpi: Export and generalize the PCI host AML API

2018-11-04 Thread Samuel Ortiz
make them PC machine type independent. Signed-off-by: Yang Zhong Signed-off-by: Rob Bradford Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 8 ++ hw/acpi/aml-build.c | 157 hw/i386/acpi-build.c| 115

[Xen-devel] [PATCH v5 10/24] hw: acpi: Export the PCI host and holes getters

2018-11-04 Thread Samuel Ortiz
This is going to be needed by the hardware reduced implementation, so let's export it. Once the ACPI builder methods and getters will be implemented, the acpi_get_pci_host() implementation will become hardware agnostic. Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 2 +

[Xen-devel] [PATCH v5 04/24] hw: acpi: Export the RSDP build API

2018-11-04 Thread Samuel Ortiz
The hardware-reduced API will need to build RSDP as well, so we should export this routine. Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 3 +++ hw/arm/virt-acpi-build.c| 2 +- hw/i386/acpi-build.c| 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a

[Xen-devel] [PATCH v5 02/24] hw: acpi: Export ACPI build alignment API

2018-11-04 Thread Samuel Ortiz
This is going to be needed by the Hardware-reduced ACPI routines. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Samuel Ortiz --- include/hw/acpi/aml-build.h | 2 ++ hw/acpi/aml-build.c | 8 hw/i386/acpi-build.c| 8 3

[Xen-devel] [PATCH v5 00/24] ACPI reorganization for hardware-reduced API addition

2018-11-04 Thread Samuel Ortiz
P export and XSDT implementation into 3 patches. * Fix the hw/i386/acpi header inclusions. Samuel Ortiz (16): hw: i386: Decouple the ACPI build from the PC machine type hw: acpi: Export ACPI build alignment API hw: acpi: The RSDP build API can return void hw: acpi: Export the RSDP bui

[Xen-devel] [PATCH v5 03/24] hw: acpi: The RSDP build API can return void

2018-11-04 Thread Samuel Ortiz
For both x86 and ARM architectures, the internal RSDP build API can return void as the current return value is unused. Signed-off-by: Samuel Ortiz --- hw/arm/virt-acpi-build.c | 4 +--- hw/i386/acpi-build.c | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt

[Xen-devel] [PATCH v4 01/23] hw: i386: Decouple the ACPI build from the PC machine type

2018-11-01 Thread Samuel Ortiz
apic_xrupt_override unsigned apic_id_limit uint64_t numa_nodes uint64_t numa_mem Signed-off-by: Samuel Ortiz --- hw/acpi/cpu_hotplug.c| 9 +- hw/arm/virt-acpi-build.c | 10 --- hw/i386/acpi-build.c | 136 ++ hw/i386/acpi-build.h | 4 +- hw/i386/pc.c

[Xen-devel] [PATCH v3 01/19] hw: i386: Decouple the ACPI build from the PC machine type

2018-10-29 Thread Samuel Ortiz
apic_xrupt_override unsigned apic_id_limit uint64_t numa_nodes uint64_t numa_mem Signed-off-by: Samuel Ortiz --- hw/acpi/cpu_hotplug.c| 9 +- hw/arm/virt-acpi-build.c | 10 --- hw/i386/acpi-build.c | 135 ++ hw/i386/acpi-build.h | 4 +- hw/i386/pc.c