[Xen-devel] [RFC PATCH 29/30] xen/pt: add Resizable BAR PCIe Extended Capability descriptor and sizing

2018-03-12 Thread Alexey Gerasimenko
-hardware/drivers/display/resizable-bar-support Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 326f5671ff..b03b

[Xen-devel] [RFC PATCH 30/30] xen/pt: add VC/VC9/MFVC PCIe Extended Capabilities descriptors and sizing

2018-03-12 Thread Alexey Gerasimenko
. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 192 1 file changed, 192 insertions(+) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index b03b071b22..ab9c233d84 100644 --- a/

[Xen-devel] [RFC PATCH 16/30] q35/xen: Add Xen platform device support for Q35

2018-03-12 Thread Alexey Gerasimenko
ged later to xen-platform-dev property as well. This way we can use a single machine type (q35) and change just xen-platform-dev value to on/off to control Xen platform device. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/core/machine.c | 21 + hw

[Xen-devel] [RFC PATCH 25/30] xen/pt: add Vendor-specific PCIe Extended Capability descriptor and sizing

2018-03-12 Thread Alexey Gerasimenko
The patch provides Vendor-specific PCIe Extended Capability description structure and corresponding sizing function. In this particular case the size of the Vendor capability is available in the VSEC Length field. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> ---

[Xen-devel] [RFC PATCH 23/30] xen/pt: handle PCIe Extended Capabilities Next register

2018-03-12 Thread Alexey Gerasimenko
the Next capability pointer value. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 73 +++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c

[Xen-devel] [RFC PATCH 27/30] xen/pt: add AER PCIe Extended Capability descriptor and sizing

2018-03-12 Thread Alexey Gerasimenko
The patch provides Advanced Error Reporting PCIe Extended Capability description structure and corresponding capability sizing function. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 72 + 1 file chang

[Xen-devel] [RFC PATCH 14/30] pc/q35: Apply PCI bus BSEL property for Xen PCI device hotplug

2018-03-12 Thread Alexey Gerasimenko
, in a way similar to what find_i440fx does. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/acpi/pcihp.c | 6 +- hw/pci-host/q35.c| 8 include/hw/i386/pc.h | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c

[Xen-devel] [RFC PATCH 28/30] xen/pt: add descriptors and size calculation for RCLD/ACS/PMUX/DPA/MCAST/TPH/DPC PCIe Extended Capabilities

2018-03-12 Thread Alexey Gerasimenko
is hidden) Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 224 1 file changed, 224 insertions(+) diff --git a/hw/xen/xen_pt_config_init.c b/hw/xen/xen_pt_config_init.c index 98aae3daca..326f5671ff 100

[Xen-devel] [RFC PATCH 26/30] xen/pt: add fixed-size PCIe Extended Capabilities descriptors

2018-03-12 Thread Alexey Gerasimenko
registers are passed through at the moment (unless they belong to a "hardwired" capability which is hidden) Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 183 1 file changed, 183 insertions(+) dif

[Xen-devel] [RFC PATCH 24/30] xen/pt: allow to hide PCIe Extended Capabilities

2018-03-12 Thread Alexey Gerasimenko
is returned. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt.c | 11 +++- hw/xen/xen_pt.h | 5 hw/xen/xen_pt_config_init.c | 62 - 3 files changed, 76 insertions(+), 2 deletions(-) diff --git a/

[Xen-devel] [RFC PATCH 22/30] xen/pt: add support for PCIe Extended Capabilities and larger config space

2018-03-12 Thread Alexey Gerasimenko
f it's an Extended one by using IS_PCIE_EXT_CAP_ID(cap) macro, passing the real capabiliy ID value to either xen_host_pci_find_next_ext_cap or xen_host_pci_find_next_cap. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt.c | 14 +- hw/xen/xen_pt.h

[Xen-devel] [RFC PATCH 21/30] xen/pt: Xen PCIe passthrough support for Q35: bypass PCIe topology check

2018-03-12 Thread Alexey Gerasimenko
hile using this approach, so it's a good temporary solution until multiple PCI bus support will be added to Xen. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt_config_init.c | 60 + 1 file changed, 60 insertio

