RE: [PATCH v3 2/2] iommu/vt-d: avoid duplicated removing in __domain_mapping

2021-10-07 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Friday, October 8, 2021 10:44 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; dw...@infradead.org; w...@kernel.org; > j...@8bytes.org > Cc: baolu...@linux.intel.c

[PATCH v3 2/2] iommu/vt-d: avoid duplicated removing in __domain_mapping

2021-10-07 Thread Longpeng(Mike)
0x1c, end_pfn: 0x1f iov_pfn: 0x20, end_pfn: 0x23 ... it only need 9ms now. Signed-off-by: Longpeng(Mike) --- drivers/iommu/intel/iommu.c | 11 ++- include/linux/intel-iommu.h | 6 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/drivers/i

[PATCH v3 1/2] iommu/vt-d: convert the return type of first_pte_in_page to bool

2021-10-07 Thread Longpeng(Mike)
first_pte_in_page() returns boolean value, so let's convert its return type to bool. In addition, use 'IS_ALIGNED' to make the code more readable and neater. Signed-off-by: Longpeng(Mike) --- include/linux/intel-iommu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

[PATCH v3 0/2] iommu/vt-d: boost the mapping process

2021-10-07 Thread Longpeng(Mike)
olu] - remove meaningless BUG_ON() in __domain_mapping() [Baolu] Changes v1 -> v2: - Fix compile warning on i386 [Baolu] Longpeng(Mike) (2): iommu/vt-d: convert the return type of first_pte_in_page to bool iommu/vt-d: avoid duplicated removing in __domain_mapping drivers/iommu/intel/iommu.

RE: [PATCH v2 1/2] iommu/vt-d: convert the return type of first_pte_in_page to bool

2021-10-07 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, October 7, 2021 2:18 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; dw...@infradead.org; w...@kernel.org; > j...@8bytes.org > Cc: baolu...@l

[PATCH v2 2/2] iommu/vt-d: avoid duplicated removing in __domain_mapping

2021-10-05 Thread Longpeng(Mike)
0x1c, end_pfn: 0x1f iov_pfn: 0x20, end_pfn: 0x23 ... it only need 9ms now. Signed-off-by: Longpeng(Mike) --- drivers/iommu/intel/iommu.c | 12 +++- include/linux/intel-iommu.h | 6 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/i

[PATCH v2 1/2] iommu/vt-d: convert the return type of first_pte_in_page to bool

2021-10-05 Thread Longpeng(Mike)
first_pte_in_page() returns boolean value, so let's convert its return type to bool. Signed-off-by: Longpeng(Mike) --- include/linux/intel-iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 05a65eb..a5

[PATCH v2 0/2] iommu/vt-d: boost the mapping process

2021-10-05 Thread Longpeng(Mike)
olu] Longpeng(Mike) (2): iommu/vt-d: convert the return type of first_pte_in_page to bool iommu/vt-d: avoid duplicated removing in __domain_mapping drivers/iommu/intel/iommu.c | 12 +++- include/linux/intel-iommu.h | 8 +++- 2 files changed, 14 insertions(+), 6 deletions(-) -- 1.8.

[PATCH v1 2/2] iommu/vt-d: avoid duplicated removing in __domain_mapping

2021-09-15 Thread Longpeng(Mike)
0x1c, end_pfn: 0x1f iov_pfn: 0x20, end_pfn: 0x23 ... it only need 9ms now. Signed-off-by: Longpeng(Mike) --- drivers/iommu/intel/iommu.c | 12 +++- include/linux/intel-iommu.h | 6 ++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/i

[PATCH v1 1/2] iommu/vt-d: convert the return type of first_pte_in_page to bool

2021-09-15 Thread Longpeng(Mike)
first_pte_in_page() returns boolean value, so let's convert its return type to bool. Signed-off-by: Longpeng(Mike) --- include/linux/intel-iommu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index 05a65eb..a5

[PATCH v1 0/2] iommu/vt-d: boost the mapping process

2021-09-15 Thread Longpeng(Mike)
Hi guys, We found that the __domain_mapping() would take too long when the memory region is too large, we try to make it faster in this patchset. The performance number can be found in PATCH 2, please review when you free, thanks. Longpeng(Mike) (2): iommu/vt-d: convert the return type of

[PATCH v2] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-14 Thread Longpeng(Mike)
Fixes: 6491d4d02893 ("intel-iommu: Free old page tables before creating superpage") Cc: # v3.0+ Link: https://lore.kernel.org/linux-iommu/670baaf8-4ff8-4e84-4be3-030b95ab5...@huawei.com/ Suggested-by: Lu Baolu Signed-off-by: Longpeng(Mike) --- v1 -> v2: - add Joerg - reconstruct the so

