Re: [Qemu-devel] [PATCH 10/74] acpi: add aml_call0() helper

2015-12-10 Thread Marcel Apfelbaum
*method, Aml *arg1); Aml *aml_call2(const char *method, Aml *arg1, Aml *arg2); Aml *aml_call3(const char *method, Aml *arg1, Aml *arg2, Aml *arg3); Maybe aml_call instead of aml_call0 that implies some 'zero' initialization? It doesn't really matter. Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 14/74] acpi: add aml_sleep()

2015-12-10 Thread Marcel Apfelbaum
4_t addr_min, uint64_t addr_max, uint64_t addr_trans, uint64_t len); +Aml *aml_sleep(uint64_t msec); /* Block AML object primitives */ Aml *aml_scope(const char *name_format, ...) GCC_FMT_ATTR(1, 2); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 17/74] acpi: add aml_lgreater()

2015-12-10 Thread Marcel Apfelbaum
Aml *aml_lgreater_equal(Aml *arg1, Aml *arg2); Aml *aml_processor(uint8_t proc_id, uint32_t pblk_addr, uint8_t pblk_len, const char *name_format, ...) GCC_FMT_ATTR(4, 5); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH] Use error_fatal to simplify obvious fatal errors

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 02:34 PM, Markus Armbruster wrote: Marcel Apfelbaum <marcel.apfelb...@gmail.com> writes: On 12/10/2015 12:19 PM, Markus Armbruster wrote: Done with this admittedly crude Coccinelle semantic patch with manual burial of dead Error * variables sq

Re: [Qemu-devel] [PATCH 25/74] pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 01:41 AM, Igor Mammedov wrote: Signed-off-by: Igor Mammedov --- hw/acpi/Makefile.objs | 2 +- hw/acpi/memory_hotplug_acpi_table.c | 40 + hw/i386/acpi-build.c| 3 +++

Re: [Qemu-devel] [PATCH 01/74] tests: acpi: print ASL diff in verbose mode

2015-12-10 Thread Marcel Apfelbaum
tem(diff) ; +g_free(diff); +} } } g_string_free(asl, true); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 11/74] acpi: add aml_to_integer()

2015-12-10 Thread Marcel Apfelbaum
t); Aml *aml_and(Aml *arg1, Aml *arg2); Aml *aml_or(Aml *arg1, Aml *arg2); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 07/74] acpi: aml: add helper for Opcode Arg2 Arg2 [Dst] AML pattern

2015-12-10 Thread Marcel Apfelbaum
*var = aml_opcode(0x88 /* IndexOp */); -aml_append(var, arg1); -aml_append(var, idx); -build_append_byte(var->buf, 0x00 /* NullNameOp */); -return var; +return build_opcode_2arg_dst(0x88 /* IndexOp */, arg1, idx, NULL); } /* ACPI 1.0b: 16.2.5.3 Type 1 Opcodes Encoding:

Re: [Qemu-devel] [PATCH 19/74] acpi: add aml_to_hexstring()

2015-12-10 Thread Marcel Apfelbaum
(Aml *arg); +Aml *aml_to_hexstring(Aml *src, Aml *dst); Aml *aml_store(Aml *val, Aml *target); Aml *aml_and(Aml *arg1, Aml *arg2); Aml *aml_or(Aml *arg1, Aml *arg2); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 22/74] acpi: extend aml_or() to accept target argument

2015-12-10 Thread Marcel Apfelbaum
l *aml_and(Aml *arg1, Aml *arg2); -Aml *aml_or(Aml *arg1, Aml *arg2); +Aml *aml_or(Aml *arg1, Aml *arg2, Aml *dst); Aml *aml_lor(Aml *arg1, Aml *arg2); Aml *aml_shiftleft(Aml *arg1, Aml *count); Aml *aml_shiftright(Aml *arg1, Aml *count, Aml *dst); Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH 00/74] pc: acpi: convert DSDT to AML API and drop ASL templates support

2015-12-10 Thread Marcel Apfelbaum
On 12/10/2015 01:40 AM, Igor Mammedov wrote: Due to huge size, CCing only cover letter instead of individual patches. Series consist of 2 parts the 1st part prefixed 'acpi:' adds necessary AML API functions and the second part converts DSDT using existing and new AML API. Series does exact

Re: [Qemu-devel] [PATCH v2 5/6] vmw_pvscsi: The pvscsi device is a PCIE endpoint

2015-12-14 Thread Marcel Apfelbaum
On 12/14/2015 07:14 PM, Paolo Bonzini wrote: On 13/12/2015 09:08, Shmulik Ladkani wrote: +pvs_k->parent_dc_realize = dc->realize; Marcel, Michael, this creates a really nasty dependency on the contents of pci_qdev_realize. Hi Paolo, In this case is exactly want we want to do. We

Re: [Qemu-devel] [PATCH v2 09/14] pc: Remove compat fields from PcGuestInfo

2015-12-15 Thread Marcel Apfelbaum
/* These values are guest ABI, do not change */ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 24362ef..d24682f 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -30,10 +30,6 @@ struct PcGuestInfo { uint64_t *node_mem; uint64_t *node_cpu; FWCfgState *fw_cfg; -int legacy_acpi_table_size; -bool has_acpi_build; -bool has_reserved_memory; -bool rsdp_in_ram; }; /** Looks OK to me Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH v2 11/14] pc: Remove PcGuestInfo.isapc_ram_fw field

2015-12-15 Thread Marcel Apfelbaum
On 12/11/2015 08:42 PM, Eduardo Habkost wrote: The code can use the PCMachineClass.pci_enabled field directly. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 2 +- hw/i386/pc_piix.c| 5 + hw/i386/pc_q35.c | 4 +--- include/hw/i386/pc.h | 1 - 4

Re: [Qemu-devel] [PATCH v2 13/14] pc: Move APIC and NUMA data from PcGuestInfo to PCMachineState

2015-12-15 Thread Marcel Apfelbaum
uint64_t *node_cpu; }; /** @@ -57,6 +52,15 @@ struct PCMachineState { /* RAM information (sizes, addresses, configuration): */ ram_addr_t below_4g_mem_size, above_4g_mem_size; + +/* CPU and apic information: */ +bool apic_xrupt_override; + unsigned apic_id_limit; + +/* NUMA information: */ +uint64_t numa_nodes; +uint64_t *node_mem; +uint64_t *node_cpu; }; #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" A clean re-factoring. Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH v2 10/14] pc: Remove RAM size fields from PcGuestInfo

