[Qemu-devel] [RFC PATCH v3 03/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM

2015-02-16 Thread Shannon Zhao
information about the machine - GTDT: Generic timer description table - MADT: Multiple APIC description table - DSDT: Holds all information about system devices/peripherals, pointed by FADT Signed-off-by: Shannon Zhao --- hw/arm/Makefile.objs |1 + hw/arm/virt-acpi-build.c

[Qemu-devel] [RFC PATCH v3 02/11] hw/i386/acpi-build: move generic acpi building helpers into dedictated file

2015-02-16 Thread Shannon Zhao
Move generic acpi building helpers into dedictated file and this can be shared with other machines. Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 58 hw/i386/acpi-build.c| 104 +-- hw/i386/acpi-build.h

[Qemu-devel] [RFC PATCH v3 09/11] hw/arm/virt-acpi-build: Generate RSDT table

2015-02-16 Thread Shannon Zhao
RDST points to other tables FADT, MADT, GTDT. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 31 ++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index bee2e7f..245770a 100644 --- a

[Qemu-devel] [RFC PATCH v3 04/11] hw/acpi/aml-build: Add aml_memory32_fixed() and aml_interrupt()

2015-02-16 Thread Shannon Zhao
Add aml_memory32_fixed() for describing device mmio region in resource template. Add aml_interrupt() for describing device interrupt in resource template. These can be used to generating DSDT table for ACPI on ARM. Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 40

[Qemu-devel] [RFC PATCH v3 06/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers

2015-02-16 Thread Shannon Zhao
In the case of mach virt, it is used to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. So ignore FACS and FADT points to DSDT. Update the header definitions for FADT taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` Signed-off-by: Shannon

[Qemu-devel] [RFC PATCH v3 05/11] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices

2015-02-16 Thread Shannon Zhao
Template for the 32-Bit Fixed Memory Range and the Extended Interrupt Descriptors. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 133 ++ 1 files changed, 133 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt

[Qemu-devel] [RFC PATCH v3 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-02-16 Thread Shannon Zhao
branch ASL_API_v3 * use rsdt instead of xsdt according to Igor Mammedov's suggestion changes since v1: * fix bug found by Laszlo * move common helpers into dedictated file and change generating table order according to Igor's comments * fix copyright and function name accor

[Qemu-devel] [RFC PATCH v3 01/11] hw/i386: Move ACPI header definitions in an arch-independent location

2015-02-16 Thread Shannon Zhao
The ACPI related header file acpi-defs.h, includes definitions that apply on other architectures as well. Move it in `include/hw/acpi/` to sanely include it from other architectures. Signed-off-by: Alvise Rigo Signed-off-by: Shannon Zhao --- hw/i386/acpi-build.c|2 +- hw/i386/acpi

[Qemu-devel] [RFC PATCH v3 07/11] hw/arm/virt-acpi-build: Generate MADT table

2015-02-16 Thread Shannon Zhao
MADT describes GIC enabled ARM platforms. The GICC and GICD subtables are used to define the GIC regions. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 62 ++ include/hw/acpi/acpi-defs.h | 36 +- include/hw

[Qemu-devel] [RFC PATCH v3 11/11] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables

2015-02-16 Thread Shannon Zhao
Expose the needed device information to the table generation insfrastructure and register a machine_init_done notify to call virt_acpi_build(). Add CONFIG_ACPI to arm-softmmu.mak. Maybe this way is not right, fix me please. Signed-off-by: Shannon Zhao --- default-configs/arm-softmmu.mak

[Qemu-devel] [RFC PATCH v3 08/11] hw/arm/virt-acpi-build: Generate GTDT table

2015-02-16 Thread Shannon Zhao
ACPI v5.1 defines GTDT for ARM devices as a place to describe timer related information in the system. The Arch Timer interrupts must be provided for GTDT. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 31 +++ include/hw/acpi/acpi-defs.h | 37

[Qemu-devel] [RFC PATCH v3 10/11] hw/arm/virt-acpi-build: Generate RSDP table

2015-02-16 Thread Shannon Zhao
RSDP points to RSDT which in turn points to other tables. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 245770a..bfbddbe

[Qemu-devel] [RFC PATCH 2/7] hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table

2015-02-17 Thread Shannon Zhao
Add GPIO controller in ACPI DSDT table. It can be used for device hotplug. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 21 + hw/arm/virt.c|2 ++ include/hw/arm/virt-acpi-build.h |2 ++ 3 files changed, 25 insertions(+), 0

[Qemu-devel] [RFC PATCH 3/7] hw/acpi/virt-hotplug: Add a hotplug device for machine virt

2015-02-17 Thread Shannon Zhao
Add a hotplug device for machine virt. This can be used for virt to support device hotplug. At the moment this hotplug device just include a mmio region which shows the present status of cpus. Signed-off-by: Shannon Zhao --- default-configs/arm-softmmu.mak |2 + hw/acpi/Makefile.objs

[Qemu-devel] [RFC PATCH 1/7] hw/arm/virt: Add a GPIO controller

2015-02-17 Thread Shannon Zhao
Add a GPIO controller in machine virt, in order to support cpu hotplug. Here we use pl061. Signed-off-by: Shannon Zhao --- hw/arm/virt.c | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8a00574..43c0260

[Qemu-devel] [RFC PATCH 6/7] hw/arm/virt: Add cpu hotplug support

2015-02-17 Thread Shannon Zhao
Add a hotplug device in machine virt and add cpu hotplug support using cpu-add. Signed-off-by: Shannon Zhao --- hw/arm/virt.c | 159 +++- include/hw/acpi/virt-hotplug.h |1 + 2 files changed, 159 insertions(+), 1 deletions(-) diff --git

[Qemu-devel] [RFC PATCH 4/7] topology: Move topology.h to an arch-independent location

2015-02-17 Thread Shannon Zhao
Move topology.h to an arch-independent location and the apicid_foo can be reused by other architectures. And remove the x86 prefix. Signed-off-by: Shannon Zhao --- include/hw/acpi/topology.h | 134 target-i386/cpu.c |4 +- target-i386

[Qemu-devel] [RFC PATCH 5/7] target-arm/cpu: Add apic_id property for ARMCPU

2015-02-17 Thread Shannon Zhao
Add apic_id property for ARMCPU. It can be used for cpu hotplug. Signed-off-by: Shannon Zhao --- target-arm/cpu-qom.h |1 + target-arm/cpu.c | 77 ++ target-arm/cpu.h |2 + 3 files changed, 80 insertions(+), 0 deletions(-) diff

[Qemu-devel] [RFC PATCH 0/7] hw/arm/virt: Add cpu-add way cpu hotplug support

2015-02-17 Thread Shannon Zhao
used by guest now. Any comments are welcome. Thanks, Shannon Shannon Zhao (7): hw/arm/virt: Add a GPIO controller hw/arm/virt-acpi-build: Add GPIO controller in ACPI DSDT table hw/acpi/virt-hotplug: Add a hotplug device for machine virt topology: Move topology.h to an arch-independent loc

[Qemu-devel] [RFC PATCH 7/7] hw/arm/virt-acpi-build: Add cpu hotplug support in ACPI

2015-02-17 Thread Shannon Zhao
Add cpu hotplug support in ACPI. Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 135 hw/acpi/virt-hotplug.c | 11 +++ hw/arm/virt-acpi-build.c | 179 +- hw/arm/virt.c

Re: [Qemu-devel] [RFC PATCH 1/7] hw/arm/virt: Add a GPIO controller

2015-02-25 Thread Shannon Zhao
On 2015/2/19 1:52, Wei Huang wrote: > > > On 02/17/2015 04:10 AM, Shannon Zhao wrote: >> Add a GPIO controller in machine virt, in order to support cpu hotplug. >> Here we use pl061. >> >> Signed-off-by: Shannon Zhao >> --- >> hw/arm/virt.c |

[Qemu-devel] [RFC PATCH 06/11] hw/arm/virt-acpi-build: Generate GTDT table

2015-01-24 Thread Shannon Zhao
ACPI v5.1 defines GTDT for ARM devices as a place to describe timer related information in the system. The Arch Timer interrupts must be provided for GTDT Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 21 + include/hw/acpi/acpi-defs.h | 37

[Qemu-devel] [RFC PATCH 08/11] hw/arm/virt-acpi-build: Generate FACS table and update ACPI headers

2015-01-24 Thread Shannon Zhao
FACS table is created as a mockup, as with the Hardware Reduced bit set it will not be used. Update the header definitions for FACS taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c|4

[Qemu-devel] [RFC PATCH 09/11] hw/acpi/acpi-build-utils: Add acpi_fixed_memory32() and acpi_extended_irq()

2015-01-24 Thread Shannon Zhao
Add acpi_fixed_memory32() for describing device mmio region in resource template. Add acpi_extended_irq() for describing device interrupt in resource template. These can be used to generating DSDT table for ACPI on ARM. Signed-off-by: Shannon Zhao --- hw/acpi/acpi-build-utils.c | 42

[Qemu-devel] [RFC PATCH 10/11] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices

2015-01-24 Thread Shannon Zhao
Template for the 32-Bit Fixed Memory Range and the Extended Interrupt Descriptors. The following devices are included in the DSDT: - CPUs - UART - RTC - NAND Flash - virtio-mmio Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 120 ++ 1 files

[Qemu-devel] [RFC PATCH 11/11] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables

2015-01-24 Thread Shannon Zhao
lease. Signed-off-by: Shannon Zhao --- default-configs/arm-softmmu.mak |1 + default-configs/i386-softmmu.mak |3 ++ default-configs/mips-softmmu.mak |3 ++ default-configs/mips64-softmmu.mak |3 ++ default-configs/mips64el-softmmu.mak |3 ++ default-configs/m

[Qemu-devel] [RFC PATCH 04/11] hw/arm/virt-acpi-build: Generate XSDT table and add a build_header function

2015-01-24 Thread Shannon Zhao
XDST points to other tables except FACS & DSDT. Implement a common header helper functions for generating ACPI tables. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 34 ++ include/hw/acpi/acpi-defs.h |9 + 2 files changed

[Qemu-devel] [RFC PATCH 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-01-24 Thread Shannon Zhao
before, he says that if qemu can expose the generated ACPI tables over fw_cfg, he can quickly add support in UEFI. So just send this out and make it go forward. Todo: 1) add GPIO controller in virt and expose it through ACPI 2) add cpu hotplug support Any comments are welcome. Thanks, Shannon S

[Qemu-devel] [RFC PATCH 01/11] hw/i386: Move ACPI header definitions in an arch-independent location

2015-01-24 Thread Shannon Zhao
The ACPI related header file acpi-defs.h, includes definitions that apply on other architectures as well. Move it in `include/hw/acpi/` to sanely include it from other architectures. Signed-off-by: Alvise Rigo Signed-off-by: Shannon Zhao --- hw/i386/acpi-build.c|2 +- hw/i386/acpi

[Qemu-devel] [RFC PATCH 03/11] hw/arm/virt-acpi-build: Generate RSDP table

2015-01-24 Thread Shannon Zhao
RSDP points to XSDT which in turn points to other tables. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 4eed0a3..9c3971a 100644

[Qemu-devel] [RFC PATCH 05/11] hw/arm/virt-acpi-build: Generate MADT table

2015-01-24 Thread Shannon Zhao
MADT describes GIC enabled ARM platforms. The GICC and GICD subtables are used to define the GIC regions. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 30 ++ include/hw/acpi/acpi-defs.h | 37 - 2 files changed

[Qemu-devel] [RFC PATCH 07/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers

2015-01-24 Thread Shannon Zhao
FADT points to FACS and DSDT, in the case of mach virt, it is also used to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. Update the header definitions for FADT taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` Signed-off-by: Shannon Zhao

[Qemu-devel] [RFC PATCH 02/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables

2015-01-24 Thread Shannon Zhao
- XSDT: Points to all other tables (except FACS & DSDT) - FADT: Generic information about the machine - DSDT: Holds all information about system devices/peripherals - FACS: Needs to be pointed from FADT Signed-off-by: Shannon Zhao --- hw/arm/Makefile.objs |1 + hw/arm/virt-acpi-bui

Re: [Qemu-devel] [RFC PATCH 07/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers

2015-01-25 Thread Shannon Zhao
On 2015/1/25 6:05, Laszlo Ersek wrote: > comments below > > On 01/24/15 10:21, Shannon Zhao wrote: >> FADT points to FACS and DSDT, in the case of mach virt, it is also used >> to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. >> >> Updat

Re: [Qemu-devel] [RFC PATCH 04/11] hw/arm/virt-acpi-build: Generate XSDT table and add a build_header function

2015-01-25 Thread Shannon Zhao
On 2015/1/25 6:04, Laszlo Ersek wrote: > comments below, fix attached > > On 01/24/15 10:21, Shannon Zhao wrote: >> XDST points to other tables except FACS & DSDT. >> Implement a common header helper functions for generating ACPI tables. >> >> Signed-off-by:

Re: [Qemu-devel] [RFC PATCH 09/11] hw/acpi/acpi-build-utils: Add acpi_fixed_memory32() and acpi_extended_irq()

2015-01-25 Thread Shannon Zhao
Hi MST, Thanks for your review :-) Reply below. On 2015/1/25 16:39, Michael S. Tsirkin wrote: > On Sat, Jan 24, 2015 at 05:21:18PM +0800, Shannon Zhao wrote: >> Add acpi_fixed_memory32() for describing device mmio region in resource >> template. >> Add acpi_extended_irq()

Re: [Qemu-devel] [RFC PATCH 11/11] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables

2015-01-25 Thread Shannon Zhao
On 2015/1/25 2:56, Laszlo Ersek wrote: > On 01/24/15 10:21, Shannon Zhao wrote: >> Expose the needed device information to the table generation >> insfrastructure and register a machine_init_done notify to >> call virt_acpi_build(). >> >> Add CONFIG_ACPI to arm-

Re: [Qemu-devel] [RFC PATCH 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-01-25 Thread Shannon Zhao
On 2015/1/25 7:31, Laszlo Ersek wrote: > On 01/24/15 10:21, Shannon Zhao wrote: >> This patch series generate seven ACPI v5.1 tables for machine virt on >> ARM. >> The set of generated tables are: >> - RSDP >> - XSDT >> - MADT >> - GTDT >> - FADT

Re: [Qemu-devel] [RFC PATCH 02/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables

2015-01-25 Thread Shannon Zhao
On 2015/1/25 0:22, Michael S. Tsirkin wrote: > On Sat, Jan 24, 2015 at 05:21:11PM +0800, Shannon Zhao wrote: >> > Introduce a preliminary framework in virt-acpi-build.c with the main >> > ACPI build functions. It exposes the generated ACPI contents to >> > guest ov

Re: [Qemu-devel] [RFC PATCH 02/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables

2015-01-26 Thread Shannon Zhao
On 2015/1/26 18:19, Igor Mammedov wrote: > On Sat, 24 Jan 2015 17:21:11 +0800 > Shannon Zhao wrote: > >> Introduce a preliminary framework in virt-acpi-build.c with the main >> ACPI build functions. It exposes the generated ACPI contents to >> guest over fw_cfg. Some

Re: [Qemu-devel] [RFC PATCH 03/11] hw/arm/virt-acpi-build: Generate RSDP table

2015-01-26 Thread Shannon Zhao
On 2015/1/26 18:22, Igor Mammedov wrote: > On Sat, 24 Jan 2015 17:21:12 +0800 > Shannon Zhao wrote: > >> > RSDP points to XSDT which in turn points to other tables. >> > >> > Signed-off-by: Shannon Zhao >> > --- >> > hw/arm/virt-acpi-build

Re: [Qemu-devel] [RFC PATCH 10/11] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices

2015-01-26 Thread Shannon Zhao
On 2015/1/26 18:40, Igor Mammedov wrote: > On Sat, 24 Jan 2015 17:21:19 +0800 > Shannon Zhao wrote: > >> > DSDT consists of the usual common table header plus a definition >> > block in AML encoding which describes all devices in the platform. >> > >

Re: [Qemu-devel] [RFC PATCH 03/11] hw/arm/virt-acpi-build: Generate RSDP table

2015-01-27 Thread Shannon Zhao
On 2015/1/26 18:22, Igor Mammedov wrote: > On Sat, 24 Jan 2015 17:21:12 +0800 > Shannon Zhao wrote: > >> > RSDP points to XSDT which in turn points to other tables. >> > >> > Signed-off-by: Shannon Zhao >> > --- >> > hw/arm/virt-acpi-build

Re: [Qemu-devel] [RFC PATCH 02/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables

2015-01-27 Thread Shannon Zhao
On 2015/1/27 18:30, Igor Mammedov wrote: > On Tue, 27 Jan 2015 14:47:44 +0800 > Shannon Zhao wrote: > >> On 2015/1/26 18:19, Igor Mammedov wrote: >>> On Sat, 24 Jan 2015 17:21:11 +0800 >>> Shannon Zhao wrote: >>> >>>> Introduce a pr

Re: [Qemu-devel] [PATCH v2 01/47] acpi: introduce AML composer aml_append()

2015-01-28 Thread Shannon Zhao
On 2015/1/28 18:00, Igor Mammedov wrote: > On Wed, 28 Jan 2015 09:56:26 +0200 > "Michael S. Tsirkin" wrote: > >>> I've tried redo series with passing alloc list as first argument, >>> looks ugly as hell >> >> I tried too. Not too bad at all. See below: >> >> diff --git a/hw/i386/acpi-build.c b/hw

Re: [Qemu-devel] [PATCH v2 42/47] acpi: add acpi_def_block() term

2015-01-29 Thread Shannon Zhao
On 2015/1/22 22:50, Igor Mammedov wrote: > Signed-off-by: Igor Mammedov > --- > hw/acpi/acpi-build-utils.c | 47 > ++ > hw/i386/acpi-build.c | 1 - > include/hw/acpi/acpi-build-utils.h | 8 +++ > 3 files changed, 55 insertions(+), 1

[Qemu-devel] [RFC PATCH v2 09/11] hw/arm/virt-acpi-build: Generate XSDT table

2015-01-29 Thread Shannon Zhao
XDST points to other tables except FACS & DSDT. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 32 +++- include/hw/acpi/acpi-defs.h |9 + 2 files changed, 40 insertions(+), 1 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw

[Qemu-devel] [RFC PATCH v2 03/11] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM

2015-01-29 Thread Shannon Zhao
DSDT) - FADT: Generic information about the machine - GTDT: Generic timer description table - MADT: Multiple APIC description table - DSDT: Holds all information about system devices/peripherals, pointed by FADT Signed-off-by: Shannon Zhao --- hw/arm/Makefile.objs |1 + hw/arm/virt-

[Qemu-devel] [RFC PATCH v2 05/11] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices

2015-01-29 Thread Shannon Zhao
Template for the 32-Bit Fixed Memory Range and the Extended Interrupt Descriptors. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 131 ++ 1 files changed, 131 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt

[Qemu-devel] [RFC PATCH v2 02/11] hw/i386/acpi-build: move generic acpi building helpers into dedictated file

2015-01-29 Thread Shannon Zhao
Move generic acpi building helpers into dedictated file and this can be shared with other machines. Signed-off-by: Shannon Zhao --- hw/acpi/acpi-build-utils.c | 63 - hw/i386/acpi-build.c | 111 hw/i386/acpi

[Qemu-devel] [RFC PATCH v2 00/11] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-01-29 Thread Shannon Zhao
common helpers into dedictated file and change generating table order according to Igor's comments * fix copyright and function name according to Michael's comments Shannon Zhao (11): hw/i386: Move ACPI header definitions in an arch-independent location hw/i386/acpi-build: move

[Qemu-devel] [RFC PATCH v2 04/11] hw/acpi/acpi-build-utils: Add acpi_memory32_fixed() and acpi_interrupt()

2015-01-29 Thread Shannon Zhao
Add acpi_memory32_fixed() for describing device mmio region in resource template. Add acpi_interrupt() for describing device interrupt in resource template. These can be used to generating DSDT table for ACPI on ARM. Signed-off-by: Shannon Zhao --- hw/acpi/acpi-build-utils.c | 40

[Qemu-devel] [RFC PATCH v2 01/11] hw/i386: Move ACPI header definitions in an arch-independent location

2015-01-29 Thread Shannon Zhao
The ACPI related header file acpi-defs.h, includes definitions that apply on other architectures as well. Move it in `include/hw/acpi/` to sanely include it from other architectures. Signed-off-by: Alvise Rigo Signed-off-by: Shannon Zhao --- hw/i386/acpi-build.c|2 +- hw/i386/acpi

[Qemu-devel] [RFC PATCH v2 11/11] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables

2015-01-29 Thread Shannon Zhao
lease. Signed-off-by: Shannon Zhao --- default-configs/arm-softmmu.mak |1 + default-configs/i386-softmmu.mak |3 ++ default-configs/mips-softmmu.mak |3 ++ default-configs/mips64-softmmu.mak |3 ++ default-configs/mips64el-softmmu.mak |3 ++ default-configs/m

[Qemu-devel] [RFC PATCH v2 10/11] hw/arm/virt-acpi-build: Generate RSDP table

2015-01-29 Thread Shannon Zhao
RSDP points to XSDT which in turn points to other tables. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 2a2b2ab..c838285

[Qemu-devel] [RFC PATCH v2 07/11] hw/arm/virt-acpi-build: Generate MADT table

2015-01-29 Thread Shannon Zhao
MADT describes GIC enabled ARM platforms. The GICC and GICD subtables are used to define the GIC regions. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 62 ++ include/hw/acpi/acpi-defs.h | 36 +- include/hw

[Qemu-devel] [RFC PATCH v2 06/11] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers

2015-01-29 Thread Shannon Zhao
In the case of mach virt, it is used to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. So ignore FACS and FADT points to DSDT. Update the header definitions for FADT taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h` Signed-off-by: Shannon

[Qemu-devel] [RFC PATCH v2 08/11] hw/arm/virt-acpi-build: Generate GTDT table

2015-01-29 Thread Shannon Zhao
ACPI v5.1 defines GTDT for ARM devices as a place to describe timer related information in the system. The Arch Timer interrupts must be provided for GTDT. Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 31 +++ include/hw/acpi/acpi-defs.h | 37

Re: [Qemu-devel] [PATCH v2 42/47] acpi: add acpi_def_block() term

2015-01-29 Thread Shannon Zhao
On 2015/1/29 16:45, Igor Mammedov wrote: > On Thu, 29 Jan 2015 16:02:47 +0800 > Shannon Zhao wrote: > >> > On 2015/1/22 22:50, Igor Mammedov wrote: >>> > > Signed-off-by: Igor Mammedov >>> > > ---

Re: [Qemu-devel] [RFC PATCH v2 09/11] hw/arm/virt-acpi-build: Generate XSDT table

2015-02-06 Thread Shannon Zhao
On 2015/2/4 0:51, Laszlo Ersek wrote: > On 02/03/15 17:19, Igor Mammedov wrote: >> On Thu, 29 Jan 2015 16:37:11 +0800 >> Shannon Zhao wrote: >> >>> XDST points to other tables except FACS & DSDT. >> Is there any reason to use XSDT instead of RSDT? >&g

Re: [Qemu-devel] [PATCH] hw/net/e1000: fix integer endianness

2015-03-17 Thread Shannon Zhao
On 2015/3/18 1:05, Stefan Hajnoczi wrote: > On Fri, Mar 13, 2015 at 01:21:59PM +0800, Shannon Zhao wrote: >> It's detected by coverity.In is_vlan_packet s->mac_reg[VET] is >> unsigned int but is dereferenced as a narrower unsigned short. >> This may lead to unexpected

[Qemu-devel] [PATCH] hw/arm/virt: Fix corruption due to double free

2015-04-01 Thread Shannon Zhao
From: Shannon Zhao As 4de9a88(hw/arm/virt: Fix memory leak reported by Coverity) and 6e05a12(arm: fix memory leak) both handle the memory leak reported by Coverity, this cause qemu corruption due to double free. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt.c |1

[Qemu-devel] [PATCH v4 04/20] hw/acpi/aml-build: Add aml_memory32_fixed() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add aml_memory32_fixed() for describing device mmio region in resource template. These can be used to generating DSDT table for ACPI on ARM. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 22 ++ include/hw/acpi

[Qemu-devel] [PATCH v4 12/20] hw/arm/virt-acpi-build: Add PCIe info and generate MCFG table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add PCIe info struct, prepare for building PCIe table. And generate MCFG table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 21 + include/hw/arm/virt-acpi-build.h | 12 2 files changed, 33

[Qemu-devel] [PATCH v4 05/20] hw/acpi/aml-build: Add aml_interrupt() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add aml_interrupt() for describing device interrupt in resource template. These can be used to generating DSDT table for ACPI on ARM. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 18 ++ include/hw/acpi/aml

[Qemu-devel] [PATCH v4 16/20] hw/acpi/aml-build: Add aml_else() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 7 +++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 4f936f7..9b8b422 100644 --- a/hw/acpi/aml

[Qemu-devel] [PATCH v4 15/20] hw/acpi/aml-build: Add aml_not() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 9 + include/hw/acpi/aml-build.h | 1 + 2 files changed, 10 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 312afb6..4f936f7 100644 --- a/hw/acpi

[Qemu-devel] [PATCH v4 01/20] hw/i386: Move ACPI header definitions in an arch-independent location

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao The ACPI related header file acpi-defs.h, includes definitions that apply on other architectures as well. Move it in `include/hw/acpi/` to sanely include it from other architectures. Signed-off-by: Alvise Rigo Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw

[Qemu-devel] [PATCH v4 06/20] hw/arm/virt-acpi-build: Generation of DSDT table for virt devices

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao DSDT consists of the usual common table header plus a definition block in AML encoding which describes all devices in the platform. After initializing DSDT with header information the namespace is created which is followed by the device encodings. The devices are described

[Qemu-devel] [PATCH v4 03/20] hw/arm/virt-acpi-build: Basic framework for building ACPI tables on ARM

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Introduce a preliminary framework in virt-acpi-build.c with the main ACPI build functions. It exposes the generated ACPI contents to guest over fw_cfg. The required ACPI v5.1 tables for ARM are: - RSDP: Initial table that points to XSDT - RSDT: Points to FADT GTDT MADT tables

[Qemu-devel] [PATCH v4 20/20] hw/arm/virt: Enable dynamic generation of ACPI v5.1 tables

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Expose the needed device information to the table generation insfrastructure and register a machine_init_done notify to call virt_acpi_build(). Add CONFIG_ACPI to arm-softmmu.mak. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- default-configs/arm-softmmu.mak

[Qemu-devel] [PATCH v4 14/20] hw/acpi/aml-build: Add aml_or() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add aml_or() term and make aml_and can take three args. Expose build_append_int_noprefix as it wiil be used by creating a buffer. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 24 +--- hw/i386/acpi-build.c

[Qemu-devel] [PATCH v4 19/20] hw/arm/virt-acpi-build: Add PCIe controller in ACPI DSDT table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add PCIe controller in ACPI DSDT table, so the guest can detect the PCIe. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 140 +++ 1 file changed, 140 insertions(+) diff --git a/hw/arm/virt

[Qemu-devel] [PATCH v4 13/20] hw/acpi/aml-build: Add ToUUID macro

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Add ToUUID macro, this is useful for generating PCIe ACPI table. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 23 +++ include/hw/acpi/aml-build.h | 2 ++ 2 files changed, 25 insertions(+) diff --git a/hw

[Qemu-devel] [PATCH v4 00/20] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao This patch series generate six ACPI v5.1 tables for machine virt on ARM. The set of generated tables are: - RSDP - RSDT - MADT - GTDT - FADT - DSDT - MCFG (For PCIe host bridge) These tables are created dynamically using the function of aml-build.c, taking into account the

[Qemu-devel] [PATCH v4 02/20] hw/i386/acpi-build: move generic acpi building helpers into dedictated file

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Move generic acpi building helpers into dedictated file and this can be shared with other machines. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 58 ++ hw/i386/acpi-build.c| 77

[Qemu-devel] [PATCH v4 07/20] hw/arm/virt-acpi-build: Generate FADT table and update ACPI headers

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao In the case of mach virt, it is used to set the Hardware Reduced bit and enable PSCI SMP booting through HVC. So ignore FACS and FADT points to DSDT. Update the header definitions for FADT taking into account the new additions of ACPI v5.1 in `include/hw/acpi/acpi-defs.h

[Qemu-devel] [PATCH v4 09/20] hw/arm/virt-acpi-build: Generate GTDT table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao ACPI v5.1 defines GTDT for ARM devices as a place to describe timer related information in the system. The Arch Timer interrupts must be provided for GTDT. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c| 30

[Qemu-devel] [PATCH v4 11/20] hw/arm/virt-acpi-build: Generate RSDP table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao RSDP points to RSDT which in turn points to other tables. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/hw/arm/virt-acpi-build.c b

[Qemu-devel] [PATCH v4 10/20] hw/arm/virt-acpi-build: Generate RSDT table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao RSDT points to other tables FADT, MADT, GTDT. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index

[Qemu-devel] [PATCH v4 18/20] hw/acpi/aml-build: Add aml_dword_io() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 17 + include/hw/acpi/aml-build.h | 5 + 2 files changed, 22 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 221d054..2076ba1 100644

[Qemu-devel] [PATCH v4 08/20] hw/arm/virt-acpi-build: Generate MADT table

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao MADT describes GIC enabled ARM platforms. The GICC and GICD subtables are used to define the GIC regions. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/arm/virt-acpi-build.c | 61 include/hw/acpi/acpi-defs.h

[Qemu-devel] [PATCH v4 17/20] hw/acpi/aml-build: Add aml_create_dword_field() term

2015-04-03 Thread Shannon Zhao
From: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao --- hw/acpi/aml-build.c | 11 +++ include/hw/acpi/aml-build.h | 1 + 2 files changed, 12 insertions(+) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 9b8b422..221d054 100644 --- a/hw

Re: [Qemu-devel] [PATCH v4 00/20] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-04-06 Thread Shannon Zhao
On 2015/4/7 2:47, Mark Salter wrote: > On Fri, 2015-04-03 at 18:03 +0800, Shannon Zhao wrote: >> > From: Shannon Zhao >> > >> > This patch series generate six ACPI v5.1 tables for machine virt on ARM. >> > The set of generated tables are: >>

Re: [Qemu-devel] [PATCH v4 00/20] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-04-07 Thread Shannon Zhao
On 2015/4/7 17:19, Peter Maydell wrote: > On 7 April 2015 at 03:43, Shannon Zhao wrote: >> The dts node is: >> ranges = <0x100 0x0 0x0 0x0 0x3eff 0x0 0x1 >> 0x200 0x0 0x1000 0x0 0x1000 0x0 >> 0x2ef

Re: [Qemu-devel] [PATCH v4 00/20] Generate ACPI v5.1 tables and expose it to guest over fw_cfg on ARM

2015-04-07 Thread Shannon Zhao
On 2015/4/7 20:07, Peter Maydell wrote: > On 7 April 2015 at 03:43, Shannon Zhao wrote: >> The ACPI table entry: >> Method (_CBA, 0, NotSerialized) // _CBA: Configuration Base >> Address >> { >> Return (0x3F00) >&

[Qemu-devel] [RFC PATCH v2] hw/arm/boot: Add support for NUMA on ARM64

2014-12-31 Thread Shannon Zhao
lative distances from Proximity Domain/Numa node i to every other node j in the system (including itself). Signed-off-by: Shannon Zhao --- hw/arm/boot.c | 98 +++-- hw/arm/virt.c |7 +--- 2 files changed, 9

[Qemu-devel] [RFC PATCH v3 3/3] hw/arm/boot: Generate memory dtb according to NUMA topology

2015-01-05 Thread Shannon Zhao
Add a new function arm_generate_memory_dtb which is used to generate memory dtb according to NUMA topology and set the NUMA topology property of every cpu. Signed-off-by: Shannon Zhao --- hw/arm/boot.c | 80 ++-- 1 files changed, 77

[Qemu-devel] [RFC PATCH v3 0/3] Add support for NUMA on ARM64

2015-01-05 Thread Shannon Zhao
; The socket Id(index 1) used first to calculate the associativity, then follows the board id(index 0). arm,associativity-reference-points = <0>; Only the board Id(index 0) used to calculate the associativity. arm,associativity-reference-points = &

[Qemu-devel] [RFC PATCH v3 2/3] hw/arm/virt: Don't add memory node in creat_fdt

2015-01-05 Thread Shannon Zhao
To support memory NUMA, don't add memory node in creat_fdt. But add it in a new function which takes into accout NUMA topology. Signed-off-by: Shannon Zhao --- hw/arm/virt.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index fd

[Qemu-devel] [RFC PATCH v3 1/3] hw/arm/virt: Use memory_region_allocate_system_memory to allocate memory

2015-01-05 Thread Shannon Zhao
Use memory_region_allocate_system_memory to allocate memory. The function is sensitive to NUMA and can allocate memory for NUMA topology. Signed-off-by: Shannon Zhao --- hw/arm/virt.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c

Re: [Qemu-devel] [PATCH] vl.c: fix -usb option assertion failure in qemu_opt_get_bool_helper()

2015-01-05 Thread Shannon Zhao
On 2015/1/6 10:37, Chen, Tiejun wrote: > On 2015/1/5 20:14, Marcel Apfelbaum wrote: >> On 01/05/2015 01:50 PM, Stefan Hajnoczi wrote: >>> On Mon, Jan 5, 2015 at 11:37 AM, Jan Kiszka >>> wrote: On 2015-01-05 12:22, Stefan Hajnoczi wrote: > Commit 49d2e648e8087d154d8bf8b91f27c8e05e79d5a6 ("

Re: [Qemu-devel] [RFC PATCH v3 2/3] hw/arm/virt: Don't add memory node in creat_fdt

2015-01-06 Thread Shannon Zhao
On 2015/1/6 17:55, Peter Maydell wrote: > On 6 January 2015 at 05:57, Shannon Zhao wrote: >> To support memory NUMA, don't add memory node in creat_fdt. >> But add it in a new function which takes into accout NUMA >> topology. >> >> Signed-off-by: Shannon

Re: [Qemu-devel] [RFC PATCH v3 3/3] hw/arm/boot: Generate memory dtb according to NUMA topology

2015-01-06 Thread Shannon Zhao
On 2015/1/6 17:58, Peter Maydell wrote: > On 6 January 2015 at 05:57, Shannon Zhao wrote: >> Add a new function arm_generate_memory_dtb which is used to >> generate memory dtb according to NUMA topology and set the >> NUMA topology property of every cpu. >> >

[Qemu-devel] [RFC PATCH] virtio-mmio: support for multiple irqs

2014-11-04 Thread Shannon Zhao
. Is this the right direction? is there other ways to make virtio-mmio support multiple irq? Hope for feedback. Thanks. Signed-off-by: Shannon Zhao --- drivers/virtio/virtio_mmio.c | 234 -- 1 files changed, 203 insertions(+), 31 deletions(-) diff --

[Qemu-devel] [PATCH 0/4] ioeventfd support for virtio-mmio

2014-11-04 Thread Shannon Zhao
ry to make virtio-mmio work with vhost-net on arm/arm64. Shannon Zhao (4): virtio-mmio: introduce set_host_notifier() virtio-mmio: introduce set_guest_notifiers virtio-mmio: start ioeventfd when status gets DRIVER_OK virtio-mmio: add a new property for ioeventfd hw/net/virtio-net.c|

[Qemu-devel] [PATCH 2/4] virtio-mmio: introduce set_guest_notifiers

2014-11-04 Thread Shannon Zhao
Same as host notifier of virtio-mmio, most of codes came from virtio-pci. The kvm-arm does not yet support irqfd, need to fix the hard-coded part after kvm-arm gets irqfd support. Signed-off-by: Ying-Shiuan Pan Signed-off-by: Li Liu Signed-off-by: Shannon Zhao --- hw/virtio/virtio-mmio.c

[Qemu-devel] [PATCH 4/4] virtio-mmio: add a new property for ioeventfd

2014-11-04 Thread Shannon Zhao
Make ioeventfd could be enabled or disabled (default). Since ioeventfd is not yet ready in kvm-arm, without this option, qemu will get a problem if it attempts to initialize ioeventfd. Signed-off-by: Ying-Shiuan Pan Signed-off-by: Li Liu Signed-off-by: Shannon Zhao --- hw/net/virtio-net.c

[Qemu-devel] [PATCH 1/4] virtio-mmio: introduce set_host_notifier()

2014-11-04 Thread Shannon Zhao
set_host_notifier() is introduced into virtio-mmio now. Most of codes came from virtio-pci. Signed-off-by: Ying-Shiuan Pan Signed-off-by: Li Liu Signed-off-by: Shannon Zhao --- hw/virtio/virtio-mmio.c | 70 +++ 1 files changed, 70 insertions(+), 0

[Qemu-devel] [PATCH 3/4] virtio-mmio: start ioeventfd when status gets DRIVER_OK

2014-11-04 Thread Shannon Zhao
Signed-off-by: Ying-Shiuan Pan Signed-off-by: Li Liu Signed-off-by: Shannon Zhao --- hw/virtio/virtio-mmio.c | 45 + 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c index b741f50

  1   2   3   4   5   6   7   8   9   >