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

2016-03-19 Thread Quan Xu
this patch set is a prereq patch set for Patch:'VT-d Device-TLB flush issue'. Current code would be panic(), when VT-d Device-TLB flush timed out. the panic() is going to be eliminated, so we must check all kinds of error and all the way up the call trees. Quan Xu (2): IOMMU/MMU:

[Xen-devel] [PATCH 1/2] IOMMU/MMU: Adjust top level functions for VT-d Device-TLB flush error.

2016-03-19 Thread Quan Xu
Current code would be panic(), when VT-d Device-TLB flush timed out. the panic() is going to be eliminated, so we must check all kinds of error and all the way up the call trees. Signed-off-by: Quan Xu CC: Jan Beulich CC: Liu Jinsong CC: Keir Fraser CC: Andrew Cooper CC: Jun Nakajima CC

[Xen-devel] [PATCH v8 1/3] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed

2016-03-23 Thread Quan Xu
Signed-off-by: Quan Xu --- docs/misc/xen-command-line.markdown | 7 +++ xen/drivers/passthrough/vtd/qinval.c | 17 - 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index ca77e3b

[Xen-devel] [PATCH v8 3/3] VT-d: Fix vt-d Device-TLB flush timeout issue

2016-03-23 Thread Quan Xu
If Device-TLB flush timed out, we would hide the target ATS device and crash the domain owning this ATS device. If impacted domain is hardware domain, just throw out a warning. The hidden device should be disallowed to be further assigned to any domain. Signed-off-by: Quan Xu --- xen/drivers

[Xen-devel] [PATCH v8 2/3] VT-d: Wrap a _sync version for all VT-d flush interfaces

2016-03-23 Thread Quan Xu
For consistency, we wrap a _sync version for all VT-d flush interfaces. It simplifies caller logic and makes code more readable as well. Signed-off-by: Quan Xu --- xen/drivers/passthrough/vtd/extern.h | 2 + xen/drivers/passthrough/vtd/qinval.c | 173 -- xen

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

2016-03-23 Thread Quan Xu
se against a6f2cdb633bf519244a16674031b8034b581ba7f. #patch 1 *Add __must_check annotation. #patch 2 *It is a new patch that wraps a _sync version for all VT-d flush interfaces. #patch 3 *Add a blank line between: +pcidevs_lock(); +for_each_pdev(d, pdev) Quan Xu (3): VT

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

2016-04-01 Thread Quan Xu
e. * Add function declaration at the head of file, and then we don't need pure code movement. #patch 3 * Enhance the commit message. * 'ASSERT ( pdev->domain )' to 'ASSERT(pdev->domain)' Quan Xu (3): VT-d: add a command line parameter for Queued Invalidation

[Xen-devel] [PATCH v9 1/3] VT-d: add a command line parameter for Queued Invalidation

2016-04-01 Thread Quan Xu
' addresses the __mustcheck. That is the other callers of this routine (two or three levels up) ignore the return code. This patch does not address this but the other does. Signed-off-by: Quan Xu --- docs/misc/xen-command-line.markdown | 18 ++ xen/drivers/passthrou

[Xen-devel] [PATCH v9 3/3] VT-d: Fix vt-d Device-TLB flush timeout issue

2016-04-01 Thread Quan Xu
(see device_assigned). Signed-off-by: Quan Xu --- xen/drivers/passthrough/pci.c | 6 ++-- xen/drivers/passthrough/vtd/extern.h | 3 +- xen/drivers/passthrough/vtd/qinval.c | 58 +-- xen/drivers/passthrough/vtd/x86/ats.c | 11 --- xen/include/xen/

[Xen-devel] [PATCH v9 2/3] VT-d: wrap a _sync version for all VT-d flush interfaces

2016-04-01 Thread Quan Xu
could find out the buggy ATS device and hide it. However, for other VT-d flush interfaces, the invalidate_sync() is still put after at present. This is inconsistent. So we wrap a _sync version for all VT-d flush interfaces. It simplifies caller logic and makes code more readable as well. Signed-off-b

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

