I will build the next RFC version of 64-bit swiotlb on top of this patch (or
next version of this patch), so that it will render a more finalized view of
32-bt/64-bit plus multiple area.
Thank you very much!
Dongli Zhang
On 6/22/22 3:54 AM, Christoph Hellwig wrote:
> Thanks,
>
> t
On 6/11/22 1:25 AM, Dongli Zhang wrote:
> Panic on purpose if nslabs is too small, in order to sync with the remap
> retry logic.
>
> In addition, print the number of bytes for tlb alloc failure.
>
> Signed-off-by: Dongli Zhang
> ---
> kernel/dma/swiotlb.c | 6 +++
Panic on purpose if nslabs is too small, in order to sync with the remap
retry logic.
In addition, print the number of bytes for tlb alloc failure.
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c
Fix the usage of swiotlb param in kernel doc.
Signed-off-by: Dongli Zhang
---
Documentation/x86/x86_64/boot-options.rst | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/Documentation/x86/x86_64/boot-options.rst
b/Documentation/x86/x86_64/boot-options.rst
index
Hello,
The patch 1-2 are to cleanup unused variable and return type.
The patch 3 is to fix the param usage description in kernel doc.
The patch 4 is to panic on purpose when nslabs is too small.
Dongli Zhang:
[PATCH v1 1/4] swiotlb: remove unused swiotlb_force
[PATCH v1 2/4] swiotlb
Both swiotlb_init_remap() and swiotlb_init() have return type void.
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index cb50f8d38360..fd21f4162f4b 100644
--- a/kernel/dma
The 'swiotlb_force' is removed since commit c6af2aa9ffc9 ("swiotlb: make
the swiotlb_init interface more useful").
Signed-off-by: Dongli Zhang
---
include/linux/swiotlb.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.
otice it is the
default 'io_tlb_default_mem', but will not be able to know if it is allocated
from 32-bit or 64-bit buffer.
Thank you very much for the feedback.
Dongli Zhang
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
/kernel/debug/swiotlb/swiotlb-hi/io_tlb_nslabs
3145728
$ cat /sys/kernel/debug/swiotlb/swiotlb-hi/io_tlb_used
8960
Dongli Zhang (7):
swiotlb: introduce the highmem swiotlb buffer
swiotlb: change the signature of remap function
swiotlb-xen: support highmem for xen specific code
swiotlb: to imp
Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
drivers/xen/swiotlb-xen.c | 14 +++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 339f46e21053..d15321e9f9db 100644
--- a/drivers/xen/swiotlb-xen.c
+++ b
n a
value smaller than the expected one. As a result, the swiotlb_bounce()
will access a wrong swiotlb slot.
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/swiotlb.c b/
mmand line "swiotlb=32768,3145728,force" is to allocate 64MB
for default swiotlb, and 6GB for the extra highmem swiotlb.
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
include/linux/swiotlb.h | 2 ++
kernel/dma/swiotlb.c| 16
2 files changed,
Add new argument 'high' to remap function, so that it will be able to
remap the swiotlb buffer based on whether the swiotlb is 32-bit or
64-bit.
Currently the only remap function is xen_swiotlb_fixup().
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
arch/x86/inclu
em.nslabs) returns true.
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
arch/powerpc/kernel/dma-swiotlb.c | 8 ++-
arch/x86/kernel/pci-dma.c | 5 +-
include/linux/swiotlb.h | 2 +-
kernel/dma/swiotlb.c | 103 +-
4 file
When the swiotlb is enforced (e.g., when amd sev is involved), the virito
driver will not be able to use 4+ GB memory. Therefore, the virtio driver
uses 'io_tlb_high_mem' as swiotlb.
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
drivers/virtio/virtio.c | 8 ++
The interface re-configures dev->dma_io_tlb_mem conditionally, if the
'io_tlb_high_mem' is active.
Cc: Konrad Wilk
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
include/linux/swiotlb.h | 6 ++
kernel/dma/swiotlb.c| 10 ++
2 files changed, 16 insertions(+)
diff --
;
> nslabs = SLABS_PER_PAGE << order;
> bytes = nslabs << IO_TLB_SHIFT;
> @@ -323,6 +343,16 @@ int swiotlb_init_late(size_t size, gfp_t gfp_mask)
> (PAGE_SIZE << order) >> 20);
> nslabs = SLABS_PER_PAGE <<
ted DMA patchset is going to supports 64-bit (or
high memory) DMA. Is this what you are looking for?
Dongli Zhang
>
> Michael
>
> [1]
> https://urldefense.com/v3/__https://lore.kernel.org/lkml/20220209122302.213882-1-ltyker...@gmail.com/__;!!ACWV5N9M2RV99hQ!fUx4fMgdQIrqJDDy-pbv
This patch is to enable the 64-bit xen-swiotlb buffer.
For Xen PVM DMA address, the 64-bit device will be able to allocate from
64-bit swiotlb buffer.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
drivers/xen/swiotlb-xen.c | 117 --
1 file changed, 74
enable 64-bit
xen-swiotlb.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
drivers/xen/swiotlb-xen.c | 75 +--
1 file changed, 40 insertions(+), 35 deletions(-)
diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
index 662638093542..e18cae693cdc 100644
el will be able to allocate >4GB swiotlb buffer.
This patch is only for swiotlb, not including xen-swiotlb.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
arch/mips/cavium-octeon/dma-octeon.c | 3 +-
arch/powerpc/kernel/dma-swiotlb.c| 2 +-
arch/powerpc/platforms/pseries/svm.
vm# cat /sys/kernel/debug/swiotlb/io_tlb_nslabs
65536
vm# cat /sys/kernel/debug/swiotlb/io_tlb_used
0
vm# cat /sys/kernel/debug/swiotlb/io_tlb_nslabs-highmem
1048576
vm# cat /sys/kernel/debug/swiotlb/io_tlb_used-highmem
64647
Please let me know if there is any feedback for this idea and RFC.
Don
- no_iotlb_memory
There is no functional change and this is to prepare to enable 64-bit
swiotlb.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
arch/powerpc/platforms/pseries/svm.c | 6 +-
drivers/xen/swiotlb-xen.c| 4 +-
include/linux/swiotlb.h | 5 +-
kernel/dma/swiotlb.c
This is just to define new enumerated type without functional change.
The 'SWIOTLB_LO' is to index legacy 32-bit swiotlb buffer, while the
'SWIOTLB_HI' is to index the 64-bit buffer.
This is to prepare to enable 64-bit swiotlb.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
This patch introduces swiotlb_get_type() in order to calculate which
swiotlb buffer the given DMA address is belong to.
This is to prepare to enable 64-bit swiotlb.
Cc: Joe Jin
Signed-off-by: Dongli Zhang
---
include/linux/swiotlb.h | 14 ++
kernel/dma/swiotlb.c| 2 ++
2
On 04/15/2019 07:26 PM, Konrad Rzeszutek Wilk wrote:
>
>
> On Mon, Apr 15, 2019, 2:50 AM Dongli Zhang <mailto:dongli.zh...@oracle.com>> wrote:
>
> As the patch to be fixed is still in Konrad's own tree, I will send the
> v2 for
> the patch to be f
As the patch to be fixed is still in Konrad's own tree, I will send the v2 for
the patch to be fixed, instead of an incremental fix.
Dongli Zhang
On 4/12/19 10:13 PM, Joe Jin wrote:
> I'm good to have this patch, which helps identify the cause of failure is
> fragmentation or it
iotlb: dump used and total slots when swiotlb buffer is
full")
Suggested-by: HÃ¥kon Bugge
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 857e823..6f7619c 10
602fe6d4e9 ("swiotlb: add
debugfs to track swiotlb buffer usage"), both 'io_tlb_used' and
'io_tlb_nslabs' are printed when swiotlb buffer is full.
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ker
This patch uses io_tlb_used to help check whether swiotlb buffer is full.
io_tlb_used is no longer used for only debugfs. It is also used to help
optimize swiotlb_tbl_map_single().
Suggested-by: Joe Jin
Signed-off-by: Dongli Zhang
---
Changed since v2:
* move #ifdef folding to previous patch
Fix the comment as swiotlb_bounce() is used to copy from original dma
location to swiotlb buffer during swiotlb_tbl_map_single(), while to
copy from swiotlb buffer to original dma location during
swiotlb_tbl_unmap_single().
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 2 +-
1 file
swiotlb buffer to pre-allocate or analyze device driver memory leak issue.
Signed-off-by: Dongli Zhang
---
Changed since v1:
* init debugfs with late_initcall (suggested by Robin Murphy)
* create debugfs entries with debugfs_create_ulong(suggested by Robin Murphy)
Changed since v2:
* some
Hi Konrad,
Would you please take a look on those two patches?
In addition, there is another patch correcting an error in comment.
https://lkml.org/lkml/2018/12/5/1721
Thank you very much!
Dongli Zhang
On 12/11/2018 05:05 AM, Joe Jin wrote:
> On 12/10/18 12:00 PM, Tim Chen wr
This patch uses io_tlb_used to help check whether swiotlb buffer is full.
io_tlb_used is no longer used for only debugfs. It is also used to help
optimize swiotlb_tbl_map_single().
Suggested-by: Joe Jin
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 10 --
1 file changed, 4
swiotlb buffer to pre-allocate or analyze device driver memory leak issue.
Signed-off-by: Dongli Zhang
---
Changed since v1:
* init debugfs with late_initcall (suggested by Robin Murphy)
* create debugfs entries with debugfs_create_ulong(suggested by Robin Murphy)
kernel/dma/swiotlb.c | 50
Hi Robin,
On 12/07/2018 09:17 PM, Robin Murphy wrote:
> On 07/12/2018 05:49, Dongli Zhang wrote:
>>
>>
>> On 12/07/2018 12:12 AM, Joe Jin wrote:
>>> Hi Dongli,
>>>
>>> Maybe move d_swiotlb_usage declare into swiotlb_create_debugfs():
>>
>
t any free slots or not enough slots, return fail directly?
This would optimize the slots allocation path. I will follow this in next
version after I got more suggestions and confirmations from maintainers.
Thank you very much!
Dongli Zhang
>
> Thanks,
> Joe
> On 12/5/18 7:59 PM, Do
Fix the comment as swiotlb_bounce() is used to copy from original dma
location to swiotlb buffer during swiotlb_tbl_map_single(), while to
copy from swiotlb buffer to original dma location during
swiotlb_tbl_unmap_single().
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 2 +-
1 file
swiotlb buffer to pre-allocate or analyze device driver memory leak issue.
As the swiotlb can be initialized at very early stage when debugfs cannot
register successfully, this patch creates the debugfs entry on demand.
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 57
Fix the comment as swiotlb_bounce() is used to copy from original dma
location to swiotlb buffer during swiotlb_tbl_map_single(), while to
copy from swiotlb buffer to original dma location during
swiotlb_tbl_unmap_single().
Signed-off-by: Dongli Zhang
---
kernel/dma/swiotlb.c | 2 +-
1 file
40 matches
Mail list logo