2015-12-15 Thread Marcel Apfelbaum
/hw/i386/pc.h index d24682f..30c7a5b 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -23,7 +23,6 @@ /* Machine info for ACPI build: */ struct PcGuestInfo { bool isapc_ram_fw; -hwaddr ram_size, ram_size_below_4g; I understand the ram_size_below_4g change. So nobody

Re: [Qemu-devel] [PATCH v2 14/14] pc: Eliminate PcGuestInfo struct

2015-12-15 Thread Marcel Apfelbaum
On 12/11/2015 08:42 PM, Eduardo Habkost wrote: The struct is not used for anything, now. Signed-off-by: Eduardo Habkost --- hw/i386/pc.c | 4 +--- include/hw/i386/pc.h | 7 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c

Re: [Qemu-devel] [PATCH v2 12/14] pc: Move PcGuestInfo.fw_cfg to PCMachineState

2015-12-15 Thread Marcel Apfelbaum
ode_cpu; -FWCfgState *fw_cfg; }; /** @@ -49,6 +48,7 @@ struct PCMachineState { HotplugHandler *acpi_dev; ISADevice *rtc; PCIBus *bus; + FWCfgState *fw_cfg; /* Configuration options: */ uint64_t max_ram_below_4g; Looks OK to me. Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PATCH v2 07/14] acpi: Remove guest_info parameters from functions

2015-12-18 Thread Marcel Apfelbaum
On 12/18/2015 08:08 PM, Eduardo Habkost wrote: On Tue, Dec 15, 2015 at 02:36:10PM +0200, Marcel Apfelbaum wrote: On 12/11/2015 08:42 PM, Eduardo Habkost wrote: We can use PC_MACHINE(qdev_get_machine())->acpi_guest_info to get guest_info. Hi Eduardo, I like the idea of using qdev_get_mach

Re: [Qemu-devel] [PATCH v2 26/74] pc: acpi: memhp: move MHPD._STA method into SSDT

2015-12-20 Thread Marcel Apfelbaum
On 12/16/2015 04:47 PM, Igor Mammedov wrote: Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- v2: - add parentheses around ifctx block Suggested-by: Marcel Apfelbaum <marcel.apfelb...@gmail.com> --- hw/acpi/memory_hotplug_acpi_table.c | 14 ++ hw/i386/a

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()

2015-12-20 Thread Marcel Apfelbaum
Hi, On 12/18/2015 01:03 PM, Cao jin wrote: Signed-off-by: Cao jin --- hw/pci-bridge/pci_expander_bridge.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/hw/pci-bridge/pci_expander_bridge.c

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()

2015-12-20 Thread Marcel Apfelbaum
On 12/20/2015 12:48 PM, Cao jin wrote: Hi, On 12/20/2015 06:22 PM, Marcel Apfelbaum wrote: Hi, On 12/18/2015 01:03 PM, Cao jin wrote: Signed-off-by: Cao jin <caoj.f...@cn.fujitsu.com> --- hw/pci-bridge/pci_expander_bridge.c | 24 ++-- 1 file changed, 14 inse

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()

