[Xen-devel] Xen Q35 & virtual VTD support

2016-05-09 Thread Lan, Tianyu
Hi All: We are researching how to add virtual VTD support for Xen HVM guest. Current qemu has a basic virtual VTD support for Q35. I'd like to confirm whether Xen supports Q35 or not. Can we reuse it for Xen? Thanks. The motivations of adding virtual VTD support for Xen prepare for 1) Shared Vir

Re: [Xen-devel] Xen Q35 & virtual VTD support

2016-05-10 Thread Lan, Tianyu
current code or not. If yes, we can reuse Qemu virtual VTD for Xen with minor changes. Thanks, Stefano On Mon, 9 May 2016, Lan, Tianyu wrote: Hi All: We are researching how to add virtual VTD support for Xen HVM guest. Current qemu has a basic virtual VTD support for Q35. I'd li

Re: [Xen-devel] Xen Q35 & virtual VTD support

2016-05-10 Thread Lan, Tianyu
On 5/10/2016 10:52 PM, Anthony PERARD wrote: On Tue, May 10, 2016 at 10:31:38PM +0800, Lan, Tianyu wrote: On 5/10/2016 6:11 PM, Stefano Stabellini wrote: Hello Tianyu, What do you mean by reusing Q35 for Xen? If you mean using QEMU to emulate a Q35 based machine for HVM guests, I think that

Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc

2017-04-14 Thread Lan, Tianyu
: Lan Tianyu ; Kevin Tian ; Ian Jackson ; xen-devel@lists.xen.org Subject: Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc Tianyu is on vacation this two weeks, so I will try to address some comments on this series. On Tue, Mar 28, 2017 at 05:24:03PM +0100, Wei Liu wrote

Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc

2017-04-17 Thread Lan Tianyu
On 2017年04月17日 19:08, Wei Liu wrote: > On Fri, Apr 14, 2017 at 11:38:15PM +0800, Lan, Tianyu wrote: >> Hi Paul: >> Sorry for later response. >> >> On 3/31/2017 3:57 AM, Chao Gao wrote: >>> On Wed, Mar 29, 2017 at 09:08:06AM +, Paul Durran

Re: [Xen-devel] [RFC PATCH 2/23] DMOP: Introduce new DMOP commands for vIOMMU support

2017-04-18 Thread Lan Tianyu
Hi Konrad: Thanks for your review. On 2017年04月17日 22:36, Konrad Rzeszutek Wilk wrote: > On Fri, Mar 17, 2017 at 07:27:02PM +0800, Lan Tianyu wrote: >> This patch is to introduce create, destroy and query capabilities >> command for vIOMMU. vIOMMU layer will deal with re

Re: [Xen-devel] [RFC PATCH 3/23] VIOMMU: Add irq request callback to deal with irq remapping

2017-04-18 Thread Lan Tianyu
On 2017年04月17日 22:39, Konrad Rzeszutek Wilk wrote: > On Fri, Mar 17, 2017 at 07:27:03PM +0800, Lan Tianyu wrote: >> This patch is to add irq request callback for platform implementation >> to deal with irq remapping request. >> >> Signed-off-by: Lan Tianyu >

Re: [Xen-devel] [RFC PATCH 00/23] xen/vIOMMU: Add vIOMMU support with irq remapping fucntion on Intel platform

2017-04-18 Thread Lan Tianyu
On 2017年04月17日 22:41, Konrad Rzeszutek Wilk wrote: > On Mon, Mar 20, 2017 at 02:23:02PM +, Roger Pau Monné wrote: >> On Fri, Mar 17, 2017 at 07:27:00PM +0800, Lan Tianyu wrote: >>> This patchset is to introduce vIOMMU framework and add virtual VTD's >>> inter

Re: [Xen-devel] [RFC PATCH 15/23] X86/vioapic: Hook interrupt delivery of vIOAPIC

2017-04-18 Thread Lan Tianyu
On 2017年04月17日 22:43, Konrad Rzeszutek Wilk wrote: > On Fri, Mar 17, 2017 at 07:27:15PM +0800, Lan Tianyu wrote: >> From: Chao Gao >> >> When irq remapping enabled, IOAPIC Redirection Entry maybe is in remapping >> format. If that, generate a irq_remapping_re

Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc

2017-04-18 Thread Lan Tianyu
On 2017年04月18日 17:08, Paul Durrant wrote: >> -Original Message- >> From: Lan, Tianyu [mailto:tianyu@intel.com] >> Sent: 14 April 2017 16:38 >> To: Paul Durrant ; Wei Liu ; >> Kevin Tian ; Ian Jackson ; >> xen-devel@lists.xen.org >> Subject: Re

Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc

2017-04-19 Thread Lan Tianyu
On 2017年04月18日 22:15, Paul Durrant wrote: >> -Original Message- > [snip] >>> > > >>> > > Not quite sure I understand this. The QEMu device model does not 'pass >> > DMA requests' as such, it maps guest RAM and reads or writes to emulate >> > DMA, right? So, what's needed is a mechanism to m

Re: [Xen-devel] [RFC PATCH 5/23] Tools/libxc: Add viommu operations in libxc

2017-05-11 Thread Lan Tianyu
On 2017年05月11日 20:35, Wei Liu wrote: > On Mon, Apr 17, 2017 at 08:01:56PM +0800, Lan Tianyu wrote: >> On 2017年04月17日 19:08, Wei Liu wrote: >>> On Fri, Apr 14, 2017 at 11:38:15PM +0800, Lan, Tianyu wrote: >>>> Hi Paul: >>>>Sorry for later response. >