[Xen-devel] [RFC PATCH 18/30] xen/pt: XenHostPCIDevice: provide functions for PCI Capabilities and PCIe Extended Capabilities enumeration

2018-03-12 Thread Alexey Gerasimenko
). In order not to probe PCIe Extended Capabilities existence every time, xen_host_pci_find_next_ext_cap makes use of the new 'has_pcie_ext_caps' field in XenHostPCIDevice structure which is filled only once (in xen_host_pci_device_get). Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> ---

[Xen-devel] [RFC PATCH 17/30] q35: Fix incorrect values for PCIEXBAR masks

2018-03-12 Thread Alexey Gerasimenko
memory layout corruption where emulated MMIO regions may overlap real (passed through) MMIO ranges. Fix this by providing correct values. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/pci-host/q35.c | 6 +++--- include/hw/pci-host/q35.h | 4 ++-- 2 files changed, 5 inse

[Xen-devel] [RFC PATCH 15/30] q35/acpi/xen: Provide ACPI PCI hotplug interface for Xen on Q35

2018-03-12 Thread Alexey Gerasimenko
). Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/acpi/ich9.c | 24 hw/acpi/pcihp.c | 2 +- include/hw/acpi/ich9.h | 2 ++ include/hw/acpi/pcihp.h | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/hw/acpi/ich9.c b/hw/acp

[Xen-devel] [RFC PATCH 13/30] pc/xen: Xen Q35 support: provide IRQ handling for PCI devices

2018-03-12 Thread Alexey Gerasimenko
ing is logged. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/i386/pc_q35.c | 13 ++--- hw/i386/xen/xen-hvm.c | 32 +--- hw/isa/lpc_ich9.c | 4 hw/pci-host/piix.c | 2 +- include/hw/i386/ich9.h | 1 + include/hw/xen/xen

[Xen-devel] [RFC PATCH 20/30] xen/pt: determine the legacy/PCIe mode for a passed through device

2018-03-12 Thread Alexey Gerasimenko
eck. This way we get consistent behavior when the same PCIe device being passed through to either i440 domain or Q35 one. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen_pt.c | 28 ++-- hw/xen/xen_pt.h | 1 + 2 files changed, 27 insertions(+), 2

[Xen-devel] [RFC PATCH 19/30] xen/pt: avoid reading PCIe device type and cap version multiple times

2018-03-12 Thread Alexey Gerasimenko
iptive get_pcie_device_type and get_pcie_capability_version. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- hw/xen/xen-host-pci-device.c | 15 +++ hw/xen/xen-host-pci-device.h | 1 + hw/xen/xen_pt_config_init.c | 34 ++ 3 files changed, 3

[Xen-devel] [RFC PATCH 12/12] docs: provide description for device_model_machine option

2018-03-12 Thread Alexey Gerasimenko
This patch adds description for 'device_model_machine' option which allows to control which chipset will be emulated by device model. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- docs/man/xl.cfg.pod.5.in | 27 +++ 1 file changed, 27 insertions(+) diff

[Xen-devel] [RFC PATCH 08/12] libxl: Q35 support (new option device_model_machine)

2018-03-12 Thread Alexey Gerasimenko
it is controlled via a machine property only. See 'libxl: Xen Platform device support for Q35' patch for a detailed description. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/libxl/libxl_dm.c | 16 ++-- tools/libxl/libxl_types.idl | 7 +++ tools/xl/xl_pa

[Xen-devel] [RFC PATCH 01/12] libacpi: new DSDT ACPI table for Q35

2018-03-12 Thread Alexey Gerasimenko
supported As we are still using 4 PCI router links and their corresponding device/register addresses are same (offset 0x60), no need to change PCI routing descriptions. Also, ACPI hotplug is still used to control passed through device hot (un)plug (as it was for i440). Signed-off-by: Alexey

[Xen-devel] [RFC PATCH 11/12] hvmloader: use libacpi to build MCFG table

2018-03-12 Thread Alexey Gerasimenko
optional ACPI tables building. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/firmware/hvmloader/util.c | 70 + 1 file changed, 70 insertions(+) diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c index d8db