2016-04-18 Thread Quan Xu
patch set is also based on the discussion of 'abstract model of IOMMU unmaping/mapping failures' In this version, I try that splitting things is to go function by function, top level ones first, and leaf ones last, one function per patch (maybe pairs of functions, as in the map/unma

[Xen-devel] [PATCH v2 06/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping.

2016-04-18 Thread Quan Xu
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 IOMMU mapping. Signed-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers

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

2016-04-18 Thread Quan Xu
-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper --- xen/drivers/passthrough/vtd/iommu.c | 94 - xen/include/asm-x86/iommu.h | 2 +- 2 files changed, 63 insertions(+), 33 deletions(-) diff --git a/xen

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

2016-04-18 Thread Quan Xu
-off of complexity), at least, unmap upon maps error or then throw out error message. IOMMU unmapping should perhaps continue despite an error, in an attempt to do best effort cleanup. Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Jun Nakajima CC: Kevin Tian CC

[Xen-devel] [PATCH v2 04/11] grant_table: avoid unnecessary work during grant table unmapping

2016-04-18 Thread Quan Xu
While grant table is unmapping, the domain (with the exception of the hardware domain) may be crashed due to IOMMU mapping and unmapping failures, and then it is unnecessary to flush specified CPUs' TLBs. Signed-off-by: Quan Xu CC: Ian Jackson CC: Jan Beulich CC: Keir Fraser CC: Tim D

[Xen-devel] [PATCH v2 08/11] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones).

2016-04-18 Thread Quan Xu
hardware domain) is crashed, treated as a fatal error. Rollback can be lighter weight. This patch fixes the leaf ones. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/iommu.c | 8 ++-- xen/drivers/passthrough/vtd/iommu.c | 8 xen

[Xen-devel] [PATCH v2 02/11] IOMMU: handle IOMMU mapping and unmapping failures

2016-04-18 Thread Quan Xu
Now IOMMU mapping and unmapping failures are treated as a fatal to the domain (with the exception of the hardware domain). If IOMMU mapping and unmapping failed, crash the domain (with the exception of the hardware domain) and propagate the error up to the call trees. Signed-off-by: Quan Xu CC

[Xen-devel] [PATCH v2 10/11] vt-d: propagate IOMMU Device-TLB flush error up to vt-d hardware initialization

2016-04-18 Thread Quan Xu
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 vt-d hardware initialization. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen

[Xen-devel] [PATCH v2 05/11] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU unmapping.

2016-04-18 Thread Quan Xu
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 IOMMU unmapping. Signed-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers

[Xen-devel] [PATCH v2 09/11] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending

2016-04-18 Thread Quan Xu
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 IOMMU suspending. Signed-off-by: Quan Xu CC: Jan Beulich CC: Liu Jinsong CC: Keir Fraser CC: Andrew Cooper

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

2016-04-18 Thread Quan Xu
hardware domain) is crashed, treated as a fatal error. Rollback can be lighter weight. This patch fixes the top level ones (this patch doesn't fix the leaf ones but the next patch does). Signed-off-by: Quan Xu CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich --- xen/arch/arm/

[Xen-devel] [PATCH v2 11/11] vt-d: propagate error up to ME phantom function mapping and unmapping

2016-04-18 Thread Quan Xu
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 ME phantom function mapping and unmapping. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng

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

2016-04-22 Thread Quan Xu
igned-off-by: Quan Xu --- xen/drivers/passthrough/pci.c | 6 +-- xen/drivers/passthrough/vtd/extern.h | 5 ++- xen/drivers/passthrough/vtd/qinval.c | 71 --- xen/drivers/passthrough/vtd/x86/ats.c | 11 +++--- xen/include/xen/pci.h | 1 + 5

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

2016-04-22 Thread Quan Xu
effort invalidation even when an error has occurred. #patch3 * Remove stray blanks. * Remove pointless local variable. * Add comment. * Add printk(). Quan Xu (3): vt-d: add a timeout parameter for Queued Invalidation vt-d: synchronize for Device-TLB flush one by one vt-d:

[Xen-devel] [PATCH v10 1/3] vt-d: add a timeout parameter for Queued Invalidation

2016-04-22 Thread Quan Xu
__mustcheck. That is the other callers of this routine (two or three levels up) ignore the return code. This patch does not address this but the other does. Signed-off-by: Quan Xu --- docs/misc/xen-command-line.markdown | 10 ++ xen/drivers/passthrough/vtd/qinval.c | 17 -

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

2016-04-22 Thread Quan Xu
IOTLB/IEC/Context, i.e. moving synchronization into the function. Since there is no user of a non-synced interface, we just rename existing ones with _sync suffix. Signed-off-by: Quan Xu --- xen/drivers/passthrough/vtd/extern.h | 5 +-- xen/drivers/passthrough/vtd/qinval.c | 61

[Xen-devel] [PATCH v3 05/10] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping.

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU mapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers/passthrough/vtd/iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough

[Xen-devel] [PATCH v3 09/10] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU suspending. 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 --- xen/arch/x86/acpi/power.c

[Xen-devel] [PATCH v3 03/10] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-04-29 Thread Quan Xu
on a best effort basis, only throwing out an error message. IOMMU unmapping should perhaps continue despite an error, in an attempt to do best effort cleanup. Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap

[Xen-devel] [PATCH v3 01/10] vt-d: fix the IOMMU flush issue

2016-04-29 Thread Quan Xu
-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper --- xen/drivers/passthrough/vtd/iommu.c | 94 + xen/include/asm-x86/iommu.h | 2 +- 2 files changed, 64 insertions(+), 32 deletions(-) diff --git a/xen

[Xen-devel] [PATCH v3 00/10] Check VT-d Device-TLB flush error

2016-04-29 Thread Quan Xu
patch set is also based on the discussion of 'abstract model of IOMMU unmaping/mapping failures' In this v3, - best effort flushing when an error. - adding __must_check. Quan Xu (10): vt-d: fix the IOMMU flush issue IOMMU: handle IOMMU mapping and unmapping failures IO

[Xen-devel] [PATCH v3 04/10] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU unmapping.

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU unmapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers/passthrough/vtd/iommu.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/drivers

[Xen-devel] [PATCH v3 06/10] propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones).

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the top level ones (this patch doesn't fix the leaf ones but the next patch does). Signed-off-by: Quan Xu CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian --- xen/arc

[Xen-devel] [PATCH v3 07/10] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones).

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the leaf ones. Signed-off-by: Quan Xu CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/arm/smmu.c | 12 +++- xen/drivers