[Xen-devel] [RFC PATCH V2 0/2] Qemu: Add Xen vIOMMU interrupt remapping function.

2017-05-18 Thread Lan Tianyu
Change since V1: 1) Move create/destroy vIOMMU and query vIOMMU capabilities to tool stack. 2) Fix some code style issue. This patchset is to deal with MSI interrupt remapping request when guest updates MSI registers. Repo: https://github.com/lantianyu/qemu/tree/xen_viommu_rfc_v2

[Xen-devel] [RFC PATCH V2 2/2] msi: Handle remappable format interrupt request

2017-05-18 Thread Lan Tianyu
binded with an event channel. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- hw/pci/msi.c | 5 +++-- hw/pci/msix.c| 4 +++- hw/xen/xen_pt_msi.c | 2 +- include/hw/xen/xen.h | 2 +- xen-hvm-stub.c | 2 +- xen-hvm.c| 7 ++- 6 files changed, 15 insertions

[Xen-devel] [RFC PATCH V2 1/2] xen-pt: bind/unbind interrupt remapping format MSI

2017-05-18 Thread Lan Tianyu
d-off-by: Chao Gao Signed-off-by: Lan Tianyu --- hw/xen/xen_pt_msi.c | 50 --- include/hw/i386/apic-msidef.h | 3 ++- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c index 62add06..5f

[Xen-devel] [RFC PATCH V2 1/26] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities

2017-05-18 Thread Lan Tianyu
This patch is to introduct an abstract layer for arch vIOMMU implementation to deal with requests from dom0. Arch vIOMMU code needs to provide callback to perform create, destroy and query capabilities operation. Signed-off-by: Lan Tianyu --- xen/arch/x86/setup.c| 1 + xen/common

[Xen-devel] [RFC PATCH V2 2/26] DOMCTL: Introduce new DOMCTL commands for vIOMMU support

2017-05-18 Thread Lan Tianyu
This patch is to introduce create, destroy and query capabilities command for vIOMMU. vIOMMU layer will deal with requests and call arch vIOMMU ops. Signed-off-by: Lan Tianyu --- xen/common/domctl.c | 3 +++ xen/common/viommu.c | 35 +++ xen

[Xen-devel] [RFC PATCH V2 6/26] Tools/libxc: Add viommu operations in libxc

2017-05-18 Thread Lan Tianyu
viommu_id Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- tools/libxc/Makefile | 1 + tools/libxc/include/xenctrl.h | 7 tools/libxc/xc_viommu.c | 81 +++ 3 files changed, 89 insertions(+) create mode 100644 tools/libxc/xc_viommu.c

[Xen-devel] [RFC PATCH V2 9/26] Tools/libacpi: Add a user configurable parameter to control vIOMMU attributes

2017-05-18 Thread Lan Tianyu
configuration and to pass though it to hvmloader via xenstore ACPI PT channel. If there are ACPI tables needed to pass through, we joint the tables. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- docs/man/xl.cfg.pod.5.in| 34 +- tools/libacpi/build.c | 5

[Xen-devel] [RFC PATCH V2 8/26] Tools/libacpi: Add new fields in acpi_config to build DMAR table

2017-05-18 Thread Lan Tianyu
remapping is supported and whether enabling X2APIC mode is premitted. The other is the base address of remapping hardware register-set for a remapping unit. Also, a function construct_dmar() is added to build DMAR table according the two fields. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu

[Xen-devel] [RFC PATCH V2 12/26] X86/vvtd: Add MMIO handler for VVTD

2017-05-18 Thread Lan Tianyu
From: Chao Gao This patch adds VVTD MMIO handler to deal with MMIO access. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 127 1 file changed, 127 insertions(+) diff --git a/xen/arch/x86/hvm/vvtd.c b/xen/arch

[Xen-devel] [RFC PATCH V2 20/26] passthrough: move some fields of hvm_gmsi_info to a sub-structure

2017-05-18 Thread Lan Tianyu
From: Chao Gao No functional change. It is a preparation for introducing new fields in hvm_gmsi_info to manage remapping format msi bound to a physical msi. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vmsi.c | 4 ++-- xen/drivers/passthrough/io.c | 32

[Xen-devel] [RFC PATCH V2 10/26] libxl: create vIOMMU during domain construction

2017-05-18 Thread Lan Tianyu
From: Chao Gao If guest is configured to have a vIOMMU, create it during domain construction. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- tools/libxl/libxl_arch.h | 5 + tools/libxl/libxl_arm.c| 7 +++ tools/libxl/libxl_create.c | 4 tools/libxl/libxl_x86.c

[Xen-devel] [RFC PATCH V2 13/26] X86/vvtd: Set Interrupt Remapping Table Pointer through GCMD