2015-12-22 Thread Marcel Apfelbaum
On 12/22/2015 11:16 AM, Cao jin wrote: On 12/22/2015 03:34 PM, Marcel Apfelbaum wrote: On 12/22/2015 05:58 AM, Cao jin wrote: On 12/21/2015 11:49 PM, Paolo Bonzini wrote: On 20/12/2015 12:38, Cao jin wrote: +object_unref(OBJECT(ds)); +object_unref(OBJECT(bds

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()

2015-12-21 Thread Marcel Apfelbaum
On 12/21/2015 04:59 AM, Cao jin wrote: On 12/20/2015 07:21 PM, Marcel Apfelbaum wrote: On 12/20/2015 12:48 PM, Cao jin wrote: Hi, On 12/20/2015 06:22 PM, Marcel Apfelbaum wrote: [...] + +err_register_bus: +object_unref(OBJECT(ds)); +object_unref(OBJECT(bds)); +object_unref

Re: [Qemu-devel] [PATCH 3/5] PXB: convert to realize()

2015-12-21 Thread Marcel Apfelbaum
On 12/22/2015 05:58 AM, Cao jin wrote: On 12/21/2015 11:49 PM, Paolo Bonzini wrote: On 20/12/2015 12:38, Cao jin wrote: +object_unref(OBJECT(ds)); +object_unref(OBJECT(bds)); +object_unref(OBJECT(bus)); I think these should be object_unparent, not unref. But, it seems

Re: [Qemu-devel] [PATCH] docs/pci_expander_bridge: fix typo

2015-12-22 Thread Marcel Apfelbaum
Cc: qemu-triv...@nongnu.org Anyway, Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel On 12/22/2015 02:00 PM, Cao jin wrote: Signed-off-by: Cao jin <caoj.f...@cn.fujitsu.com> --- docs/pci_expander_bridge.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deleti

Re: [Qemu-devel] [PATCH v3] PXB: convert to realize()

2015-12-22 Thread Marcel Apfelbaum
b_dev_initfn; +k->realize = pxb_dev_realize; k->exit = pxb_dev_exitfn; k->vendor_id = PCI_VENDOR_ID_REDHAT; k->device_id = PCI_DEVICE_ID_REDHAT_PXB; Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel

Re: [Qemu-devel] [PATCH 25/74] pc: acpi: memhp: prepare context in SSDT for moving memhp DSDT code

2015-12-17 Thread Marcel Apfelbaum
On 12/16/2015 04:25 PM, Igor Mammedov wrote: On Wed, 16 Dec 2015 15:25:46 +0200 Marcel Apfelbaum <marcel.apfelb...@gmail.com> wrote: On 12/10/2015 01:41 AM, Igor Mammedov wrote: Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- hw/acpi/Makefile.objs | 2 +

Re: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines

2015-11-29 Thread Marcel Apfelbaum
On 11/27/2015 07:28 PM, Eduardo Habkost wrote: On Thu, Nov 26, 2015 at 06:00:28PM +0200, Marcel Apfelbaum wrote: Add bus property to PC machines and use it when looking for primary PCI root bus (bus 0). Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> I can't pretend I have re

Re: [Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35

2015-11-29 Thread Marcel Apfelbaum
On 11/27/2015 07:04 PM, Igor Mammedov wrote: On Thu, 26 Nov 2015 20:35:59 +0200 Marcel Apfelbaum <mar...@redhat.com> wrote: On 11/26/2015 07:01 PM, Laszlo Ersek wrote: Hello Marcel, On 11/26/15 17:00, Marcel Apfelbaum wrote: Note: I took the liberty to CC all the reviewers tha

Re: [Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35

2015-11-29 Thread Marcel Apfelbaum
On 11/26/2015 07:01 PM, Laszlo Ersek wrote: Hello Marcel, [...] if you have ACPI table dumps from within an i440fx SeaBIOS Linux guest, both from before and after your QEMU patches, and those dumps are identical, then that's good evidence against regressions. (I tend to do such

Re: [Qemu-devel] [PULL 07/15] q35: Check propery to determine if iommu is set

2015-11-29 Thread Marcel Apfelbaum
On 11/19/2015 03:36 PM, Michael S. Tsirkin wrote: From: Bandan Das The helper function machine_iommu() isn't necesary. We can directly check for the property. Signed-off-by: Bandan Das Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael

Re: [Qemu-devel] [Qemu-trivial] [PATCH] PCI Trivial: remove superfluous code

2015-11-24 Thread Marcel Apfelbaum
On 11/23/2015 03:19 PM, Cao jin wrote: remove superfluous code in do_pci_register_device(). See its caller: pci_qdev_realize() Signed-off-by: Cao jin --- hw/pci/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index

Re: [Qemu-devel] [PATCH v3 2/4] pc: Add pc-*-2.6 machine classes

2015-11-30 Thread Marcel Apfelbaum
5 + #define PC_COMPAT_2_4 \ +PC_COMPAT_2_5 \ HW_COMPAT_2_4 \ {\ .driver = "Haswell-" TYPE_X86_CPU,\ Reviewed-by: Marcel Apfelbaum <mar...@redhat.com>

Re: [Qemu-devel] [PULL 07/15] q35: Check propery to determine if iommu is set

2015-11-30 Thread Marcel Apfelbaum
On 11/29/2015 08:22 PM, Bandan Das wrote: Hi Marcel, Marcel Apfelbaum <marcel.apfelb...@gmail.com> writes: ... Maybe is too late, but this contradicts QEMU usage, as I understand Why late ? We can always revert it :) Well, this is why I am so disappointment in myself that I didn't

Re: [Qemu-devel] [PATCH V5] hw/virtio: Add PCIe capability to virtio devices

2015-12-01 Thread Marcel Apfelbaum
On 12/01/2015 12:29 PM, Shmulik Ladkani wrote: Hi, On Tue, 10 Nov 2015 13:41:29 +0200, mar...@redhat.com wrote: The virtio devices are converted to PCI-Express if they are plugged into a PCI-Express bus and the 'modern' protocol is enabled. @@ -1592,6 +1592,26 @@ static void

Re: [Qemu-devel] [PATCH V5] hw/virtio: Add PCIe capability to virtio devices

2015-12-01 Thread Marcel Apfelbaum
On 12/01/2015 04:19 PM, Shmulik Ladkani wrote: Hi, On Tue, 1 Dec 2015 16:01:00 +0200, mar...@redhat.com wrote: On 12/01/2015 03:18 PM, Shmulik Ladkani wrote: On Tue, 1 Dec 2015 13:48:13 +0200, mar...@redhat.com wrote: May I suggest the following: - Expose 'pci_qdev_realize' - Have

Re: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines

2015-12-01 Thread Marcel Apfelbaum
On 12/01/2015 04:48 PM, Eduardo Habkost wrote: On Tue, Dec 01, 2015 at 04:07:33PM +0200, Marcel Apfelbaum wrote: On 11/30/2015 05:07 PM, Eduardo Habkost wrote: On Sun, Nov 29, 2015 at 10:46:03AM +0200, Marcel Apfelbaum wrote: On 11/27/2015 07:28 PM, Eduardo Habkost wrote: On Thu, Nov 26

Re: [Qemu-devel] [PATCH V5] hw/virtio: Add PCIe capability to virtio devices

2015-12-01 Thread Marcel Apfelbaum
On 12/01/2015 03:18 PM, Shmulik Ladkani wrote: Hi, On Tue, 1 Dec 2015 13:48:13 +0200, mar...@redhat.com wrote: May I suggest the following: - Expose 'pci_qdev_realize' - Have 'virtio_pci_class_init' arm it's own dc->realize, which will first set 'QEMU_PCI_CAP_EXPRESS' flag as needed,

Re: [Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines

2015-12-01 Thread Marcel Apfelbaum
On 11/30/2015 05:07 PM, Eduardo Habkost wrote: On Sun, Nov 29, 2015 at 10:46:03AM +0200, Marcel Apfelbaum wrote: On 11/27/2015 07:28 PM, Eduardo Habkost wrote: On Thu, Nov 26, 2015 at 06:00:28PM +0200, Marcel Apfelbaum wrote: Add bus property to PC machines and use it when looking for primary

Re: [Qemu-devel] [PATCH] virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass realize method

2015-12-01 Thread Marcel Apfelbaum
On 12/01/2015 06:23 PM, Shmulik Ladkani wrote: In 1811e64 'hw/virtio: Add PCIe capability to virtio devices', the QEMU_PCI_CAP_EXPRESS capability was added to virtio's pci_dev, within 'virtio_pci_realize' - the pci device object realization method. This occurs to late, as 'pci_qdev_realize'

[Qemu-devel] [PATCH V3 1/3] hw/acpi: merge pxb adjacent memory/IO ranges

2015-11-26 Thread Marcel Apfelbaum
A generic PCI Bus Expander doesn't necessary have a built-in PCI bridge. Int this case the ACPI will include IO/MEM ranges per device. Try to merge adjacent resources to reduce the ACPI tables length. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c

[Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35

2015-11-26 Thread Marcel Apfelbaum
bridge compat property to keep the PCI bridge for older machine to avoid breaking migration. Thanks, Marcel Marcel Apfelbaum (3): hw/acpi: merge pxb adjacent memory/IO ranges hw/pxb: introduce pxb-pcie expander for PCIe machines hw/i386: extend pxb query for all PC machines hw/i386/acpi-b

[Qemu-devel] [PATCH V3 3/3] hw/i386: extend pxb query for all PC machines

2015-11-26 Thread Marcel Apfelbaum
Add bus property to PC machines and use it when looking for primary PCI root bus (bus 0). Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 3 +-- hw/i386/pc.c | 2 +- hw/i386/pc_piix.c| 1 + hw/i386/pc_q35.c | 1 + include/hw/i386/pc.h | 1 + 5

[Qemu-devel] [PATCH V3 2/3] hw/pxb: introduce pxb-pcie expander for PCIe machines

2015-11-26 Thread Marcel Apfelbaum
The pxb-pcie is the counterpart of pxb for PCI express machines. The new device re-uses the pxb code, but appears to the guests as a different device. The pxb-pcie device does not have an internal pci-pci bridge and exposes a PCIe root bus instead of a PCI one. Signed-off-by: Marcel Apfelbaum

Re: [Qemu-devel] [PATCH V3 0/3] hw/pcie: Multi-root support for Q35

2015-11-26 Thread Marcel Apfelbaum
On 11/26/2015 07:01 PM, Laszlo Ersek wrote: Hello Marcel, On 11/26/15 17:00, Marcel Apfelbaum wrote: Note: I took the liberty to CC all the reviewers that took their time and had a look on the previous version, thanks!! The PXB host bridge provides a way to have multiple PCI hierarchies (PCI

[Qemu-devel] [PATCH] hw/pci-bridge: remove 16 PCIe devices limitation by making IO forwarding optional

2015-11-19 Thread Marcel Apfelbaum
-forwarding' property to bridges that makes the optional IOBASE/IO_LIMIT read-only allowing the firmware to skip allocating IO space. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/pci/pci.c | 21 +++-- hw/pci/pci_bridge.c | 25 + i

[Qemu-devel] [PATCH v2 2/3] hw/iommu: enable iommu with -device

2016-06-02 Thread Marcel Apfelbaum
Use the standard '-device iommu' instead of '-machine,iommu=on' to create the IOMMU device. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/core/machine.c | 20 hw/i386/intel_iommu.c | 17 + hw/pci-host/q35.c

Re: [Qemu-devel] [PATCH RFC 0/2] enable iommu with -device

2016-06-02 Thread Marcel Apfelbaum
On 05/31/2016 04:44 AM, Peter Xu wrote: On Mon, May 30, 2016 at 05:14:15PM +0300, Marcel Apfelbaum wrote: On 05/30/2016 04:43 PM, Peter Xu wrote: On Mon, May 23, 2016 at 05:01:28PM +0300, Marcel Apfelbaum wrote: This is a proposal on how to create the iommu with '-device intel-iommu' instead

[Qemu-devel] [PATCH v2 1/3] hw/pci: delay bus_master_enable_region initialization

2016-06-02 Thread Marcel Apfelbaum
Skip bus_master_enable region creation on PCI device init in order to be sure the IOMMU device (if present) would be created in advance. Add this memory region at machine_done time. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/pci/pci.c

[Qemu-devel] [PATCH v2 3/3] q35: allow dynamic sysbus

2016-06-02 Thread Marcel Apfelbaum
-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/pc_q35.c| 1 + hw/pci-bridge/pci_expander_bridge.c | 1 + hw/pci-host/piix.c | 1 + hw/pci-host/q35.c | 1 + 4 files changed, 4 insertions(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c

[Qemu-devel] [PATCH v2 0/3] enable iommu with -device

2016-06-02 Thread Marcel Apfelbaum
e bus_master also on init if the guest OS already booted to enable hotplug (Paolo). - Add a machine_done notifier to PCIBus instead of adding functionality for q35 machine_done callback. The main reason is we don't want to replicate the code for all platforms that support PCI and i

Re: [Qemu-devel] [PATCH v2 2/3] hw/iommu: enable iommu with -device

2016-06-05 Thread Marcel Apfelbaum
On 06/03/2016 07:07 PM, Michael S. Tsirkin wrote: On Thu, Jun 02, 2016 at 11:15:54PM +0300, Marcel Apfelbaum wrote: Use the standard '-device iommu' instead of '-machine,iommu=on' to create the IOMMU device. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> Hi Michael, Tha

Re: [Qemu-devel] [PATCH v2 2/3] hw/iommu: enable iommu with -device

2016-06-05 Thread Marcel Apfelbaum
On 06/05/2016 12:59 PM, Michael S. Tsirkin wrote: On Sun, Jun 05, 2016 at 11:46:13AM +0300, Marcel Apfelbaum wrote: On 06/03/2016 07:07 PM, Michael S. Tsirkin wrote: On Thu, Jun 02, 2016 at 11:15:54PM +0300, Marcel Apfelbaum wrote: Use the standard '-device iommu' instead of '-machine,iommu

Re: [Qemu-devel] [PATCH v2 3/3] q35: allow dynamic sysbus

2016-06-08 Thread Marcel Apfelbaum
On 06/08/2016 05:56 AM, Peter Xu wrote: On Thu, Jun 02, 2016 at 11:15:55PM +0300, Marcel Apfelbaum wrote: Allow adding sysbus devices with -device on Q35. At first Q35 will support only intel-iommu to be added this way, however the command line will support all sysbus devices. Mark

Re: [Qemu-devel] [PATCH v2 1/3] hw/pci: delay bus_master_enable_region initialization

2016-06-08 Thread Marcel Apfelbaum
On 06/08/2016 02:16 PM, Paolo Bonzini wrote: - Original Message - From: "Marcel Apfelbaum" <mar...@redhat.com> To: qemu-devel@nongnu.org Cc: mar...@redhat.com, m...@redhat.com, pbonz...@redhat.com, ehabk...@redhat.com, pet...@redhat.com, davidkiar...@gmail.com, "

Re: [Qemu-devel] [PATCH] vl: Eliminate usb_enabled()

2016-06-08 Thread Marcel Apfelbaum
On 06/07/2016 07:56 PM, Eduardo Habkost wrote: This wrapper for machine_usb(current_machine) is not necessary, replace all usages of usb_enabled() with machine_usb(). Signed-off-by: Eduardo Habkost --- hw/arm/nseries.c| 2 +- hw/arm/pxa2xx.c | 7

Re: [Qemu-devel] [RFC] Allow AMD IOMMU to have both SysBusDevice and PCIDevice properties.

2016-06-09 Thread Marcel Apfelbaum
On 06/07/2016 10:12 PM, Eduardo Habkost wrote: Hi, [...] [...] diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 04aae89..431eaed 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -281,6 +281,7 @@ static void pc_q35_machine_options(MachineClass *m) m->default_machine_opts

Re: [Qemu-devel] [PATCH v2 3/3] q35: allow dynamic sysbus

2016-06-03 Thread Marcel Apfelbaum
On 06/03/2016 09:33 AM, Markus Armbruster wrote: Marcel Apfelbaum <mar...@redhat.com> writes: Allow adding sysbus devices with -device on Q35. At first Q35 will support only intel-iommu to be added this way, however the command line will support all sysbus devices.

Re: [Qemu-devel] [PATCH v8 10/17] pci bridge dev: change msi property type

2016-06-13 Thread Marcel Apfelbaum
On 06/10/2016 12:54 PM, Cao jin wrote: From bit to enum OnOffAuto. cc: Michael S. Tsirkin <m...@redhat.com> cc: Markus Armbruster <arm...@redhat.com> cc: Marcel Apfelbaum <mar...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Cao jin &

Re: [Qemu-devel] [PATCH v8 12/17] pci: Convert msi_init() to Error and fix callers to check it

2016-06-13 Thread Marcel Apfelbaum
com> cc: Hannes Reinecke <h...@suse.de> cc: Paolo Bonzini <pbonz...@redhat.com> cc: Alex Williamson <alex.william...@redhat.com> cc: Markus Armbruster <arm...@redhat.com> cc: Marcel Apfelbaum <mar...@redhat.com> Reviewed-by: Markus Armbruster <arm...@redhat.com>

Re: [Qemu-devel] [PATCH v8 11/17] msi_init: change return value to 0 on success

2016-06-13 Thread Marcel Apfelbaum
.de> cc: Markus Armbruster <arm...@redhat.com> cc: Marcel Apfelbaum <mar...@redhat.com> Acked-by: Hannes Reinecke <h...@suse.com> Reviewed-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Cao jin <caoj.f...@cn.fujitsu.com> --- hw/pci/msi.c | 6 +++--- 1 f

Re: [Qemu-devel] [PATCH v2 2/3] hw/iommu: enable iommu with -device

2016-06-13 Thread Marcel Apfelbaum
On 06/12/2016 07:27 AM, Peter Xu wrote: On Thu, Jun 02, 2016 at 11:15:54PM +0300, Marcel Apfelbaum wrote: [...] static void vtd_realize(DeviceState *dev, Error **errp) { +PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus; IntelIOMMUState *s = INTEL_IOMMU_DEVICE(

[Qemu-devel] [PATCH v3 4/4] machine: remove iommu property

2016-06-13 Thread Marcel Apfelbaum
Since iommu devices can be created with '-device' there is no need to keep iommu as machine and mch property. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/core/machine.c | 20 hw/pci-host/q35.c | 12 include/hw/pci-host/q35.

[Qemu-devel] [PATCH v4 2/4] q35: allow dynamic sysbus

2016-06-14 Thread Marcel Apfelbaum
-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/pc_q35.c| 1 + hw/pci-bridge/pci_expander_bridge.c | 2 ++ hw/pci-host/piix.c | 2 ++ hw/pci-host/q35.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c

[Qemu-devel] [PATCH v4 4/4] machine: remove iommu property

2016-06-14 Thread Marcel Apfelbaum
Since iommu devices can be created with '-device' there is no need to keep iommu as machine and mch property. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/core/machine.c | 20 hw/pci-host/q35.c | 12 include/hw/pci-host/q35.

[Qemu-devel] [PATCH v4 3/4] hw/iommu: enable iommu with -device

2016-06-14 Thread Marcel Apfelbaum
Use the standard '-device iommu' to create the IOMMU device. The legacy '-machine,iommu=on' can still be used. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/intel_iommu.c | 16 hw/i386/pc_q35.c | 1 - hw/pci-host/q35.c | 17 + 3

[Qemu-devel] [PATCH v4 1/4] hw/pci: delay bus_master_enable_region initialization

2016-06-14 Thread Marcel Apfelbaum
Skip bus_master_enable region creation on PCI device init in order to be sure the IOMMU device (if present) would be created in advance. Add this memory region at machine_done time. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/pci/pci.c

[Qemu-devel] [PATCH v4 0/4] enable iommu with -device

2016-06-14 Thread Marcel Apfelbaum
ot_instantiate_with_device_add_yet'. I didn't mark them all because: - libvirt will mask them anyway - some of them have already a "protection" in place - it is possible that some of them can be actually used with -device on other platform. - those are not 'interesting

Re: [Qemu-devel] [PATCH v3 0/4] enable iommu with -device

2016-06-14 Thread Marcel Apfelbaum
On 06/13/2016 11:51 PM, Michael S. Tsirkin wrote: On Mon, Jun 13, 2016 at 05:36:56PM +0300, Marcel Apfelbaum wrote: Create the iommu device with '-device intel-iommu' instead of '-machine,iommu=on'. The device is part of the machine properties because we wanted to ensure is created before

[Qemu-devel] [PATCH v3 1/4] hw/pci: delay bus_master_enable_region initialization

2016-06-13 Thread Marcel Apfelbaum
Skip bus_master_enable region creation on PCI device init in order to be sure the IOMMU device (if present) would be created in advance. Add this memory region at machine_done time. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/pci/pci.c

[Qemu-devel] [PATCH v3 0/4] enable iommu with -device

2016-06-13 Thread Marcel Apfelbaum
em all because: - libvirt will mask them anyway - some of them have already a "protection" in place - it is possible that some of them can be actually used with -device on other platform. - those are not 'interesting' scenarios. If somebody spots devices in the list that can

[Qemu-devel] [PATCH v3 2/4] q35: allow dynamic sysbus

2016-06-13 Thread Marcel Apfelbaum
-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/pc_q35.c| 1 + hw/pci-bridge/pci_expander_bridge.c | 2 ++ hw/pci-host/piix.c | 2 ++ hw/pci-host/q35.c | 2 ++ 4 files changed, 7 insertions(+) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c

[Qemu-devel] [PATCH v3 3/4] hw/iommu: enable iommu with -device

2016-06-13 Thread Marcel Apfelbaum
Use the standard '-device iommu' to create the IOMMU device. The legacy '-machine,iommu=on' can still be used. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/intel_iommu.c | 16 hw/i386/pc_q35.c | 1 - hw/pci-host/q35.c | 17 + 3

Re: [Qemu-devel] [PATCH v8 12/17] pci: Convert msi_init() to Error and fix callers to check it

2016-06-13 Thread Marcel Apfelbaum
On 06/13/2016 02:09 PM, Cao jin wrote: On 06/13/2016 06:16 PM, Marcel Apfelbaum wrote: On 06/10/2016 12:54 PM, Cao jin wrote: diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c index 692283f..a06d184 100644 --- a/hw/net/e1000e.c +++ b/hw/net/e1000e.c @@ -268,13 +268,9 @@ e1000e_init_msi

Re: [Qemu-devel] [PATCH v8 12/17] pci: Convert msi_init() to Error and fix callers to check it

2016-06-13 Thread Marcel Apfelbaum
On 06/13/2016 02:07 PM, Markus Armbruster wrote: Marcel Apfelbaum <mar...@redhat.com> writes: On 06/10/2016 12:54 PM, Cao jin wrote: msi_init() reports errors with error_report(), which is wrong when it's used in realize(). Fix by converting it to Error. Fix its callers to handle f

Re: [Qemu-devel] [PATCH v2 2/2] vl: Eliminate usb_enabled()

2016-06-09 Thread Marcel Apfelbaum
} -if (!usb_enabled()) { +if (!machine_usb(current_machine)) { return -1; } @@ -4501,7 +4496,7 @@ int main(int argc, char **argv, char **envp) } /* init USB devices */ -if (usb_enabled()) { +if (machine_usb(current_machine)) { if (foreach

Re: [Qemu-devel] [PATCH RFC 0/2] enable iommu with -device

2016-05-30 Thread Marcel Apfelbaum
On 05/30/2016 04:43 PM, Peter Xu wrote: On Mon, May 23, 2016 at 05:01:28PM +0300, Marcel Apfelbaum wrote: This is a proposal on how to create the iommu with '-device intel-iommu' instead of '-machine,iommu=on'. The device is part of the machine properties because we wanted to ensure

[Qemu-devel] [PATCH RFC 6/7] hw/acpi: extend acpi pci hotplug support for pci express

2016-05-31 Thread Marcel Apfelbaum
Emit acpi code for pci hotplug on all PC machines: - if legacy pci hotpug is enabled (pcihp_bridge_en) - if there is at least one legacy pci bridge in current system - for PCI buses only (skip PCIe buses) Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.

[Qemu-devel] [PATCH RFC 0/7] q35: add legacy pci acpi hotplug support

2016-05-31 Thread Marcel Apfelbaum
, Marcel Marcel Apfelbaum (7): hw/acpi: remove dead acpi code hw/acpi: simplify dsdt building code hw/acpi: fix a DSDT table issue when a pxb is present. hw/apci: fix pcihp io initialization hw/acpi: prepare pci hotplug IO for ich9 hw/acpi: extend acpi pci hotplug support for pci express hw

[Qemu-devel] [PATCH RFC 4/7] hw/apci: fix pcihp io initialization

2016-05-31 Thread Marcel Apfelbaum
The pm initialization code assigns the pcihp IO base and length to -1 on error, but the later code will assume 0 as invalid value. Fix it initializing the above value to 0 as expected. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 10 ++ 1 file c

[Qemu-devel] [PATCH RFC 7/7] hw/ich9: enable pci acpi hotplug

2016-05-31 Thread Marcel Apfelbaum
Re-use the pci acpi hotplug code and enable it only for the new machines using the 'acpi-pci-hotplug-with-bridge-support' compat property. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/acpi/ich9.c | 31 +++ hw/isa/lpc_ich9.c

[Qemu-devel] [PATCH RFC 1/7] hw/acpi: remove dead acpi code

2016-05-31 Thread Marcel Apfelbaum
PCST and PCSB operation regions are not used by the Q35 machine. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 279f0d7..9aef25d 100644 --- a/h

[Qemu-devel] [PATCH RFC 5/7] hw/acpi: prepare pci hotplug IO for ich9

2016-05-31 Thread Marcel Apfelbaum
Does not have any effect yet since the pcihp is not enabled for ICH9. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 2097c4c..8

[Qemu-devel] [PATCH RFC 3/7] hw/acpi: fix a DSDT table issue when a pxb is present.

2016-05-31 Thread Marcel Apfelbaum
-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c6f4afe..0c329fb 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -589,6 +589,10 @@ stati

[Qemu-devel] [PATCH RFC 2/7] hw/acpi: simplify dsdt building code

2016-05-31 Thread Marcel Apfelbaum
Get the pci root-bus once and pass it around. Signed-off-by: Marcel Apfelbaum <mar...@redhat.com> --- hw/i386/acpi-build.c | 58 +++- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c

Re: [Qemu-devel] [PATCH] vl: Error messages need to go to stderr, fix some

2016-05-31 Thread Marcel Apfelbaum
) { -printf("Option %s not supported for this target\n", popt->name); +error_report("Option not supported for this target"); exit(1); } xen_mode = XEN_ATTACH; Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel

Re: [Qemu-devel] [PATCH 04/33] pc: acpi: remove AML for empty/not used GPE handlers

2016-05-31 Thread Marcel Apfelbaum
On 05/25/2016 04:19 PM, Igor Mammedov wrote: On Wed, 25 May 2016 12:11:33 +0300 Marcel Apfelbaum <mar...@redhat.com> wrote: On 05/17/2016 05:42 PM, Igor Mammedov wrote: ACPI spec requires GPE handlers only for GPE events that hardware implements. So remove AML for not supported by QEMU

Re: [Qemu-devel] [PATCH v8 16/25] q35: add "intremap" parameter to enable IR

2016-06-02 Thread Marcel Apfelbaum
On 05/30/2016 04:33 PM, Peter Xu wrote: On Mon, May 30, 2016 at 02:43:22PM +0200, Jan Kiszka wrote: On 2016-05-30 12:31, Peter Xu wrote: One flag is added to specify whether to enable IR for emulated IOMMU. By default, interrupt remapping is not supportted. To enable it, we should specify

Re: [Qemu-devel] [PATCH v2 14/33] pc: use AcpiDeviceIfClass.send_event to issue GPE events

2016-06-02 Thread Marcel Apfelbaum
to trigger events usiong GPIO instead of GPE as fixed hadrware ACPI model doen't have GPE at all. Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- v2: - make ACPI_SEND_EVENT macro a function Marcel Apfelbaum <mar...@redhat.com> --- hw/acpi/cpu_hotplug.c|

Re: [Qemu-devel] [PATCH v2 13/33] acpi: extend ACPI interface to provide send_event hook

2016-06-02 Thread Marcel Apfelbaum
On 06/02/2016 02:19 PM, Igor Mammedov wrote: On Thu, 2 Jun 2016 14:09:12 +0300 Marcel Apfelbaum <mar...@redhat.com> wrote: On 05/31/2016 12:57 PM, Igor Mammedov wrote: send_event() hook will allow to send ACPI event in a target specific way (GPE or GPIO based impl.) it will also si

Re: [Qemu-devel] [PATCH v2 13/33] acpi: extend ACPI interface to provide send_event hook

2016-06-02 Thread Marcel Apfelbaum
directly. Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- Following patch will use hook to simplify hotplug callbacks in piix4pm/ich9. v2: - make ACPI_SEND_EVENT macro a function Marcel Apfelbaum <mar...@redhat.com> --- hw/acpi/acpi_interface.c | 9 ++

Re: [Qemu-devel] [PATCH v2 1/33] tests: acpi: report names of expected files in verbose mode

2016-06-02 Thread Marcel Apfelbaum
r Mammedov <imamm...@redhat.com> --- v2: replace 'for' loop with more readble 'goto' Marcel Apfelbaum <mar...@redhat.com> --- tests/bios-tables-test.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bi

Re: [Qemu-devel] [PATCH 05/33] pc: acpi: consolidate CPU hotplug AML

2016-05-31 Thread Marcel Apfelbaum
On 05/31/2016 10:50 AM, Igor Mammedov wrote: On Mon, 30 May 2016 21:18:59 +0300 Marcel Apfelbaum <mar...@redhat.com> wrote: On 05/17/2016 05:42 PM, Igor Mammedov wrote: move the former SSDT part of CPU hoplug close to DSDT part. AML is only moved but there isn't any functional

Re: [Qemu-devel] [PATCH 20/33] pc: q35: initialize new CPU hotplug hw

2016-05-31 Thread Marcel Apfelbaum
On 05/31/2016 01:06 PM, Igor Mammedov wrote: On Mon, 30 May 2016 22:02:31 +0300 Marcel Apfelbaum <mar...@redhat.com> wrote: On 05/17/2016 05:43 PM, Igor Mammedov wrote: add necessary wiring to init new CPU hotplug hardware if ICH9-LPC.cpu-hotplug-legacy is "off". Set ICH9

Re: [Qemu-devel] [PATCH v2 1/33] tests: acpi: report names of expected files in verbose mode

2016-05-30 Thread Marcel Apfelbaum
r Mammedov <imamm...@redhat.com> --- v2: replace 'for' loop with more readble 'goto' Marcel Apfelbaum <mar...@redhat.com> --- tests/bios-tables-test.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/bios-tables-test.c b/tests/bi

Re: [Qemu-devel] [PATCH 08/33] pc: acpi: mark current CPU hotplug functions as legacy

2016-05-30 Thread Marcel Apfelbaum
_cpu_hotplug_aml(Aml *ctx, MachineState *machine, - uint16_t io_base, uint16_t io_len); +void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, + uint16_t io_base, uint16_t io_len); #endif Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel

Re: [Qemu-devel] [PATCH 10/33] pc: acpi: simplify build_legacy_cpu_hotplug_aml() signature

2016-05-30 Thread Marcel Apfelbaum
_cpu, uint16_t base); void build_legacy_cpu_hotplug_aml(Aml *ctx, MachineState *machine, - uint16_t io_base, uint16_t io_len); + uint16_t io_base); #endif Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel

Re: [Qemu-devel] [PATCH 19/33] pc: piix4/ich9: add 'cpu-hotplug-legacy' property

2016-05-30 Thread Marcel Apfelbaum
, DEFINE_PROP_END_OF_LIST(), }; diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h index bbd657c..e29a856 100644 --- a/include/hw/acpi/ich9.h +++ b/include/hw/acpi/ich9.h @@ -48,6 +48,7 @@ typedef struct ICH9LPCPMRegs { uint32_t pm_io_base; Notifier powerdown_not

Re: [Qemu-devel] [PATCH 05/33] pc: acpi: consolidate CPU hotplug AML

2016-05-30 Thread Marcel Apfelbaum
it to the new file. Maybe is a matter of taste, anyway: Reviewed-by: Marcel Apfelbaum <mar...@redhat.com> Thanks, Marcel Signed-off-by: Igor Mammedov <imamm...@redhat.com> --- hw/acpi/cpu_hotplug_acpi_table.c | 104 +++- hw/i386/acpi-build.c

<    8   9   10   11   12   13   14   15   16   17   >