[Xen-devel] [PATCH v3 10/10] vt-d: propagate error up to ME phantom function mapping and unmapping

2016-04-29 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to ME phantom function mapping and unmapping. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 18 ++ xen/drivers

[Xen-devel] [PATCH v3 02/10] IOMMU: handle IOMMU mapping and unmapping failures

2016-04-29 Thread Quan Xu
Treat IOMMU mapping and unmapping failures as a fatal to the domain (with the exception of the hardware domain). If IOMMU mapping and unmapping failed, crash the domain (with the exception of the hardware domain) and propagate the error up to the call trees. Signed-off-by: Quan Xu Reviewed-by

[Xen-devel] [PATCH v3 08/10] vt-d/ept: propagate IOMMU Device-TLB flush error up to EPT update.

2016-04-29 Thread 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 CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu --- xen/arch/x86/mm/p2m-ept.c | 3 ++- xen/drivers

[Xen-devel] [PATCH v4 02/10] IOMMU: handle IOMMU mapping and unmapping failures

2016-05-06 Thread Quan Xu
Treat IOMMU mapping and unmapping failures as a fatal to the domain (with the exception of the hardware domain). If IOMMU mapping and unmapping failed, crash the domain (with the exception of the hardware domain) and propagate the error up to the call trees. Signed-off-by: Quan Xu Reviewed-by

[Xen-devel] [PATCH v4 00/10] Check VT-d Device-TLB flush error

2016-05-06 Thread Quan Xu
patch set is also based on the discussion of 'abstract model of IOMMU unmaping/mapping failures' Quan Xu (10): vt-d: fix the IOMMU flush issue IOMMU: handle IOMMU mapping and unmapping failures IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping vt-d: propagate IO

[Xen-devel] [PATCH v4 04/10] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU unmapping.

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU unmapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers/passthrough/vtd/iommu.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xen/drivers

[Xen-devel] [PATCH v4 05/10] vt-d: propagate IOMMU Device-TLB flush error up to IOMMU mapping.

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU mapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Kevin Tian CC: Feng Wu CC: Jan Beulich --- xen/drivers/passthrough/vtd/iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/drivers/passthrough

[Xen-devel] [PATCH v4 08/10] vt-d/ept: propagate IOMMU Device-TLB flush error up to EPT update.

2016-05-06 Thread 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 CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu --- xen/arch/x86/mm/p2m-ept.c | 3