2017-05-18 Thread Lan Tianyu
to track info (e.g. the table's gfn and max supported entries) of interrupt remapping table. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 70 + xen/drivers/passthrough/vtd/iommu.h | 9 - 2 files change

[Xen-devel] [RFC PATCH V2 16/26] x86/vioapic: Hook interrupt delivery of vIOAPIC

2017-05-18 Thread Lan Tianyu
s validity. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vioapic.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/xen/arch/x86/hvm/vioapic.c b/xen/arch/x86/hvm/vioapic.c index abcc473..40f529c 100644 --- a/xen/arch/x86/hvm/vioapic.c +++ b/xen/arch/x86/hvm

[Xen-devel] [RFC PATCH V2 14/26] X86/vvtd: Process interrupt remapping request

2017-05-18 Thread Lan Tianyu
quest() to emulate the process how remapping hardware handles a remapping interrupt request. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 279 +++- xen/drivers/passthrough/vtd/iommu.h | 21 +++ xen/drivers/passthrough

[Xen-devel] [RFC PATCH V2 19/26] x86/vpt: Get interrupt vector through a vioapic interface

2017-05-18 Thread Lan Tianyu
From: Chao Gao When IOAPIC RTE is in remapping format, it doesn't contain the vector of interrupt. This patch adds vioapic_gsi_vector() to translate pin to vector. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vioapic.c| 27 +++

[Xen-devel] [RFC PATCH V2 5/26] Xen/doc: Add Xen virtual IOMMU doc

2017-05-18 Thread Lan Tianyu
This patch is to add Xen virtual IOMMU doc to introduce motivation, framework, vIOMMU hypercall and xl configuration. Signed-off-by: Lan Tianyu --- docs/misc/viommu.txt | 129 +++ 1 file changed, 129 insertions(+) create mode 100644 docs/misc

[Xen-devel] [RFC PATCH V2 00/26] xen/vIOMMU: Add vIOMMU support with irq remapping fucntion of virtual vtd

2017-05-18 Thread Lan Tianyu
format msi to guest x86/vvtd: Handle interrupt translation faults x86/vvtd: Add queued invalidation (QI) support x86/vlapic: drop no longer suitable restriction to set x2apic id x86/vvtd: save and restore emulated VT-d Lan Tianyu (5): VIOMMU: Add vIOMMU helper functions to create, destroy a

[Xen-devel] [RFC PATCH V2 15/26] x86/vvtd: decode interrupt attribute from IRTE

2017-05-18 Thread Lan Tianyu
: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 22 +- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vvtd.c b/xen/arch/x86/hvm/vvtd.c index c993a15..57932cb 100644 --- a/xen/arch/x86/hvm/vvtd.c +++ b/xen/arch/x86/hvm/vvtd.c

[Xen-devel] [RFC PATCH V2 24/26] x86/vvtd: Add queued invalidation (QI) support

2017-05-18 Thread Lan Tianyu
), which is a circular buffer in system memory. Software submits commands by writing Invalidation Descriptors to the IQ. In this patch, a new function viommu_process_iq() is used for emulating how hardware handles invalidation requests through QI. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu

[Xen-devel] [RFC PATCH V2 18/26] X86/vvtd: Enable Interrupt Remapping through GCMD

2017-05-18 Thread Lan Tianyu
From: Chao Gao Software writes this field to enable/disable interrupt reampping. This patch emulate IRES field of GCMD. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 26 ++ xen/drivers/passthrough/vtd/iommu.h | 3 ++- 2

[Xen-devel] [RFC PATCH V2 7/26] Tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table structures

2017-05-18 Thread Lan Tianyu
From: Chao Gao Add dmar table structure according Chapter 8 "BIOS Considerations" of VTd spec Rev. 2.4. VTd spec:http://www.intel.com/content/dam/www/public/us/en/documents/product-specifications/vt-directed-io-spec.pdf Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- too

[Xen-devel] [RFC PATCH V2 3/26] VIOMMU: Add irq request callback to deal with irq remapping

2017-05-18 Thread Lan Tianyu
This patch is to add irq request callback for platform implementation to deal with irq remapping request. Signed-off-by: Lan Tianyu --- xen/common/viommu.c | 15 + xen/include/asm-x86/viommu.h | 73 xen/include/xen/viommu.h | 9

[Xen-devel] [RFC PATCH V2 17/26] X86/vvtd: Enable Queued Invalidation through GCMD

2017-05-18 Thread Lan Tianyu
From: Chao Gao Software writes to QIE fields of GCMD to enable or disable queued invalidations. This patch emulates QIE fields of GCMD. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 18 ++ xen/drivers/passthrough/vtd/iommu.h | 3

[Xen-devel] [RFC PATCH V2 4/26] VIOMMU: Add get irq info callback to convert irq remapping request

2017-05-18 Thread Lan Tianyu
This patch is to add get_irq_info callback for platform implementation to convert irq remapping request to irq info (E,G vector, dest, dest_mode and so on). Signed-off-by: Lan Tianyu --- xen/common/viommu.c | 16 xen/include/asm-x86/viommu.h | 8 xen/include

[Xen-devel] [RFC PATCH V2 21/26] Tools/libxc: Add a new interface to bind remapping format msi with pirq

2017-05-18 Thread Lan Tianyu
From: Chao Gao Introduce a new binding relationship and provide a new interface to manage the new relationship. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- tools/libxc/include/xenctrl.h | 17 ++ tools/libxc/xc_domain.c | 55 + xen/drivers/passthrough

[Xen-devel] [RFC PATCH V2 11/26] x86/hvm: Introduce a emulated VTD for HVM

2017-05-18 Thread Lan Tianyu
From: Chao Gao This patch adds create/destroy/query function for the emulated VTD and adapts it to the common VIOMMU abstraction. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/Makefile | 1 + xen/arch/x86/hvm/vvtd.c | 176