[Xen-devel] [RFC PATCH 07/12] hvmloader: allocate MMCONFIG area in the MMIO hole + minor code refactoring

2018-03-12 Thread Alexey Gerasimenko
PACE) == - PCI_BASE_ADDRESS_SPACE_MEMORY) ) +if ( bars[i].is_mem ) Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/firmware/hvmloader/config.h | 4 ++ tools/firmware/hvmloader/pci.c | 127 tools/firmware/hvmloader/

[Xen-devel] [RFC PATCH 04/12] hvmloader: add ACPI enabling for Q35

2018-03-12 Thread Alexey Gerasimenko
In order to turn on ACPI for OS, we need to write a chipset-specific value to SMI_CMD register (sort of imitation of the APM->ACPI switch on real systems). Modify acpi_enable_sci() function to support both i440 and Q35 emulation. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> -

[Xen-devel] [RFC PATCH 03/12] hvmloader: add function to query an emulated machine type (i440/Q35)

2018-03-12 Thread Alexey Gerasimenko
This adds a new function get_pc_machine_type() which allows to determine the emulated chipset type. Supported return values: - MACHINE_TYPE_I440 - MACHINE_TYPE_Q35 - MACHINE_TYPE_UNKNOWN, results in the error message being printed followed by calling BUG() in hvmloader. Signed-off-by: Alexey

[Xen-devel] [RFC PATCH 05/12] hvmloader: add Q35 DSDT table loading

2018-03-12 Thread Alexey Gerasimenko
Allows to select Q35 DSDT table in hvmloader_acpi_build_tables(). Function get_pc_machine_type() is used to select a proper table (i440/q35). As we are bound to the qemu-xen device model for Q35, no need to initialize config->dsdt_15cpu/config->dsdt_15cpu_len fields. Signed-off-by:

[Xen-devel] [RFC PATCH 10/12] libacpi: build ACPI MCFG table if requested

2018-03-12 Thread Alexey Gerasimenko
space per bus). Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/libacpi/acpi2_0.h | 21 + tools/libacpi/build.c | 42 ++ tools/libacpi/libacpi.h | 4 3 files changed, 67 insertions(+) diff --git a/tools/libacpi/a

[Xen-devel] [RFC PATCH 06/12] hvmloader: add basic Q35 support

2018-03-12 Thread Alexey Gerasimenko
} routing accordingly to the emulated south bridge (either located on PCI_ISA_DEVFN or PCI_ICH9_LPC_DEVFN). Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/firmware/hvmloader/config.h | 1 + tools/firmware/hvmloader/pci.c| 162 -- 2

[Xen-devel] [RFC PATCH 09/12] libxl: Xen Platform device support for Q35

2018-03-12 Thread Alexey Gerasimenko
ed-off-by: Alexey Gerasimenko <x19...@gmail.com> --- tools/libxl/libxl_dm.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c index 7b531050c7..586035aa73 100644 --- a/tools/libxl/libxl_dm.c +++ b/tools/libxl/libxl_dm.c @@ -144

[Xen-devel] [RFC PATCH 02/12] Makefile: build and use new DSDT table for Q35

2018-03-12 Thread Alexey Gerasimenko
Provide building for newly added dsdt_q35.asl file, in a way similar to dsdt.asl. Note that '15cpu' ACPI tables are only applicable to qemu-traditional (which have no support for Q35), so we need to use 'anycpu' version only. Signed-off-by: Alexey Gerasimenko <x19...@gmail.com> ---

[Xen-devel] [RFC PATCH 00/30] Xen Q35 Bringup patches + support for PCIe Extended Capabilities for passed through devices

2018-03-12 Thread Alexey Gerasimenko
ies further, for now I expect some comments/suggestions/testing results/bugreports. [1]: https://lists.xen.org/archives/html/xen-devel/2017-07/msg01077.html [2]: https://lists.gnu.org/archive/html/qemu-devel/2017-12/msg03572.html Xen changes: Alexey Gerasimenko (12): libacpi: new DSDT ACPI