[Xen-devel] [PATCH v4 06/10] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones).

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the top level ones (this patch doesn't fix the leaf ones but the next patch does). Signed-off-by: Quan Xu CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian --- xen/arc

[Xen-devel] [PATCH v4 09/10] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU suspending. 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 --- xen/arch/x86/acpi/power.c

[Xen-devel] [PATCH v4 10/10] vt-d: propagate error up to ME phantom function mapping and unmapping

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to ME phantom function mapping and unmapping. Signed-off-by: Quan Xu CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/vtd/extern.h | 3 ++- xen/drivers/passthrough/vtd/iommu.c | 18 ++ xen/drivers

[Xen-devel] [PATCH v4 07/10] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones).

2016-05-06 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the leaf ones. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/arm/smmu.c | 12

[Xen-devel] [PATCH v4 03/10] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-05-06 Thread Quan Xu
on a best effort basis, only throwing out an error message. IOMMU unmapping should perhaps continue despite an error, in an attempt to do best effort cleanup. Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap

[Xen-devel] [PATCH v4 01/10] vt-d: fix the IOMMU flush issue

2016-05-06 Thread Quan Xu
-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper --- xen/drivers/passthrough/vtd/iommu.c | 99 - xen/include/asm-x86/iommu.h | 2 +- 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/xen

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

2016-05-06 Thread Quan Xu
hi, If i didn't miss something, there is still no comment for this patch set. I think this patch set is close to being ready. I hope this patch set is still in your waiting-review list, but not missed.:) Thanks in advance!! Quan On 22 Apr 2016, at 18:38:49 +0800, Quan Xu wrote: &

[Xen-devel] [PATCH v5 08/10] vt-d/ept: propagate IOMMU Device-TLB flush error up to EPT update.

2016-05-18 Thread 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 CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu --- xen/arch/x86/mm/p2m-ept.c | 2 +- xen

[Xen-devel] [PATCH v5 10/10] vt-d: propagate error up to ME phantom function mapping and unmapping

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to ME phantom function mapping and unmapping. Signed-off-by: Quan Xu 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

[Xen-devel] [PATCH v5 00/10] Check VT-d Device-TLB flush error

2016-05-18 Thread Quan Xu
* change 'enum dev_power_type' to 'enum dev_power_saved'. * change 'TYPE_*' to 'SAVED_*' * drop '*_UNKNOWN' in enum. * change 'should' to 'cannot' for comment. * reorder in device_power_up(). * enhance logging mess

[Xen-devel] [PATCH v5 01/10] vt-d: fix the IOMMU flush issue

2016-05-18 Thread Quan Xu
-off-by: Quan Xu CC: Kevin Tian CC: Feng Wu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper --- xen/drivers/passthrough/vtd/iommu.c | 101 ++-- xen/include/asm-x86/iommu.h | 2 +- 2 files changed, 75 insertions(+), 28 deletions(-) diff --git a/xen

[Xen-devel] [PATCH v5 06/10] IOMMU/MMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (top level ones).

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the top level ones (this patch doesn't fix the leaf ones but the next patch does). Signed-off-by: Quan Xu Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulic

[Xen-devel] [PATCH v5 09/10] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU suspending

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU suspending. 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 --- xen/arch/x86/acpi/power.c

[Xen-devel] [PATCH v5 05/10] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU mapping.

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU mapping. 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 --- xen/drivers/passthrough/amd/pci_amd_iommu.c | 17

[Xen-devel] [PATCH v5 04/10] IOMMU: propagate IOMMU Device-TLB flush error up to IOMMU unmapping.

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to IOMMU unmapping. Signed-off-by: Quan Xu Acked-by: Kevin Tian Reviewed-by: Jan Beulich CC: Stefano Stabellini CC: Julien Grall CC: Kevin Tian CC: Feng Wu CC: Jan Beulich CC: Andrew Cooper --- xen/drivers/passthrough/arm/smmu.c

[Xen-devel] [PATCH v5 02/10] IOMMU: handle IOMMU mapping and unmapping failures

2016-05-18 Thread Quan Xu
rbose than we'd really like, but it at least wouldn't outright flood the console. Signed-off-by: Quan Xu Reviewed-by: Kevin Tian CC: Jan Beulich CC: Kevin Tian --- xen/drivers/passthrough/iommu.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) d

[Xen-devel] [PATCH v5 03/10] IOMMU/MMU: enhance the call trees of IOMMU unmapping and mapping

2016-05-18 Thread Quan Xu
on a best effort basis, only throwing out an error message. IOMMU unmapping should perhaps continue despite an error, in an attempt to do best effort cleanup. Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Jun Nakajima CC: Kevin Tian CC: George Dunlap

