Re: [Xen-devel] [PATCH v15 0/3] VT-d Device-TLB flush issue

2016-07-12 Thread Xu, Quan
as I don't have access to any suitable device. Therefore, > alongside the necessary ack-s, it would be nice if we could also get a > Tested-by > from someone who does have an ATS device. > (today I just come back to return my laptop and while test it) thanks for your work an

Re: [Xen-devel] [v9 00/19] QEMU:Xen stubdom vTPM for HVM virtual machine(QEMU Part)

2016-07-12 Thread Xu, Quan
Emil, Thanks for your effort ( today I just come back to return my laptop). btw, sstabell...@kernel.org may be the right email. Stefan / Stefano, could you help us review these patches? Thanks in advance!! Quan On July 10, 2016 7:48 PM, Emil Condrea wrote: > *INTRODUCTION* > The goal of v

Re: [Xen-devel] [PATCH v14 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-07-05 Thread Xu, Quan
Jan, Just check it, do you agree to pick up this series? Quan On July 05, 2016 9:46 PM, Jan Beulich wrote: > >>> On 04.07.16 at 11:11, wrote: > > --- a/xen/drivers/passthrough/iommu.c > > +++ b/xen/drivers/passthrough/iommu.c > > @@ -361,6 +361,30 @@ int iommu_iotlb_flush_all(struct domain *d)

Re: [Xen-devel] [PATCH RFC v1 09/14] Makefile: delete STUBDOMPATH target

2016-07-05 Thread Xu, Quan
il 01, 2016 6:03 PM, Wei Liu wrote: > On Fri, Apr 01, 2016 at 01:41:40AM +0000, Xu, Quan wrote: > > On March 31, 2016 9:50pm, Wei Liu wrote: > > > On Thu, Mar 31, 2016 at 10:21:22AM +, Xu, Quan wrote: > > > > On March 11, 2016 12:53am, Wei Liu wro

Re: [Xen-devel] [PATCH v14 1/3] IOMMU/x86: use a struct pci_dev* instead of SBDF

2016-07-05 Thread Xu, Quan
On July 05, 2016 9:38 PM, Jan Beulich wrote: > >>> On 04.07.16 at 11:11, wrote: > Since you had indicated that today is your last day at Intel, I guess I'll > see to > pick up this series (or maybe Kevin could) to bring it to the point where it > can > go in. > Jan, this is the best idea if

Re: [Xen-devel] [PATCH v14 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-07-05 Thread Xu, Quan
On July 05, 2016 3:00 PM, Jan Beulich wrote: > >>> On 05.07.16 at 04:04, wrote: > > On July 05, 2016 8:47 AM, Tian, Kevin wrote: > >> > From: Xu, Quan > >> > Sent: Monday, July 04, 2016 5:12 PM > >> > > >> > From: Quan Xu &

Re: [Xen-devel] [PATCH v14 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-07-04 Thread Xu, Quan
On July 05, 2016 8:47 AM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Monday, July 04, 2016 5:12 PM > > > > From: Quan Xu > > > > If Device-TLB flush timed out, we hide the target ATS device > > immediately. By hiding the device, we make sure it can&

[Xen-devel] [PATCH v14 1/3] IOMMU/x86: use a struct pci_dev* instead of SBDF

2016-07-04 Thread Xu, Quan
From: Quan Xu A struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev and parameter to *_ats_device(). Also use ats_dev for "struct pci_ats_dev" variable, while pdev (_pdev, if there is already a pdev) for "struct pci_dev" in the scope of IOMMU. Signed-off-by: Quan Xu Acked-by: K

[Xen-devel] [PATCH v14 2/3] IOMMU: add domain crash logic

2016-07-04 Thread Xu, Quan
From: Quan Xu Add domain crash logic to the generic IOMMU layer to benefit all platforms. No spamming of the log can occur. For DomU, we avoid logging any message for already dying domains. For Dom0, that'll still be more verbose than we'd really like, but it at least wouldn't outright flood the

[Xen-devel] [PATCH v14 0/3] VT-d Device-TLB flush issue

2016-07-04 Thread Xu, Quan
From: Quan Xu these patches fix current timeout concern and also allow limited ATS support. these patches are the rest ones: 1. move the domain crash logic up to the generic IOMMU layer 2. If Device-TLB flush timed out, we hide the target ATS device immediately. By hiding the device, we make

[Xen-devel] [PATCH v14 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-07-04 Thread Xu, Quan
From: Quan Xu If Device-TLB flush timed out, we hide the target ATS device immediately. By hiding the device, we make sure it can't be assigned to any domain any longer (see device_assigned). Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- v14: release the lock before

Re: [Xen-devel] [PATCH v13 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-07-03 Thread Xu, Quan
On July 04, 2016 2:16 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Wednesday, June 29, 2016 2:00 PM > > > > From: Quan Xu > > > > If Device-TLB flush timed out, we hide the target ATS device > > immediately. By hiding the device, we make sure

Re: [Xen-devel] [PATCH v13 1/3] IOMMU/x86: use a struct pci_dev* instead of SBDF

2016-07-03 Thread Xu, Quan
On July 04, 2016 1:35 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Wednesday, June 29, 2016 2:00 PM > > > > From: Quan Xu > > > > A struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev > > and parameter to *_ats_device(). > &

[Xen-devel] FW: vTPM detaching issue

2016-06-29 Thread Xu, Quan
On June 15, 2016 7:49 PM, < wei.l...@citrix.com > wrote: > On Tue, Jun 14, 2016 at 12:32:19PM +0200, Andrea Genuise wrote: > [...] > > libxl: debug: libxl_aoutils.c:88:xswait_timeout_callback: backend > > /local/domain/748/backend/vtpm/749/0/state (hoping for state change to > 6): > > xswait timeou

[Xen-devel] [PATCH v13 3/3] IOMMU: fix vt-d Device-TLB flush timeout issue

2016-06-28 Thread Xu, Quan
From: Quan Xu If Device-TLB flush timed out, we hide the target ATS device immediately. By hiding the device, we make sure it can't be assigned to any domain any longer (see device_assigned). Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- v13: 1. drop domain crash

[Xen-devel] [PATCH v13 0/3] VT-d Device-TLB flush issue

2016-06-28 Thread Xu, Quan
From: Quan Xu This patches fix current timeout concern and also allow limited ATS support. these patches are the rest ones: 1. move the domain crash logic up to the generic IOMMU layer 2. If Device-TLB flush timed out, we hide the target ATS device immediately. By hiding the device, we make

[Xen-devel] [PATCH v13 2/3] IOMMU: add domain crash logic

2016-06-28 Thread Xu, Quan
From: Quan Xu Add domain crash logic to the generic IOMMU layer to benefit all platforms. No spamming of the log can occur. For DomU, we avoid logging any message for already dying domains. For Dom0, that'll still be more verbose than we'd really like, but it at least wouldn't outright flood the

[Xen-devel] [PATCH v13 1/3] IOMMU/x86: use a struct pci_dev* instead of SBDF

2016-06-28 Thread Xu, Quan
From: Quan Xu A struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev and parameter to *_ats_device(). Also use ats_dev for "struct pci_ats_dev" variable, while pdev (_pdev, if there is already a pdev) for "struct pci_dev" in the scope of IOMMU. Signed-off-by: Quan Xu CC: Jan Be

Re: [Xen-devel] [PATCH v12 6/6] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-28 Thread Xu, Quan
On June 27, 2016 11:21 PM, Jan Beulich wrote: > >>> On 27.06.16 at 14:56, wrote: > > On June 27, 2016 4:24 PM, Jan Beulich wrote: > >> >>> On 24.06.16 at 07:51, wrote: > >> > @@ -199,24 +199,73 @@ static int __must_check > >> queue_invalidate_wait(struct iommu *iommu, > >> > return -EOPNOT

Re: [Xen-devel] [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF

2016-06-27 Thread Xu, Quan
On June 27, 2016 11:19 PM, Jan Beulich wrote: > >>> On 27.06.16 at 13:11, wrote: > > On June 27, 2016 4:17 PM, Jan Beulich wrote: > >> >>> On 24.06.16 at 07:51, wrote: > >> > @@ -98,7 +104,13 @@ void disable_ats_device(int seg, int bus, int > >> > devfn) > >> > >> For symmetry reasons this func

Re: [Xen-devel] [PATCH v12 6/6] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-27 Thread Xu, Quan
On June 27, 2016 4:24 PM, Jan Beulich wrote: > >>> On 24.06.16 at 07:51, wrote: > > @@ -199,24 +199,73 @@ static int __must_check > queue_invalidate_wait(struct iommu *iommu, > > return -EOPNOTSUPP; > > } > > > > -static int __must_check invalidate_sync(struct iommu *iommu, > > -

Re: [Xen-devel] [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF

2016-06-27 Thread Xu, Quan
On June 27, 2016 4:17 PM, Jan Beulich wrote: > >>> On 24.06.16 at 07:51, wrote: > > --- a/xen/drivers/passthrough/x86/ats.c > > +++ b/xen/drivers/passthrough/x86/ats.c > > @@ -22,26 +22,34 @@ LIST_HEAD(ats_devices); bool_t __read_mostly > > ats_enabled = 0; boolean_param("ats", ats_enabled); >

[Xen-devel] FIXME question

2016-06-27 Thread Xu, Quan
Hi, When I read IOMMU code, In xen/drivers/passthrough/vtd/intremap.c : pi_update_irte().. There are a FIXME -- '' * FIXME: For performance reasons we should store the 'iommu' pointer in * 'struct msi_desc' in some other place, so we don't need to waste * time searching it here. " IMO, we are bet

Re: [Xen-devel] [PATCH v12 1/6] IOMMU: add a timeout parameter for device IOTLB invalidation

2016-06-27 Thread Xu, Quan
On June 27, 2016 4:29 PM, Jan Beulich wrote: > >>> On 27.06.16 at 10:19, wrote: > > On June 27, 2016 4:03 PM, Jan Beulich wrote: > >> >>> On 24.06.16 at 07:51, wrote: > >> > From: Quan Xu > >> > > >> > The parameter 'iommu_dev_iotlb_timeout' specifies the timeout of > >> > device IOTLB invalid

Re: [Xen-devel] [PATCH v12 1/6] IOMMU: add a timeout parameter for device IOTLB invalidation

2016-06-27 Thread Xu, Quan
On June 27, 2016 4:03 PM, Jan Beulich wrote: > >>> On 24.06.16 at 07:51, wrote: > > From: Quan Xu > > > > The parameter 'iommu_dev_iotlb_timeout' specifies the timeout of > > device IOTLB invalidation in milliseconds. By default, the timeout is > > 1000 milliseconds, which can be boot-time chang

Re: [Xen-devel] [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF

2016-06-26 Thread Xu, Quan
On June 24, 2016 7:46 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Friday, June 24, 2016 1:52 PM > > > > From: Quan Xu > > > > a struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev > > and parameter to enable_ats_device(). > &g

Re: [Xen-devel] [PATCH v12 6/6] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-26 Thread Xu, Quan
On June 24, 2016 7:55 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Friday, June 24, 2016 1:52 PM > > diff --git a/xen/drivers/passthrough/vtd/extern.h > > b/xen/drivers/passthrough/vtd/extern.h > > index 45357f2..efaff28 100644 > > --- a/xen/drivers/pa

Re: [Xen-devel] [PATCH v12 5/6] IOMMU: move the domain crash logic up to the generic IOMMU layer

2016-06-26 Thread Xu, Quan
On June 24, 2016 7:48 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Friday, June 24, 2016 1:52 PM > > > > From: Quan Xu > > > > Signed-off-by: Quan Xu > > > > CC: Julien Grall > > CC: Kevin Tian > > CC: Feng Wu > >

Re: [Xen-devel] [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF

2016-06-26 Thread Xu, Quan
On June 24, 2016 7:46 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Friday, June 24, 2016 1:52 PM > > > > From: Quan Xu > > > > a struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev > > and parameter to enable_ats_device(). > &g

[Xen-devel] [PATCH v12 3/6] vt-d: convert conditionals of qi_ctrl->qinval_maddr into ASSERT()s

2016-06-23 Thread Xu, Quan
From: Quan Xu QI ought to have got disabled if any of the IOMMU table setup failed. A QI function (other than enable_qinval) is unreachable when qi_ctrl->qinval_maddr is zero. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/qinval.c | 52 ++

[Xen-devel] [PATCH v12 6/6] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-23 Thread Xu, Quan
From: Quan Xu If Device-TLB flush timed out, we hide the target ATS device immediately and crash the domain owning this ATS device. If impacted domain is hardware domain, just throw out a warning. By hiding the device, we make sure it can't be assigned to any domain any longer (see device_assign

[Xen-devel] [PATCH v12 2/6] vt-d: synchronize for Device-TLB flush one by one

2016-06-23 Thread Xu, Quan
From: Quan Xu Today we do Device-TLB flush synchronization after issuing flush requests for all ATS devices belonging to a VM. Doing so however imposes a limitation, i.e. that we can not figure out which flush request is blocked in the flush queue list, based on VT-d spec. To prepare correct Dev

[Xen-devel] [PATCH v12 0/6] VT-d Device-TLB flush issue

2016-06-23 Thread Xu, Quan
From: Quan Xu This patches fix current timeout concern and also allow limited ATS support: 1. add a timeout parameter for device IOTLB invalidation The parameter 'iommu_dev_iotlb_timeout' specifies the timeout of device IOTLB invalidation in milliseconds. By default, the timeout is

[Xen-devel] [PATCH v12 1/6] IOMMU: add a timeout parameter for device IOTLB invalidation

2016-06-23 Thread Xu, Quan
From: Quan Xu The parameter 'iommu_dev_iotlb_timeout' specifies the timeout of device IOTLB invalidation in milliseconds. By default, the timeout is 1000 milliseconds, which can be boot-time changed. We also confirmed with VT-d hardware team that 1 milliseconds is large enough for VT-d IOMMU int

[Xen-devel] [PATCH v12 5/6] IOMMU: move the domain crash logic up to the generic IOMMU layer

2016-06-23 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich CC: Suravee Suthikulpanit --- xen/drivers/passthrough/iommu.c | 30 -- xen/drivers/passthrough/vtd/iommu.c | 11 +++ 2 files changed, 39 insertions(+),

[Xen-devel] [PATCH v12 4/6] IOMMU/x86: using a struct pci_dev* instead of SBDF

2016-06-23 Thread Xu, Quan
From: Quan Xu a struct pci_dev* instead of SBDF is stored inside struct pci_ats_dev and parameter to enable_ats_device(). Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu CC: Suravee Suthikulpanit --- xen/drivers/passthrough/amd/iommu_cmd.c | 11 +++--- xen/drivers/pa

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-22 Thread Xu, Quan
On June 23, 2016 12:18 AM, Jan Beulich wrote: > >>> On 22.06.16 at 17:54, wrote: > > On June 17, 2016 3:01 PM, Jan Beulich wrote: > >> And again I don't understand: ASSERT()s are to verify assumed state. > >> If > > static > >> code analysis resulted in understanding a function is unreachable >

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-22 Thread Xu, Quan
On June 17, 2016 3:01 PM, Jan Beulich wrote: > And again I don't understand: ASSERT()s are to verify assumed state. If static > code analysis resulted in understanding a function is unreachable when > qi_ctrl->qinval_maddr is zero (because qinval ought to have got disabled if > any > of the table

[Xen-devel] [PATCH v10 2/3] vt-d: propagate the IOMMU Device-TLB flush error up to ME phantom functions

2016-06-22 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 8 xen/drivers/passthrough/vtd/quirks.c | 27 +-

[Xen-devel] [PATCH v10 3/3] vt-d: add __must_check annotation to IOMMU flush pointers and handlers

2016-06-22 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/iommu.c | 50 ++-- xen/drivers/passthrough/vtd/iommu.h | 11 +--- xen/drivers/passthrough/vtd

[Xen-devel] [PATCH v10 1/3] vt-d: fix the IOMMU flush issue

2016-06-22 Thread Xu, Quan
From: Quan Xu The propagation value from IOMMU flush interfaces may be positive, which indicates callers need to flush cache, not one of faliures. when the propagation value is positive, this patch fixes this flush issue as follows: - call iommu_flush_write_buffer() to flush cache. - return

[Xen-devel] [PATCH v10 0/3] Check VT-d Device-TLB flush error

2016-06-22 Thread Xu, Quan
From: Quan Xu This patch set is a prereq patch set for Patch:'VT-d Device-TLB flush issue'. While IOMMU Device-TLB flush timed out, xen calls panic() at present. However the existing panic() is going to be eliminated, so we must propagate the IOMMU Device-TLB flush error up to the call trees.

Re: [Xen-devel] [PATCH v9 1/3] vt-d: fix the IOMMU flush issue

2016-06-21 Thread Xu, Quan
On June 21, 2016 9:25 PM, Jan Beulich wrote: > >>> On 17.06.16 at 05:37, wrote: > > @@ -546,17 +550,37 @@ static int __must_check iommu_flush_all(void) > > struct acpi_drhd_unit *drhd; > > struct iommu *iommu; > > int flush_dev_iotlb; > > +int rc = 0; > > > > flush_all_cac

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue (+ crash logic )

2016-06-19 Thread Xu, Quan
On June 18, 2016 5:54 PM, Xu, Quan wrote: > On June 17, 2016 9:35 PM, Julien Grall wrote: > > On 17/06/16 09:51, Xu, Quan wrote: > > > + arm/amd maintainers.. > > > > > > On June 01, 2016 5:05 PM, Xu, Quan wrote: > > >> If Device-TL

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue (+ crash logic )

2016-06-18 Thread Xu, Quan
On June 17, 2016 9:35 PM, Julien Grall wrote: > On 17/06/16 09:51, Xu, Quan wrote: > > + arm/amd maintainers.. > > > > On June 01, 2016 5:05 PM, Xu, Quan wrote: > >> If Device-TLB flush timed out, we hide the target ATS device > >> immediately and cras

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue (+ crash logic )

2016-06-17 Thread Xu, Quan
+ arm/amd maintainers.. On June 01, 2016 5:05 PM, Xu, Quan wrote: > If Device-TLB flush timed out, we hide the target ATS device immediately and > crash the domain owning this ATS device. If impacted domain is hardware > domain, just throw out a warning. > > By hiding the devic

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-17 Thread Xu, Quan
On June 17, 2016 3:01 PM, Jan Beulich wrote: > >>> On 17.06.16 at 08:08, wrote: > > > On June 16, 2016 5:05 PM, Jan Beulich wrote: > >> >>> On 16.06.16 at 10:42, wrote: > >> > On June 02, 2016 7:07 PM, Jan Beulich wrote: > >> >> >>> On 01.06.16 at 11:05, wrote: > >> >> > +static void dev_inv

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-16 Thread Xu, Quan
On June 16, 2016 5:05 PM, Jan Beulich wrote: > >>> On 16.06.16 at 10:42, wrote: > > On June 02, 2016 7:07 PM, Jan Beulich wrote: > >> >>> On 01.06.16 at 11:05, wrote: > >> > +static void dev_invalidate_iotlb_timeout(struct iommu *iommu, u16 did, > >> > +

[Xen-devel] [PATCH v9 1/3] vt-d: fix the IOMMU flush issue

2016-06-16 Thread Xu, Quan
From: Quan Xu The propagation value from IOMMU flush interfaces may be positive, which indicates callers need to flush cache, not one of faliures. when the propagation value is positive, this patch fixes this flush issue as follows: - call iommu_flush_write_buffer() to flush cache. - return

[Xen-devel] [PATCH v9 3/3] vt-d: add __must_check annotation to IOMMU flush pointers and handlers

2016-06-16 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/iommu.c | 50 ++-- xen/drivers/passthrough/vtd/iommu.h | 11 +--- xen/drivers/passthrough/vtd

[Xen-devel] [PATCH v9 0/3] Check VT-d Device-TLB flush error

2016-06-16 Thread Xu, Quan
From: Quan Xu This patch set is a prereq patch set for Patch:'VT-d Device-TLB flush issue'. While IOMMU Device-TLB flush timed out, xen calls panic() at present. However the existing panic() is going to be eliminated, so we must propagate the IOMMU Device-TLB flush error up to the call trees.

[Xen-devel] [PATCH v9 2/3] vt-d: propagate the IOMMU Device-TLB flush error up to ME phantom functions

2016-06-16 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 8 xen/drivers/passthrough/vtd/quirks.c | 27 +-

Re: [Xen-devel] [PATCH] AMD IOMMU: correctly propagate errors from amd_iommu_init()

2016-06-16 Thread Xu, Quan
On June 16, 2016 4:29 PM, Jan Beulich wrote: > >>> On 16.06.16 at 04:03, wrote: > > On June 14, 2016 5:03 PM, Jan Beulich wrote: > >> -if ( amd_iommu_update_ivrs_mapping_acpi() != 0 ) > >> +rc = amd_iommu_update_ivrs_mapping_acpi(); > >> +if ( rc ) > >> goto error_out; > >>

Re: [Xen-devel] [Patch v11 3/3] vt-d: fix vt-d Device-TLB flush timeout issue

2016-06-16 Thread Xu, Quan
(* I will CC arm/amd maintainer after this vt-d specific discussion, and then send out my proposal...) On June 02, 2016 7:07 PM, Jan Beulich wrote: > >>> On 01.06.16 at 11:05, wrote: > > --- a/xen/drivers/passthrough/vtd/extern.h > > +++ b/xen/drivers/passthrough/vtd/extern.h > > @@ -21,6 +21,7

Re: [Xen-devel] [PATCH] AMD IOMMU: correctly propagate errors from amd_iommu_init()

2016-06-15 Thread Xu, Quan
On June 14, 2016 5:03 PM, Jan Beulich wrote: > -if ( amd_iommu_update_ivrs_mapping_acpi() != 0 ) > +rc = amd_iommu_update_ivrs_mapping_acpi(); > +if ( rc ) > goto error_out; > > /* initialize io-apic interrupt remapping entries */ > -if ( iommu_intremap && amd_iommu_

Re: [Xen-devel] [PATCH v8 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-15 Thread Xu, Quan
On June 15, 2016 4:42 PM, Jan Beulich wrote: > >>> On 15.06.16 at 10:35, wrote: > > On June 15, 2016 4:22 PM, Tian, Kevin wrote: > >> > From: Xu, Quan > >> > Sent: Wednesday, June 15, 2016 4:16 PM > >> > > >> > On June 15, 2

Re: [Xen-devel] [PATCH v8 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-15 Thread Xu, Quan
On June 15, 2016 4:22 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Wednesday, June 15, 2016 4:16 PM > > > > On June 15, 2016 3:45 PM, Jan Beulich wrote: > > > >>> On 15.06.16 at 03:54, wrote: > > > > Jan, > > > > Could

Re: [Xen-devel] [PATCH v8 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)

2016-06-15 Thread Xu, Quan
On June 13, 2016 11:17 PM, Xu, Quan wrote: > From: Quan Xu > > Signed-off-by: Quan Xu > Acked-by: Kevin Tian > Acked-by: Suravee Suthikulpanit > Reviewed-by: Jan Beulich > > CC: Suravee Suthikulpanit > CC: Stefano Stabellini > CC: Julien Grall > CC: Kev

Re: [Xen-devel] [PATCH v8 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-15 Thread Xu, Quan
On June 15, 2016 3:45 PM, Jan Beulich wrote: > >>> On 15.06.16 at 03:54, wrote: > > Jan, > > Could you help me review patch 7? Thanks. > > Then, I can send out next v9 soon and get started to focus on next > > patch set. > > That patch is fine now from my pov, feel free to stick my R-b on it.

Re: [Xen-devel] [Patch v11 1/3] IOMMU: add a timeout parameter for device IOTLB invalidation

2016-06-14 Thread Xu, Quan
On June 02, 2016 6:25 PM, Jan Beulich wrote: > >>> On 01.06.16 at 11:05, wrote: > > From: Quan Xu > > v11: Change the timeout parameter from 'vtd_qi_timeout' to > > 'iommu_dev_iotlb_timeout', which is not only for VT-d device > > IOTLB invalidation, but also for other IOMMU implementatio

Re: [Xen-devel] [PATCH v8 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-14 Thread Xu, Quan
On June 14, 2016 12:37 AM, George Dunlap wrote: > On Mon, Jun 13, 2016 at 4:17 PM, Xu, Quan wrote: > > From: Quan Xu > > > > When IOMMU mapping is failed, we issue a best effort rollback, > > stopping IOMMU mapping, unmapping the previous IOMMU maps and > then >

Re: [Xen-devel] [PATCH v8 09/11] vt-d: fix the IOMMU flush issue

2016-06-14 Thread Xu, Quan
On June 14, 2016 4:27 PM, Jan Beulich wrote: > >>> On 14.06.16 at 10:10, wrote: > > On June 13, 2016 11:52 PM, Jan Beulich wrote: > >> >>> "Xu, Quan" 06/13/16 5:22 PM >>> > >> >From: Quan Xu > >> >@@ -546,17 +550,

Re: [Xen-devel] vTPM detaching issue

2016-06-14 Thread Xu, Quan
On June 13, 2016 11:11 PM, Andrea Genuise wrote: > I'm not sure if this is a bug or my fault, but when I create a domain > with a vTPM attached, detaching it sometimes causes the following error > to be thrown (I post the command sequence): > I am afraid this is not a bug. As 'xl vtpm-detach' is

Re: [Xen-devel] [PATCH v8 09/11] vt-d: fix the IOMMU flush issue

2016-06-14 Thread Xu, Quan
On June 13, 2016 11:52 PM, Jan Beulich wrote: > >>> "Xu, Quan" 06/13/16 5:22 PM >>> > >From: Quan Xu > >@@ -546,17 +550,37 @@ static int __must_check iommu_flush_all(void) > >struct acpi_drhd_unit *drhd; struct iommu *iommu; int flush_dev_i

[Xen-devel] [PATCH v8 08/11] IOMMU: propagate IOMMU Device-TLB flush error (leaf ones).

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/arm/smmu.c | 13 - xen/drivers/passthrough/iommu.c | 8 ++-- xen/driver

[Xen-devel] [PATCH v8 06/11] propagate IOMMU Device-TLB flush error up to EPT update (top level ones)

2016-06-13 Thread Xu, Quan
From: Quan Xu Propagate the IOMMU Device-TLB flush error up to the ept_set_entry(), when VT-d shares EPT page table. Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu ---

[Xen-devel] [PATCH v8 07/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending (top level ones)

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Acked-by: Suravee Suthikulpanit CC: Jan Beulich CC: Liu Jinsong CC: Keir Fraser CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu v8: enhance the error check of dev

[Xen-devel] [PATCH v8 10/11] vt-d: propagate the IOMMU Device-TLB flush error up to ME phantom functions

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 8 xen/drivers/passthrough/vtd/quirks.c | 27 +-

[Xen-devel] [PATCH v8 00/11] Check VT-d Device-TLB flush error

2016-06-13 Thread Xu, Quan
From: Quan Xu This patch set is a prereq patch set for Patch:'VT-d Device-TLB flush issue'. While IOMMU Device-TLB flush timed out, xen calls panic() at present. However the existing panic() is going to be eliminated, so we must propagate the IOMMU Device-TLB flush error up to the call trees.

[Xen-devel] [PATCH v8 03/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU unmapping (top level ones)

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Acked-by: Suravee Suthikulpanit Acked-by: Julien Grall Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit --- xen/drivers/pa

[Xen-devel] [PATCH v8 09/11] vt-d: fix the IOMMU flush issue

2016-06-13 Thread Xu, Quan
From: Quan Xu The propagation value from IOMMU flush interfaces may be positive, which indicates callers need to flush cache, not one of faliures. when the propagation value is positive, this patch fixes this flush issue as follows: - call iommu_flush_write_buffer() to flush cache. - return

[Xen-devel] [PATCH v8 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-13 Thread Xu, Quan
From: Quan Xu When IOMMU mapping is failed, we issue a best effort rollback, stopping IOMMU mapping, unmapping the previous IOMMU maps and then reporting the error up to the call trees. When rollback is not feasible (in early initialization phase or trade-off of complexity) for the hardware domai

[Xen-devel] [PATCH v8 11/11] vt-d: add __must_check annotation to IOMMU flush pointers and handlers

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/iommu.c | 50 ++-- xen/drivers/passthrough/vtd/iommu.h | 11 +--- xen/drivers/passthrough/vtd

[Xen-devel] [PATCH v8 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Acked-by: Suravee Suthikulpanit Reviewed-by: Jan Beulich CC: Suravee Suthikulpanit CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich CC: Andrew Cooper v8: use the Linux coding style for arm cod

[Xen-devel] [PATCH v8 05/11] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones)

2016-06-13 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Julien Grall Reviewed-by: Kevin Tian Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian --- xen/arch/arm/p2m.c | 4 +++- xen/common/memory.c | 12 ++-- x

[Xen-devel] [PATCH v8 01/11] IOMMU: handle IOMMU mapping and unmapping failures

2016-06-13 Thread Xu, Quan
From: Quan Xu Treat IOMMU mapping and unmapping failures as a fatal to the DomU If IOMMU mapping and unmapping failed, crash the DomU and propagate the error up to the call trees. No spamming of the log can occur. For DomU, we avoid logging any message for already dying domains. For Dom0, that'l

Re: [Xen-devel] [PATCH v7 09/11] vt-d: fix the IOMMU flush issue

2016-06-13 Thread Xu, Quan
On June 12, 2016 5:27 PM, Xu, Quan wrote: > On June 12, 2016 3:33 PM, Tian, Kevin wrote: > > > From: Xu, Quan > > > Sent: Wednesday, June 08, 2016 4:59 PM @@ -545,18 +549,42 @@ > static > > > int __must_check iommu_flush_all(void) { > > > stru

Re: [Xen-devel] [PATCH v7 09/11] vt-d: fix the IOMMU flush issue

2016-06-12 Thread Xu, Quan
On June 12, 2016 3:33 PM, Tian, Kevin wrote: > > From: Xu, Quan > > Sent: Wednesday, June 08, 2016 4:59 PM @@ -545,18 +549,42 @@ static > > int __must_check iommu_flush_all(void) { > > struct acpi_drhd_unit *drhd; > > struct iommu *iommu; > > -

Re: [Xen-devel] [PATCH v7 07/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending (top level ones)

2016-06-12 Thread Xu, Quan
> -Original Message- > From: Xen-devel [mailto:xen-devel-boun...@lists.xen.org] On Behalf Of Jan > Beulich > Sent: Wednesday, June 08, 2016 10:52 PM > To: Xu, Quan > Cc: Tian, Kevin ; Stefano Stabellini > ; Wu, Feng ; Liu Jinsong > ; dario.faggi...@citrix.com; xe

Re: [Xen-devel] [PATCH v7 05/11] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones)

2016-06-12 Thread Xu, Quan
On June 12, 2016 2:56 PM, Tian, Kevin wrote: > > From: Julien Grall [mailto:julien.gr...@arm.com] > > Sent: Thursday, June 09, 2016 8:40 PM > > > > Hi Jan, > > > > On 09/06/16 13:32, Jan Beulich wrote: > > On 09.06.16 at 14:24, wrote: > > >> So the behavior of iommu_iotlb_flush is up to the

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-08 Thread Xu, Quan
On June 07, 2016 3:50 PM, Jan Beulich wrote: > >>> On 07.06.16 at 07:52, wrote: > > -vf PT is not working for win2008: the logs: > >qemu-dm-win2k8.log -- qemu log, vf PT for win2008. > >xen-win2k8.log -- xen log, vf PT for win2008. > > Hmm, that's very little output. In particular neithe

[Xen-devel] [PATCH v7 02/11] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-06-08 Thread Xu, Quan
From: Quan Xu When IOMMU mapping is failed, we issue a best effort rollback, stopping IOMMU mapping, unmapping the previous IOMMU maps and then reporting the error up to the call trees. When rollback is not feasible (in early initialization phase or trade-off of complexity) for the hardware domai

[Xen-devel] [PATCH v7 07/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending (top level ones)

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu CC: Jan Beulich CC: Liu Jinsong CC: Keir Fraser CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu v7: 1. return SAVED_ALL at the bottom of device_power_down(), instead of SAVED_NON

[Xen-devel] [PATCH v7 01/11] IOMMU: handle IOMMU mapping and unmapping failures

2016-06-08 Thread Xu, Quan
From: Quan Xu Treat IOMMU mapping and unmapping failures as a fatal to the DomU If IOMMU mapping and unmapping failed, crash the DomU and propagate the error up to the call trees. No spamming of the log can occur. For DomU, we avoid logging any message for already dying domains. For Dom0, that'l

[Xen-devel] [PATCH v7 08/11] IOMMU: propagate IOMMU Device-TLB flush error (leaf ones).

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/arm/smmu.c | 13 - xen/drivers/passthrough/iommu.c | 8 ++-- xen/driver

[Xen-devel] [PATCH v7 05/11] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones)

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian --- xen/arch/arm/p2m.c | 4 +++- xen/common/memory.c | 12 ++-- xen/drivers/passthrough/iommu.c | 13 +

[Xen-devel] [PATCH v7 10/11] vt-d: propagate the IOMMU Device-TLB flush error up to ME phantom functions

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 8 xen/drivers/passthrough/vtd/quirks.c | 27 +-- 3 files cha

[Xen-devel] [PATCH v7 03/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU unmapping (top level ones)

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich CC: Andrew Cooper v7: just drop 'Reviewed-by: Jan Beulich ', as I haven't added __must_check annotation to iommu_unmap_page() in previous

[Xen-devel] [PATCH v7 09/11] vt-d: fix the IOMMU flush issue

2016-06-08 Thread Xu, Quan
From: Quan Xu The propagation value from IOMMU flush interfaces may be positive, which indicates callers need to flush cache, not one of faliures. when the propagation value is positive, this patch fixes this flush issue as follows: - call iommu_flush_write_buffer() to flush cache. - return

[Xen-devel] [PATCH v7 11/11] vt-d: add __must_check annotation to IOMMU flush pointers and handlers

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Reviewed-by: Jan Beulich CC: Jan Beulich CC: Kevin Tian CC: Feng Wu v7: using !! instead of ?: . --- xen/drivers/passthrough/vtd/iommu.c | 44 ++-- xen/drivers/passthrough/vtd/iommu.h | 11 + xen/drivers/passth

[Xen-devel] [PATCH v7 00/11] Check VT-d Device-TLB flush error

2016-06-08 Thread Xu, Quan
From: Quan Xu This patch set is a prereq patch set for Patch:'VT-d Device-TLB flush issue'. While IOMMU Device-TLB flush timed out, xen calls panic() at present. However the existing panic() is going to be eliminated, so we must propagate the IOMMU Device-TLB flush error up to the call trees.

[Xen-devel] [PATCH v7 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)

2016-06-08 Thread Xu, Quan
From: Quan Xu Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Suravee Suthikulpanit CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich v7: drop the amd_iommu_hwdom_init() fix, which has been added in patch 2 in this v7. --- xen/drivers/passthrough/ar

[Xen-devel] [PATCH v7 06/11] propagate IOMMU Device-TLB flush error up to EPT update (top level ones)

2016-06-08 Thread Xu, Quan
From: Quan Xu Propagate the IOMMU Device-TLB flush error up to the ept_set_entry(), when VT-d shares EPT page table. Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu ---

Re: [Xen-devel] [Patch v6 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)

2016-06-07 Thread Xu, Quan
On June 07, 2016 4:19 PM, Jan Beulich wrote: > >>> On 07.06.16 at 09:51, wrote: > > I still have one question. If I add __must_check annotation to > > iommu_unmap_page(). > > How to fix this -- unmapping the previous IOMMU maps when IOMMU > > mapping is failed.. > > e.g., > > > > ept_set_entry()

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-07 Thread Xu, Quan
On June 07, 2016 4:09 PM, Jan Beulich wrote: > >>> On 07.06.16 at 09:49, wrote: > On 07.06.16 at 07:52, wrote: > >> -vf PT is not working for win2008: the logs: > >>qemu-dm-win2k8.log -- qemu log, vf PT for win2008. > >>xen-win2k8.log -- xen log, vf PT for win2008. > > > > Hmm, that

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-07 Thread Xu, Quan
On June 07, 2016 3:50 PM, Jan Beulich wrote: > >>> On 07.06.16 at 07:52, wrote: > > -vf PT is not working for win2008: the logs: > >qemu-dm-win2k8.log -- qemu log, vf PT for win2008. > >xen-win2k8.log -- xen log, vf PT for win2008. > > Hmm, that's very little output. In particular neithe

Re: [Xen-devel] [Patch v6 04/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping (top level ones)

2016-06-07 Thread Xu, Quan
On June 02, 2016 5:21 PM, Jan Beulich wrote: > >>> On 02.06.16 at 09:25, wrote: > > On June 01, 2016 6:24 PM, Jan Beulich wrote: > >> >>> On 31.05.16 at 15:57, wrote: > > As would a respective change to vtd_set_hwdom_mapping(), which > >> I'm not sure which patch you've put that in. > >> > > >

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-06 Thread Xu, Quan
On June 07, 2016 1:52 PM, Xu, Quan wrote: > On June 02, 2016 8:09 PM, Jan Beulich wrote: > Sorry, this below part is about NIC PF pass-through for win2008.. > btw, when I updated the NIC driver for win2008, actually, it is working. > Xudong, could you help me ver

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-06 Thread Xu, Quan
On June 02, 2016 8:09 PM, Jan Beulich wrote: > Attached both a hypervisor and a qemu patch. Their plus > debug key M and i output is what I'd like to start with. Applied these two patches, the attach files are logs. -vf PT is working for SLES 12. The logs: qemu-dm-sles.log -- qemu log, vf PT

Re: [Xen-devel] [BUG] win2008 guest cannot get ip through sriov

2016-06-02 Thread Xu, Quan
gt;> >> >>> On 02.06.16 at 12:22, wrote: > >> >> > On Thu, Jun 02, 2016 at 07:31:06AM +, Xu, Quan wrote: > >> >> >> On May 27, 2016 10:06 PM, Jan Beulich > wrote: > >> >> >> > >>> On 27.0

  1   2   3   4   5   6   >