[Xen-devel] [RFC PATCH V2 25/26] x86/vlapic: drop no longer suitable restriction to set x2apic id

2017-05-18 Thread Lan Tianyu
From: Chao Gao If vlapic is in x2apic mode in saving process, we should set it's x2apic id when restoring. Just drop the unsuitable restrition as the existing comment says. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vlapic.c | 18 ++ 1 file ch

[Xen-devel] [RFC PATCH V2 23/26] x86/vvtd: Handle interrupt translation faults

2017-05-18 Thread Lan Tianyu
viommu_report_non_recoverable_fault() reports faults to software. Currently, only Primary Fault Logging is supported and the Number of Fault-recording Registers is 1. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c | 237 +++-

[Xen-devel] [RFC PATCH V2 22/26] x86/vmsi: Hook delivering remapping format msi to guest

2017-05-18 Thread Lan Tianyu
if it is in remapping format. For the latter, if the pt irq is bound to a guest remapping msi, a new remapping msi is constructed based on the binding information and routed to common vIOMMU layer. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/irq.c | 11

[Xen-devel] [RFC PATCH V2 26/26] x86/vvtd: save and restore emulated VT-d

2017-05-18 Thread Lan Tianyu
From: Chao Gao Wrap some useful status in a new structure hvm_hw_vvtd, following the customs of vlapic, vioapic and etc. Provide two save-restore pairs to save/restore registers and non-register status. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- xen/arch/x86/hvm/vvtd.c

Re: [Xen-devel] [RFC PATCH V2 2/2] msi: Handle remappable format interrupt request

2017-05-21 Thread Lan Tianyu
Hi Anthony: Thanks for your review. On 2017年05月19日 19:57, Anthony PERARD wrote: > On Thu, May 18, 2017 at 01:33:00AM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> According to VT-d spec Interrupt Remapping and Interrupt Posting -> >> Interrupt Remapping -

Re: [Xen-devel] [RFC PATCH V2 1/2] xen-pt: bind/unbind interrupt remapping format MSI

2017-05-23 Thread Lan Tianyu
On 2017年05月19日 20:04, Jan Beulich wrote: >>>> On 19.05.17 at 13:16, wrote: >> On Thu, May 18, 2017 at 01:32:59AM -0400, Lan Tianyu wrote: >>> --- a/include/hw/i386/apic-msidef.h >>> +++ b/include/hw/i386/apic-msidef.h >>> @@ -26,6 +26,7 @@ >>

Re: [Xen-devel] [RFC PATCH V2 1/2] xen-pt: bind/unbind interrupt remapping format MSI

2017-05-23 Thread Lan Tianyu
On 2017年05月24日 01:06, Anthony PERARD wrote: > On Tue, May 23, 2017 at 08:16:25PM +0800, Lan Tianyu wrote: >> On 2017年05月19日 20:04, Jan Beulich wrote: >>>>>> On 19.05.17 at 13:16, wrote: >>>> On Thu, May 18, 2017 at 01:32:59AM -0400, Lan Tianyu wrote: &g

Re: [Xen-devel] [RFC PATCH V2 1/26] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities

2017-06-02 Thread Lan Tianyu
Hi Jan: Thanks for your review. On 2017年05月30日 23:42, Jan Beulich wrote: >>>> On 30.05.17 at 17:36, wrote: >> On Thu, May 18, 2017 at 01:34:31AM -0400, Lan Tianyu wrote: >>> --- a/xen/common/Kconfig >>> +++ b/xen/common/Kconfig >>> @@ -

[Xen-devel] [PATCH] x86: Skip check apic_id_limit for Xen

2017-08-15 Thread Lan Tianyu
Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU check for Xen here when vcpu number is more than 255. Signed-off-by: Lan Tianyu --- hw/i386/pc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5943539..fc17885 100644 --- a/hw

Re: [Xen-devel] [PATCH] x86: Skip check apic_id_limit for Xen

2017-08-16 Thread Lan Tianyu
On 2017年08月16日 19:21, Paolo Bonzini wrote: > On 16/08/2017 02:22, Lan Tianyu wrote: >> Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU >> check for Xen here when vcpu number is more than 255. > > I think you still need to do a check for vIOMMU being enabled. Y

Re: [Xen-devel] [PATCH V2 1/25] DOMCTL: Introduce new DOMCTL commands for vIOMMU support

2017-08-17 Thread Lan Tianyu
Hi Wei: Thanks for your review. On 2017年08月17日 19:18, Wei Liu wrote: > On Wed, Aug 09, 2017 at 04:34:02PM -0400, Lan Tianyu wrote: >> diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h >> index ff39762..4b10f26 100644 >> --- a/xen/include/public/

[Xen-devel] [PATCH V2 1/25] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities

2017-08-17 Thread Lan Tianyu
This patch is to introduct an abstract layer for arch vIOMMU implementation to deal with requests from dom0. Arch vIOMMU code needs to provide callback to perform create, destroy and query capabilities operation. Signed-off-by: Lan Tianyu --- xen/arch/x86/Kconfig | 1 + xen/arch/x86

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-18 Thread Lan Tianyu
On 2017年08月17日 19:18, Wei Liu wrote: > On Wed, Aug 09, 2017 at 04:34:03PM -0400, Lan Tianyu wrote: >> This patch is to add irq request callback for platform implementation >> to deal with irq remapping request. >> >> Signed-off-by: Lan Tianyu >> --- >