[Xen-devel] [PATCH v5 07/10] IOMMU: propagate IOMMU Device-TLB flush error up to iommu_iotlb_flush{, _all} (leaf ones).

2016-05-18 Thread Quan Xu
Propagate the IOMMU Device-TLB flush error up to the iommu_iotlb_flush{,_all}. This patch fixes the leaf ones. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Stefano Stabellini CC: Julien Grall CC: Jan Beulich CC: Kevin Tian CC: Feng Wu --- xen/drivers/passthrough/arm/smmu.c | 13

[Xen-devel] [PATCH RFC v3 0/6] x86/idle: add halt poll support

2017-11-13 Thread Quan Xu
Prague.) - enhance patch desciption. - enhance Documentation and sysctls. - test with IRQ_TIMINGS related code, which seems not working so far. V1 -> V2: - integrate the smart halt poll into paravirt code - use idle_stamp instead of check_poll - since it hard to get whether vcpu is the only task in p

[Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-13 Thread Quan Xu
several VM-exit/VM-entry cycles, VM-entry for interrupts and VM-exit immediately. Also this becomes more expensive than bare metal. Add a generic idle poll before enter real idle path. When a reschedule event is pending, we can bypass the real idle path. Signed-off-by: Quan Xu Signed-off-by: Yang Zhang

[Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-13 Thread Quan Xu
From: Quan Xu So far, pv_idle_ops.poll is the only ops for pv_idle. .poll is called in idle path which will poll for a while before we enter the real idle state. In virtualization, idle path includes several heavy operations includes timer access(LAPIC timer or TSC deadline timer) which will

[Xen-devel] [PATCH RFC v3 2/6] KVM guest: register kvm_idle_poll for pv_idle_ops

2017-11-13 Thread Quan Xu
From: Quan Xu Although smart idle poll has nothing to do with paravirt, it can not bring any benifit to native. So we only enable it when Linux runs as a KVM guest( also it can extend to other hypervisor like Xen, HyperV and VMware). Introduce per-CPU variable poll_duration_ns to control the

[Xen-devel] [PATCH RFC v3 0/6] x86/idle: add halt poll support

2017-11-13 Thread Quan Xu
Prague.) - enhance patch desciption. - enhance Documentation and sysctls. - test with IRQ_TIMINGS related code, which seems not working so far. V1 -> V2: - integrate the smart halt poll into paravirt code - use idle_stamp instead of check_poll - since it hard to get whether vcpu is the only task in p

[Xen-devel] [PATCH RFC v3 5/6] tick: get duration of the last idle loop

2017-11-13 Thread Quan Xu
From: Quan Xu the last idle loop is from tick_nohz_idle_enter to tick_nohz_idle_exit. Signed-off-by: Yang Zhang Signed-off-by: Quan Xu Cc: Frederic Weisbecker Cc: Thomas Gleixner Cc: Ingo Molnar Cc: linux-ker...@vger.kernel.org --- include/linux/tick.h |2 ++ kernel/time/tick

[Xen-devel] [PATCH RFC v3 6/6] KVM guest: introduce smart idle poll algorithm

2017-11-13 Thread Quan Xu
From: Yang Zhang using smart idle poll to reduce the useless poll when system is idle. Signed-off-by: Quan Xu Signed-off-by: Yang Zhang Cc: Paolo Bonzini Cc: Thomas Gleixner Cc: Ingo Molnar Cc: "H. Peter Anvin" Cc: x...@kernel.org Cc: k...@vger.kernel.org Cc: linux-ker...@vger.

Re: [Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-13 Thread Quan Xu
On 2017/11/13 18:53, Juergen Gross wrote: On 13/11/17 11:06, Quan Xu wrote: From: Quan Xu So far, pv_idle_ops.poll is the only ops for pv_idle. .poll is called in idle path which will poll for a while before we enter the real idle state. In virtualization, idle path includes several heavy

Re: [Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-14 Thread Quan Xu
On 2017/11/14 15:12, Wanpeng Li wrote: 2017-11-14 15:02 GMT+08:00 Quan Xu : On 2017/11/13 18:53, Juergen Gross wrote: On 13/11/17 11:06, Quan Xu wrote: From: Quan Xu So far, pv_idle_ops.poll is the only ops for pv_idle. .poll is called in idle path which will poll for a while before we

Re: [Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-14 Thread Quan Xu
On 2017/11/14 15:30, Juergen Gross wrote: On 14/11/17 08:02, Quan Xu wrote: On 2017/11/13 18:53, Juergen Gross wrote: On 13/11/17 11:06, Quan Xu wrote: From: Quan Xu So far, pv_idle_ops.poll is the only ops for pv_idle. .poll is called in idle path which will poll for a while before we

Re: [Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-14 Thread Quan Xu
On 2017/11/14 16:22, Wanpeng Li wrote: 2017-11-14 16:15 GMT+08:00 Quan Xu : On 2017/11/14 15:12, Wanpeng Li wrote: 2017-11-14 15:02 GMT+08:00 Quan Xu : On 2017/11/13 18:53, Juergen Gross wrote: On 13/11/17 11:06, Quan Xu wrote: From: Quan Xu So far, pv_idle_ops.poll is the only ops

Re: [Xen-devel] [PATCH RFC v3 1/6] x86/paravirt: Add pv_idle_ops to paravirt ops

2017-11-14 Thread Quan Xu
On 2017/11/14 18:27, Juergen Gross wrote: On 14/11/17 10:38, Quan Xu wrote: On 2017/11/14 15:30, Juergen Gross wrote: On 14/11/17 08:02, Quan Xu wrote: On 2017/11/13 18:53, Juergen Gross wrote: On 13/11/17 11:06, Quan Xu wrote: From: Quan Xu So far, pv_idle_ops.poll is the only ops for

Re: [Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-16 Thread Quan Xu
On 2017-11-16 06:03, Thomas Gleixner wrote: On Wed, 15 Nov 2017, Peter Zijlstra wrote: On Mon, Nov 13, 2017 at 06:06:02PM +0800, Quan Xu wrote: From: Yang Zhang Implement a generic idle poll which resembles the functionality found in arch/. Provide weak arch_cpu_idle_poll function which

Re: [Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-16 Thread Quan Xu
On 2017-11-16 16:45, Peter Zijlstra wrote: On Wed, Nov 15, 2017 at 11:03:08PM +0100, Thomas Gleixner wrote: If I understand the problem correctly then he wants to avoid the heavy lifting in tick_nohz_idle_enter() in the first place, but there is already an interesting quirk there which makes i

Re: [Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-17 Thread Quan Xu
On 2017-11-16 17:53, Thomas Gleixner wrote: On Thu, 16 Nov 2017, Quan Xu wrote: On 2017-11-16 06:03, Thomas Gleixner wrote: --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -210,6 +210,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv

Re: [Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-17 Thread Quan Xu
On 2017-11-17 19:36, Thomas Gleixner wrote: On Fri, 17 Nov 2017, Quan Xu wrote: On 2017-11-16 17:53, Thomas Gleixner wrote: That's just plain wrong. We don't want to see any of this PARAVIRT crap in anything outside the architecture/hypervisor interfacing code which really need

Re: [Xen-devel] [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

2017-11-19 Thread Quan Xu
On 2017-11-16 17:45, Daniel Lezcano wrote: On 16/11/2017 10:12, Quan Xu wrote: On 2017-11-16 06:03, Thomas Gleixner wrote: On Wed, 15 Nov 2017, Peter Zijlstra wrote: On Mon, Nov 13, 2017 at 06:06:02PM +0800, Quan Xu wrote: From: Yang Zhang Implement a generic idle poll which resembles

Re: [Xen-devel] [PATCH RFC v3 0/6] x86/idle: add halt poll support

2017-11-19 Thread Quan Xu
On 2017-11-16 05:31, Konrad Rzeszutek Wilk wrote: On Mon, Nov 13, 2017 at 06:05:59PM +0800, Quan Xu wrote: From: Yang Zhang Some latency-intensive workload have seen obviously performance drop when running inside VM. The main reason is that the overhead is amplified when running inside VM

Re: [Xen-devel] vTPM Manager VM launch failure: operation not permitted

2017-09-13 Thread Quan Xu
on 2017/9/13 18:42, Wei Liu wrote: Cc VTPM maintainers On Sun, Sep 10, 2017 at 03:07:04PM -0400, Ronny Ko wrote: Hi, I'm a PhD student from Harvard University having a trouble in running vTPM manager. I cannot successfully launch vTPM manager in Xen, because when I command "sudo xl create v

Re: [Xen-devel] vTPM Manager VM launch failure: operation not permitted

2017-09-13 Thread Quan Xu
ile:/home/vtpm2/vmgr,hda,w"] name="vtpmmgr" iomem=["fed40,5"] extra="tpm2" try again, good luck Quan > > On Wed, Sep 13, 2017 at 8:27 AM, Quan Xu wrote: > >> >> >> on 2017/9/13 18:42, Wei Liu wrote: >> >>&

[Xen-devel] [PATCH] MAINTAINERS: update email

2016-07-30 Thread Quan Xu
Signed-off-by: Quan Xu  ---  MAINTAINERS | 2 +-  1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 65c2447..97720a8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -415,7 +415,7 @@ F:  xen/include/asm-x86/hvm/monitor.h  VTPM  M: Daniel De Graaf  -M

[Xen-devel] [PATCH v6 5/5] VT-d: Fix vt-d Device-TLB flush timeout issue

2016-03-02 Thread Quan Xu
If Device-TLB flush is timeout, we'll hide the target ATS device and crash the domain owning this ATS device. If impacted domain is hardware domain, just throw out a warning. The hidden device will be disallowed to be further assigned to any domain. Signed-off-by: Quan Xu --- xen/dr

[Xen-devel] [PATCH v6 4/5] VT-d: Reduce spin timeout to 1ms, which can be boot-time changed

2016-03-02 Thread Quan Xu
Signed-off-by: Quan Xu --- docs/misc/xen-command-line.markdown | 7 +++ xen/drivers/passthrough/vtd/qinval.c | 15 +-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown index a565c1b

[Xen-devel] [PATCH v6 0/5] VT-d Device-TLB flush issue

2016-03-02 Thread Quan Xu
ray blanks inside the parentheses. * Don't iterate over pdev-s without holding that lock, and hold pcidevs_lock for pdev-s list. * Print SBDF in canonical :bb:dd.f form. * Handle 'ret'/'rc' variables in the same function, and remove the pointless rc. Quan Xu (5

[Xen-devel] [PATCH v6 3/5] IOMMU: Make the pcidevs_lock a recursive one

2016-03-02 Thread Quan Xu
Signed-off-by: Quan Xu --- xen/arch/x86/domctl.c | 8 +-- xen/arch/x86/hvm/vmsi.c | 4 +- xen/arch/x86/irq.c | 8 +-- xen/arch/x86/msi.c | 16 ++--- xen/arch/x86/pci.c | 4

[Xen-devel] [PATCH v6 1/5] IOMMU/MMU: Adjust top level functions for VT-d Device-TLB flush error

2016-03-02 Thread Quan Xu
Signed-off-by: Quan Xu --- xen/arch/x86/acpi/power.c | 14 +- xen/arch/x86/mm.c | 13 - xen/arch/x86/mm/p2m-ept.c | 10 +- xen/arch/x86/mm/p2m-pt.c | 12 ++-- xen/common/grant_table.c

[Xen-devel] [PATCH v6 2/5] IOMMU/MMU: Adjust low level functions for VT-d Device-TLB flush error

2016-03-02 Thread Quan Xu
Signed-off-by: Quan Xu --- xen/arch/x86/mm/p2m-ept.c | 2 +- xen/drivers/passthrough/amd/iommu_init.c | 12 ++- xen/drivers/passthrough/amd/pci_amd_iommu.c | 2 +- xen/drivers/passthrough/arm/smmu.c| 10 ++- xen/drivers/passthrough/iommu.c

[Xen-devel] [PATCH 0/2] Make the pcidevs_lock a recursive one

2016-03-08 Thread Quan Xu
Cooper CC: Suravee Suthikulpanit CC: Aravind Gopalakrishnan CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli Quan Xu (2): IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization. IOMMU/spinlock: Make the pcidevs_lock a recursive one xen/arch/x86/domctl.c | 8 +-- xen/ar

[Xen-devel] [PATCH 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization.

2016-03-08 Thread Quan Xu
at least it is not necessary to disable interrupts, or save/restore interrupt flag. In order to fix this, we can use just plain spin{_lock(),_unlock()}, instead of spin_lock{_irqsave(),_irqrestore()}. Signed-off-by: Quan Xu CC: Suravee Suthikulpanit CC: Aravind Gopalakrishnan CC: Dario Faggioli

[Xen-devel] [PATCH 2/2] IOMMU/spinlock: Make the pcidevs_lock a recursive one

2016-03-08 Thread Quan Xu
Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Aravind Gopalakrishnan CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --- xen/arch/x86/domctl.c | 8 +-- xen/arch/x86/hvm/vmsi.c | 4 +- xen

[Xen-devel] [PATCH v2 0/2] Make the pcidevs_lock a recursive one

2016-03-08 Thread Quan Xu
lock a recursive one. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --Changes in v2: * Enhance patch1/2 changelog. * Rebase against 1bd52e1fd66c4. Quan Xu (2): IOMMU/spinlock: Fix a bug found in AMD IOMMU ini

[Xen-devel] [PATCH v2 2/2] IOMMU/spinlock: Make the pcidevs_lock a recursive one

2016-03-08 Thread Quan Xu
Signed-off-by: Quan Xu CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --- xen/arch/x86/domctl.c | 8 +-- xen/arch/x86/hvm/vmsi.c | 4 +- xen/arch/x86/irq.c

[Xen-devel] [PATCH v2 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization.

2016-03-08 Thread Quan Xu
ed, during initialization, when iommu_setup() (which then end up calling set_iommu_interrupt_handler()) is called. In order to fix this, we can use just plain spin_lock() and spin_unlock(), instead of spin_lock_irqsave() and spin_unlock_irqrestore(). Signed-off-by: Quan Xu Reviewed-by: Dario Faggioli C

[Xen-devel] [PATCH v3 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization

2016-03-09 Thread Quan Xu
function is invoked, so we're sure consistency around pcidevs_lock can be guaranteed after this fix. Signed-off-by: Quan Xu Reviewed-by: Dario Faggioli CC: Suravee Suthikulpanit CC: Dario Faggioli CC: Jan Beulich --- xen/drivers/passthrough/amd/iommu_init.c | 5 ++--- 1 file chang

[Xen-devel] [PATCH v3 0/2] Make the pcidevs_lock a recursive one

2016-03-09 Thread Quan Xu
oli --Changes in v3: * Enhance patch1/2 changelog. Quan Xu (2): IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization IOMMU/spinlock: Make the pcidevs_lock a recursive one xen/arch/x86/domctl.c | 8 +-- xen/arch/x86/hvm/vmsi.c | 4 +- xen

[Xen-devel] [PATCH v3 2/2] IOMMU/spinlock: Make the pcidevs_lock a recursive one

2016-03-09 Thread Quan Xu
Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --- xen/arch/x86/domctl.c | 8 +-- xen/arch/x86/hvm/vmsi.c | 4 +- xen/arch

[Xen-devel] [PATCH v4 0/2] Make the pcidevs_lock a recursive one

2016-03-10 Thread Quan Xu
med out. CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --Changes in v4: * Enhance changelogs. * Rebase against 0aa1330aac92. Quan Xu (2): IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization IOMM

[Xen-devel] [PATCH v4 1/2] IOMMU/spinlock: Fix a bug found in AMD IOMMU initialization

2016-03-10 Thread Quan Xu
t has been enabled when this function is invoked, so we're sure consistency around pcidevs_lock can be guaranteed after this fix. Signed-off-by: Quan Xu Reviewed-by: Dario Faggioli CC: Suravee Suthikulpanit CC: Dario Faggioli CC: Jan Beulich CC: Kevin Tian --- xen/drivers/passt

[Xen-devel] [PATCH v4 2/2] IOMMU/spinlock: Make the pcidevs_lock a recursive one.

2016-03-10 Thread Quan Xu
The pcidevs_lock is going to be recursively taken for hiding ATS device, when VT-d Device-TLB flush timed out. Signed-off-by: Quan Xu Acked-by: Kevin Tian CC: Keir Fraser CC: Jan Beulich CC: Andrew Cooper CC: Suravee Suthikulpanit CC: Feng Wu CC: Kevin Tian CC: Dario Faggioli --- xen

[Xen-devel] [PATCH] VT-d: Chop down the DMAR_OPERATION_TIMEOUT to a low number of milliseconds.

2016-03-14 Thread Quan Xu
We confirmed with VT-d hardware team that 1ms is large enough for IOMMU internal flush. So We can change the DMAR_OPERATION_TIMEOUT from 1000 ms to 1 ms. Signed-off-by: Quan Xu CC: Jan Beulich CC: Andrew Cooper CC: Feng Wu CC: Kevin Tian --- xen/drivers/passthrough/vtd/dmar.h | 2 +- 1

  1   2   3   4   >