RE: [PATCH] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-08 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Baolu, > -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, April 8, 2021 12:32 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org > Cc: bao

RE: [PATCH] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-06 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Baolu, > -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Friday, April 2, 2021 12:44 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; iommu@lists.linux-foundation.org; > linux-ker...@vger.kernel.org > Cc: bao

Re: [PATCH] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-01 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Baolu, 在 2021/4/2 11:06, Lu Baolu 写道: > Hi Longpeng, > > On 4/1/21 3:18 PM, Longpeng(Mike) wrote: >> The translation caches may preserve obsolete data when the >> mapping size is changed, suppose the following sequence which >> can reveal the problem with high pr

[PATCH] iommu/vt-d: Force to flush iotlb before creating superpage

2021-04-01 Thread Longpeng(Mike)
ntel-iommu: Free old page tables before creating superpage") Cc: # v3.0+ Link: https://lore.kernel.org/linux-iommu/670baaf8-4ff8-4e84-4be3-030b95ab5...@huawei.com/ Suggested-by: Lu Baolu Signed-off-by: Longpeng(Mike) --- drivers/iommu/intel/iommu.c | 15 +-- 1 file changed, 13 i

RE: A problem of Intel IOMMU hardware ?

2021-03-21 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > Sent: Monday, March 22, 2021 7:51 AM > To: 'Nadav Amit' > Cc: Tian, Kevin ; chenjiashang > ; David Woodhouse ; > iommu@lists.linux-foundation.org; LKML ; > a

RE: A problem of Intel IOMMU hardware ?

2021-03-21 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Nadav, > -Original Message- > From: Nadav Amit [mailto:nadav.a...@gmail.com] > Sent: Friday, March 19, 2021 12:46 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: Tian, Kevin ; chenjiashang > ; David Woodhouse ; > iommu@lists.li

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Tian, Kevin [mailto:kevin.t...@intel.com] > Sent: Thursday, March 18, 2021 4:56 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; Nadav Amit > Cc: chenjiashang ; David Woodhouse > ; iommu@lists.linux

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Tian, Kevin [mailto:kevin.t...@intel.com] > Sent: Thursday, March 18, 2021 4:43 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; Nadav Amit > Cc: chenjiashang ; David Woodhouse > ; iommu@lists.linux

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
> -Original Message- > From: Tian, Kevin [mailto:kevin.t...@intel.com] > Sent: Thursday, March 18, 2021 4:27 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; Nadav Amit > Cc: chenjiashang ; David Woodhouse > ; iommu@lists.linux

RE: A problem of Intel IOMMU hardware ?

2021-03-18 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Nadav, > -Original Message- > From: Nadav Amit [mailto:nadav.a...@gmail.com] > Sent: Thursday, March 18, 2021 2:13 AM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: David Woodhouse ; Lu Baolu > ; Joerg Roedel ; w...@kernel.org; > al

RE: A problem of Intel IOMMU hardware ?

2021-03-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi guys, I provide more information, please see below > -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Thursday, March 18, 2021 10:59 AM > To: Alex Williamson > Cc: baolu...@linux.intel.com; Longpeng (Mike, Cloud Infrastructure Service &

RE: A problem of Intel IOMMU hardware ?

2021-03-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Baolu, > -Original Message- > From: Lu Baolu [mailto:baolu...@linux.intel.com] > Sent: Wednesday, March 17, 2021 1:17 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > ; dw...@infradead.org; j...@8bytes.org; > w...@kernel.org; alex.william...@redh

RE: A problem of Intel IOMMU hardware ?

2021-03-17 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi Nadav, > -Original Message- > From: Nadav Amit [mailto:nadav.a...@gmail.com] > Sent: Wednesday, March 17, 2021 1:46 PM > To: Longpeng (Mike, Cloud Infrastructure Service Product Dept.) > > Cc: David Woodhouse ; Lu Baolu > ; Joerg Roedel ; w...@kernel.org; > al

A problem of Intel IOMMU hardware ?

2021-03-16 Thread Longpeng (Mike, Cloud Infrastructure Service Product Dept.)
Hi guys, We find the Intel iommu cache (i.e. iotlb) maybe works wrong in a special situation, it would cause DMA fails or get wrong data. The reproducer (based on Alex's vfio testsuite[1]) is in attachment, it can reproduce the problem with high probability (~50%). The machine we used is: proces