Re: [Xen-devel] [PATCH V2 4/25] Xen/doc: Add Xen virtual IOMMU doc

2017-08-18 Thread Lan Tianyu
On 2017年08月17日 19:19, Wei Liu wrote: > On Wed, Aug 09, 2017 at 04:34:05PM -0400, Lan Tianyu wrote: >> +Now just suppport single vIOMMU for one VM and introduced domctls are >> compatible >> +with multi-vIOMMU support. > > Is this still true? Yes, the patchset just

Re: [Xen-devel] [PATCH V2 1/25] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities

2017-08-18 Thread Lan Tianyu
d query capabilities operation. >> >> Signed-off-by: Lan Tianyu > > What is this? It looks to be a standalone patch when there was > a V2 series a couple of days ago with 1/25 titled "DOMCTL: > Introduce new DOMCTL commands for vIOMMU support". I'm > confuse

Re: [Xen-devel] [PATCH] x86: Skip check apic_id_limit for Xen

2017-08-20 Thread Lan Tianyu
On 2017年08月19日 00:38, Eduardo Habkost wrote: > On Thu, Aug 17, 2017 at 09:37:10AM +0800, Lan Tianyu wrote: >> On 2017年08月16日 19:21, Paolo Bonzini wrote: >>> On 16/08/2017 02:22, Lan Tianyu wrote: >>>> Xen vIOMMU device model will be in Xen hypervisor. Skip vIOMMU >

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-22 Thread Lan Tianyu
t; >> --- /dev/null >>> > >> +++ b/xen/include/asm-x86/viommu.h >>> > >> @@ -0,0 +1,73 @@ >>> > >> +/* >>> > >> + * include/asm-x86/viommu.h >>> > >> + * >>> > >> + * Copyright (c) 2017 Intel Corpor

Re: [Xen-devel] [PATCH V2 4/25] Xen/doc: Add Xen virtual IOMMU doc

2017-08-22 Thread Lan Tianyu
On 2017年08月18日 18:15, Wei Liu wrote: > On Fri, Aug 18, 2017 at 03:17:37PM +0800, Lan Tianyu wrote: >> On 2017年08月17日 19:19, Wei Liu wrote: >>> On Wed, Aug 09, 2017 at 04:34:05PM -0400, Lan Tianyu wrote: >>>> +Now just suppport single vIOMMU for one VM and introduce

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 16:42, Wei Liu wrote: > On Tue, Aug 22, 2017 at 04:04:09PM +0800, Lan Tianyu wrote: >> On 2017年08月18日 18:13, Wei Liu wrote: >>>>> ASSERT(info->viommu[viommu_id]->ops); >>>>>>> >>>>>>> For extra safety. >>&

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 18:53, Wei Liu wrote: > On Tue, Aug 22, 2017 at 06:39:32PM +0800, Lan Tianyu wrote: >> On 2017年08月22日 16:42, Wei Liu wrote: >>> On Tue, Aug 22, 2017 at 04:04:09PM +0800, Lan Tianyu wrote: >>>> On 2017年08月18日 18:13, Wei Liu wrote: >>>&

Re: [Xen-devel] [PATCH V2 4/25] Xen/doc: Add Xen virtual IOMMU doc

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 19:03, Wei Liu wrote: > On Tue, Aug 22, 2017 at 04:07:32PM +0800, Lan Tianyu wrote: >> On 2017年08月18日 18:15, Wei Liu wrote: >>> On Fri, Aug 18, 2017 at 03:17:37PM +0800, Lan Tianyu wrote: >>>> On 2017年08月17日 19:19, Wei Liu wrote: >>>>>

Re: [Xen-devel] [PATCH V2 7/25] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 21:12, Wei Liu wrote: > On Wed, Aug 09, 2017 at 04:34:08PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> The BIOS reports the remapping hardware units in a platform to system >> software >> through the DMA Remapping Reporting (DMAR) ACPI table.

Re: [Xen-devel] [PATCH V2 8/25] tools/libxl: Add a user configurable parameter to control vIOMMU attributes

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 21:19, Wei Liu wrote: >> +=over 4 >> > + >> > +=item B >> > + >> > +Possible Bs are: >> > + >> > +=over 4 >> > + >> > +=item B >> > + >> > +Currently there is only one valid type: >> > + >> > +(x86 only) "intel_vtd" means providing a emulated Intel VT-d to the guest. >> > + >> > +=it

Re: [Xen-devel] [PATCH V2 6/25] tools/libacpi: Add DMA remapping reporting (DMAR) ACPI table structures

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 20:56, Wei Liu wrote: > On Wed, Aug 09, 2017 at 04:34:07PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> Add dmar table structure according Chapter 8 "BIOS Considerations" of >> VTd spec Rev. 2.4. >> >> VTd >> spec:http

Re: [Xen-devel] [PATCH V2 9/25] tools/libxl: build DMAR table for a guest with one virtual VTD

2017-08-22 Thread Lan Tianyu
On 2017年08月22日 21:48, Wei Liu wrote: >> > Hi, Wei >> > Thanks for your comments. >> > >> > iirc, HVM only supports one module; DMAR cannot be a new module. Joining to >> > the existing one is the approach we are taking. >> > >> > Which kind of conflicts you think should be resolved? If you mean

Re: [Xen-devel] [PATCH V2 1/25] DOMCTL: Introduce new DOMCTL commands for vIOMMU support

2017-08-22 Thread Lan Tianyu
Hi Roger: Thanks for your review. On 2017年08月22日 22:32, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:02PM -0400, Lan Tianyu wrote: >> This patch is to introduce create, destroy and query capabilities >> command for vIOMMU. vIOMMU layer will deal with requests a

Re: [Xen-devel] [PATCH V2 1/25] VIOMMU: Add vIOMMU helper functions to create, destroy and query capabilities

2017-08-23 Thread Lan Tianyu
On 2017年08月22日 23:27, Roger Pau Monné wrote: > On Thu, Aug 17, 2017 at 08:22:16PM -0400, Lan Tianyu wrote: >> This patch is to introduct an abstract layer for arch vIOMMU implementation >> to deal with requests from dom0. Arch vIOMMU code needs to provide callback >> to perfor

Re: [Xen-devel] [PATCH V2 4/25] Xen/doc: Add Xen virtual IOMMU doc

2017-08-23 Thread Lan Tianyu
On 2017年08月22日 23:55, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:05PM -0400, Lan Tianyu wrote: >> This patch is to add Xen virtual IOMMU doc to introduce motivation, >> framework, vIOMMU hypercall and xl configuration. >> >> Signed-off-by: Lan Tianyu >

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-23 Thread Lan Tianyu
On 2017年08月22日 23:32, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:03PM -0400, Lan Tianyu wrote: >> This patch is to add irq request callback for platform implementation >> to deal with irq remapping request. >> >> Signed-off-by: Lan Tianyu >> --- >

Re: [Xen-devel] [PATCH V2 3/25] VIOMMU: Add get irq info callback to convert irq remapping request

2017-08-23 Thread Lan Tianyu
On 2017年08月22日 23:38, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:04PM -0400, Lan Tianyu wrote: >> This patch is to add get_irq_info callback for platform implementation >> to convert irq remapping request to irq info (E,G vector, dest, dest_mode >> and so on). >

Re: [Xen-devel] [PATCH V2 7/25] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 00:41, Roger Pau Monné wrote: >> > +drhd = (struct acpi_dmar_hardware_unit *)((void*)dmar + >> > sizeof(*dmar)); >> > +drhd->type = ACPI_DMAR_TYPE_HARDWARE_UNIT; >> > +drhd->length = sizeof(*drhd) + ioapic_scope_size; >> > +drhd->flags = ACPI_DMAR_INCLUDE_PCI_ALL; >>

Re: [Xen-devel] [PATCH V2 10/25] tools/libxl: create vIOMMU during domain construction

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 15:45, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:11PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> If guest is configured to have a vIOMMU, create it during domain >> construction. >> >> Signed-off-by: Chao Gao >> Sign

Re: [Xen-devel] [PATCH V2 1/25] DOMCTL: Introduce new DOMCTL commands for vIOMMU support

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 15:22, Roger Pau Monné wrote: > On Wed, Aug 23, 2017 at 02:06:17PM +0800, Lan Tianyu wrote: >> Hi Roger: >> Thanks for your review. >> >> On 2017年08月22日 22:32, Roger Pau Monné wrote: >>> On Wed, Aug 09, 2017 at 04:34:02PM -0400, Lan

Re: [Xen-devel] [PATCH V2 2/25] VIOMMU: Add irq request callback to deal with irq remapping

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 17:24, Jan Beulich wrote: >>>> On 23.08.17 at 09:42, wrote: >> On 2017年08月22日 23:32, Roger Pau Monné wrote: >>> On Wed, Aug 09, 2017 at 04:34:03PM -0400, Lan Tianyu wrote: >>>> +static inline void irq_request_ioapic_fill(

Re: [Xen-devel] [PATCH V2 11/25] x86/hvm: Introduce a emulated VTD for HVM

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 15:58, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:12PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> This patch adds create/destroy/query function for the emulated VTD >> and adapts it to the common VIOMMU abstraction. >> >> Si

Re: [Xen-devel] [PATCH V2 7/25] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 16:04, Roger Pau Monné wrote: > On Wed, Aug 23, 2017 at 03:52:01PM +0800, Lan Tianyu wrote: >> On 2017年08月23日 00:41, Roger Pau Monné wrote: >>>>> +drhd = (struct acpi_dmar_hardware_unit *)((void*)dmar + >>>>> sizeof(*dmar)); >>>&

Re: [Xen-devel] [PATCH V2 9/25] tools/libxl: build DMAR table for a guest with one virtual VTD

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 16:34, Wei Liu wrote: > On Wed, Aug 23, 2017 at 01:35:17PM +0800, Lan Tianyu wrote: >> On 2017年08月22日 21:48, Wei Liu wrote: >>>>> Hi, Wei >>>>> Thanks for your comments. >>>>> >>>>> iirc, HVM only supports one modu

Re: [Xen-devel] [PATCH V2 16/25] x86/vioapic: Hook interrupt delivery of vIOAPIC

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 17:59, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:17PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> When irq remapping is enabled, IOAPIC Redirection Entry may be in remapping >> format. If that, generate an irq_remapping_request an

Re: [Xen-devel] [PATCH V2 19/25] x86/vioapic: extend vioapic_get_vector() to support remapping format RTE

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 18:14, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:20PM -0400, Lan Tianyu wrote: >> From: Chao Gao >> >> When IOAPIC RTE is in remapping format, it doesn't contain the vector of >> interrupt. For this case, the RTE contains an index of in

Re: [Xen-devel] [PATCH V2 24/25] x86/vvtd: Add queued invalidation (QI) support

2017-08-23 Thread Lan Tianyu
On 2017年08月23日 20:16, Roger Pau Monné wrote: > On Wed, Aug 09, 2017 at 04:34:25PM -0400, Lan Tianyu wrote: >> > From: Chao Gao >> > >> > Queued Invalidation Interface is an expanded invalidation interface with >> > extended capabilities. Hardware im

Re: [Xen-devel] [PATCH V2 19/25] x86/vioapic: extend vioapic_get_vector() to support remapping format RTE

2017-08-24 Thread Lan Tianyu
On 2017年08月24日 14:59, Jan Beulich wrote: >>>> On 24.08.17 at 08:11, wrote: >> On 2017年08月23日 18:14, Roger Pau Monné wrote: >>> On Wed, Aug 09, 2017 at 04:34:20PM -0400, Lan Tianyu wrote: >>>> --- a/xen/arch/x86/hvm/vioapic.c >>>> +++ b/xen/ar

Re: [Xen-devel] [PATCH V2 7/25] tools/libacpi: Add new fields in acpi_config for DMAR table

2017-08-24 Thread Lan Tianyu
On 2017年08月24日 14:54, Jan Beulich wrote: >>>> On 24.08.17 at 04:33, wrote: >> On 2017年08月23日 16:04, Roger Pau Monné wrote: >>> On Wed, Aug 23, 2017 at 03:52:01PM +0800, Lan Tianyu wrote: >>>> On 2017年08月23日 00:41, Roger Pau Monné wrote: >>>>>&

Re: [Xen-devel] [PATCH V2 11/25] x86/hvm: Introduce a emulated VTD for HVM

2017-08-24 Thread Lan Tianyu
On 2017年08月24日 16:49, Roger Pau Monné wrote: > On Thu, Aug 24, 2017 at 10:16:32AM +0800, Lan Tianyu wrote: >> On 2017年08月23日 15:58, Roger Pau Monné wrote: >>> On Wed, Aug 09, 2017 at 04:34:12PM -0400, Lan Tianyu wrote: >>>> From: Chao Gao >>>> +} >&g

Re: [Xen-devel] [PATCH V2 9/25] tools/libxl: build DMAR table for a guest with one virtual VTD

2017-08-24 Thread Lan Tianyu
On 2017年08月24日 19:08, Wei Liu wrote: If add dmar table for hvmlite, we should combine dmar table with other > >> ACPI table and populate into acpi_modules[2]. This is how hvmlite add > >> other ACPI tables in libxl__dom_load_acpi(). > >> >>> > > >>> > > Sure, that sounds plausi

Re: [Xen-devel] [PATCH V2 9/25] tools/libxl: build DMAR table for a guest with one virtual VTD

2017-08-25 Thread Lan Tianyu
On 2017年08月25日 11:19, Lan Tianyu wrote: > On 2017年08月24日 19:08, Wei Liu wrote: >>>>> If add dmar table for hvmlite, we should combine dmar table with other >>>>>>>> ACPI table and populate into acpi_modules[2]. This is how hvmlite add >>

[Xen-devel] [RFC PATCH 5/5] xl/libacpi: extend lapic_id() to uint32_t

2017-08-25 Thread Lan Tianyu
From: Chao Gao This patch is to extend lapic_id() to support more vcpus. Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- tools/firmware/hvmloader/util.c | 2 +- tools/libacpi/libacpi.h | 2 +- tools/libxl/libxl_x86_acpi.c| 2 +- 3 files changed, 3 insertions(+), 3 deletions

[Xen-devel] [RFC PATCH 4/5] hvmload: Add x2apic entry support in the MADT build

2017-08-25 Thread Lan Tianyu
This patch is to add x2apic entry support for ACPI MADT table. Signed-off-by: Lan Tianyu Signed-off-by: Chao Gao --- tools/libacpi/acpi2_0.h | 10 tools/libacpi/build.c | 61 ++--- 2 files changed, 53 insertions(+), 18 deletions(-) diff

[Xen-devel] [RFC PATCH 2/5] XL: Increase event channels to support more vcpus

2017-08-25 Thread Lan Tianyu
This patch is to increase event channels to support more vcpus in single VM. Signed-off-by: Lan Tianyu --- tools/libxl/libxl_create.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 1158303..3937169 100644 --- a

[Xen-devel] [RFC PATCH 3/5] Tool/ACPI: DSDT extension to support more vcpus

2017-08-25 Thread Lan Tianyu
This patch is to change DSDT table for processor object to support >255 vcpus. Signed-off-by: Lan Tianyu --- tools/libacpi/mk_dsdt.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tools/libacpi/mk_dsdt.c b/tools/libacpi/mk_dsdt.c index 2daf32c..d37aed6 100

[Xen-devel] [RFC PATCH 1/5] xen/hap: Increase hap size for more vcpus support

2017-08-25 Thread Lan Tianyu
This patch is to increase hap size to support more vcpus in single VM. Signed-off-by: Lan Tianyu --- xen/arch/x86/mm/hap/hap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index cdc77a9..cb81368 100644 --- a/xen/arch

[Xen-devel] [RFC PATCH 0/5] Extend resources to support more vcpus in single VM

2017-08-25 Thread Lan Tianyu
This patchset is to extend some resources(i.e, event channel, hap and so) to support more vcpus for single VM. Chao Gao (1): xl/libacpi: extend lapic_id() to uint32_t Lan Tianyu (4): xen/hap: Increase hap size for more vcpus support XL: Increase event channels to support more vcpus Tool

Re: [Xen-devel] [RFC PATCH 1/5] xen/hap: Increase hap size for more vcpus support

2017-08-28 Thread Lan, Tianyu
On 8/25/2017 5:14 PM, Wei Liu wrote: On Thu, Aug 24, 2017 at 10:52:16PM -0400, Lan Tianyu wrote: This patch is to increase hap size to support more vcpus in single VM. Signed-off-by: Lan Tianyu Can we maybe derive the number of pages needed from the number of vcpus? Yes, we can add check

Re: [Xen-devel] [RFC PATCH 2/5] XL: Increase event channels to support more vcpus

2017-08-28 Thread Lan, Tianyu
On 8/25/2017 6:04 PM, Wei Liu wrote: On Fri, Aug 25, 2017 at 10:57:26AM +0100, Roger Pau Monné wrote: On Fri, Aug 25, 2017 at 10:18:24AM +0100, Wei Liu wrote: On Thu, Aug 24, 2017 at 10:52:17PM -0400, Lan Tianyu wrote: This patch is to increase event channels to support more vcpus in single

Re: [Xen-devel] [RFC PATCH 3/5] Tool/ACPI: DSDT extension to support more vcpus

2017-08-28 Thread Lan, Tianyu
On 8/25/2017 5:25 PM, Wei Liu wrote: On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: This patch is to change DSDT table for processor object to support >255 vcpus. Can you provide a link to the spec so people can check if you modification is correct? OK. Will add in the n

Re: [Xen-devel] [RFC PATCH 4/5] hvmload: Add x2apic entry support in the MADT build

2017-08-28 Thread Lan Tianyu
On 2017年08月25日 18:11, Roger Pau Monné wrote: > On Thu, Aug 24, 2017 at 10:52:19PM -0400, Lan Tianyu wrote: >> This patch is to add x2apic entry support for ACPI MADT table. >> >> Signed-off-by: Lan Tianyu >> Signed-off-by: Chao Gao >> --- >> tools/li

Re: [Xen-devel] [RFC PATCH 0/5] Extend resources to support more vcpus in single VM

2017-08-28 Thread Lan Tianyu
On 2017年08月25日 22:10, Meng Xu wrote: > Hi Tianyu, > > On Thu, Aug 24, 2017 at 10:52 PM, Lan Tianyu wrote: >> >> This patchset is to extend some resources(i.e, event channel, >> hap and so) to support more vcpus for single VM. >> >> >> Chao Gao (1): &

Re: [Xen-devel] [RFC PATCH 3/5] Tool/ACPI: DSDT extension to support more vcpus

2017-08-28 Thread Lan Tianyu
On 2017年08月25日 20:01, Jan Beulich wrote: >>>> On 25.08.17 at 12:36, wrote: >> On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >>> This patch is to change DSDT table for processor object to support >255 >> vcpus. >> >> The note

Re: [Xen-devel] [RFC PATCH 3/5] Tool/ACPI: DSDT extension to support more vcpus

2017-08-28 Thread Lan Tianyu
On 2017年08月25日 18:36, Roger Pau Monné wrote: > On Thu, Aug 24, 2017 at 10:52:18PM -0400, Lan Tianyu wrote: >> This patch is to change DSDT table for processor object to support >255 >> vcpus. > > The note in ACPI 6.1A spec section 5.2.12.12 contains the following: >

Re: [Xen-devel] [RFC PATCH 0/5] Extend resources to support more vcpus in single VM

2017-08-29 Thread Lan Tianyu
On 2017年08月29日 16:49, Jan Beulich wrote: On 29.08.17 at 06:38, wrote: >> On 2017年08月25日 22:10, Meng Xu wrote: >>> How many VCPUs for a single VM do you want to support with this patch set? >> >> Hi Meng: >> Sorry for later response. We hope to increase max vcpu number to 512. >> This als

[Xen-devel] [RFC PATCH V2 2/4] Tool/ACPI: DSDT extension to support more vcpus

2017-08-31 Thread Lan Tianyu
This patch is to change DSDT table for processor object to support >128 vcpus accroding to ACPI spec 8.4 Declaring Processors Signed-off-by: Lan Tianyu --- tools/libacpi/mk_dsdt.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/libacpi/mk_dsdt.

[Xen-devel] [RFC PATCH V2 1/4] xen/hap: Increase hap page pool size for more vcpus support

2017-08-31 Thread Lan Tianyu
This patch is to increase hap page pool size to support more vcpus in single VM. Signed-off-by: Lan Tianyu --- xen/arch/x86/mm/hap/hap.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index cdc77a9..96a7ed0

[Xen-devel] [RFC PATCH V2 3/4] hvmload: Add x2apic entry support in the MADT build

2017-08-31 Thread Lan Tianyu
This patch is to add x2apic entry support for ACPI MADT table according to ACPI spec 5.2.12.12 Processor Local x2APIC Structure Signed-off-by: Chao Gao Signed-off-by: Lan Tianyu --- tools/libacpi/acpi2_0.h | 10 + tools/libacpi/build.c | 59

  1   2   3   4   >