x86/pci-dma: add a SWIOTLB_ANY flag to lift the low mem limitation
PATCH v3 1/1 x86/pci-dma: add a SWIOTLB_ANY flag to lift the low mem limitation
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in swiotlb_memblock_alloc() to allow allocation of SWIOTLB memory beyond low memory restriction.
Power SVM already supports this, but X86 still faces the same limitation.
Commit: 8ba2ed1be9 (swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction)
---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.
V1 Latest Feedback : https://lists.openwall.net/linux-kernel/2026/02/11/483
v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.
--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/pci-dma.c +1 -1
@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ; } }#else
Signature · 1 line
2.47.1
Quoted 11 lines · Jun Miao
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.Power SVM already supports this, but X86 still faces the same limitation.
Commit:8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>
Quoted 21 lines
---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +0
-0
arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 67
Quoted 8 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ; } }#else
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Hi Marek
Thanks a lot for the ACK on the swiotlb.
It is very important to confirm the functionality. I really appreciate your review @ Marek
Maybe x86 maintainers would also like to hear your thoughts on this, especially since architectures like powerpc already have support for this. Any additional feedback or suggestions on X86 might have would be greatly appreciated.
Best regards,
Jun Miao
Quoted 55 lines · Jun Miao
Quoted 5 lines
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.Quoted 7 lines
Power SVM already supports this, but X86 still faces the same limitation.
Commit:8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>Acked-by Marek Szyprowski <[email protected]>Quoted 9 lines
---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.V1 Latest Feedback :
https://protect2.fireeye.com/v1/url?k=f35668f3-92dd7dc5-f357e3bc-74fe4
85cbff1-e6ff63e2f942f6a7&q=1&e=66eee4e1-a18d-47f9-ad21-f3dfab1d6f09&u=
Quoted 1 line
https%3A%2F%2Flists.openwall.net%2Flinux-
kernel%2F2026%2F02%2F11%2F483
Quoted 14 lines
v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +0
-0arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 67
Quoted 8 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ; } }#else Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Hi,
Kindly requesting feedback from the x86 maintainers on this patch at your earliest convenience.
Thanks,
Aakarsh
Quoted 66 lines · Jun
Hi Marek
Thanks a lot for the ACK on the swiotlb.
It is very important to confirm the functionality. I really appreciate your review @ MarekMaybe x86 maintainers would also like to hear your thoughts on this, especially since architectures like powerpc already have support for this. Any additional feedback or suggestions on X86 might have would be greatly appreciated.
Best regards,
Jun MiaoQuoted 55 lines · Jun Miao
Quoted 5 lines
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.Quoted 7 lines
Power SVM already supports this, but X86 still faces the same limitation.
Commit:8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>Acked-by Marek Szyprowski <[email protected]>Quoted 9 lines
---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.V1 Latest Feedback :
https://protect2.fireeye.com/v1/url?k=f35668f3-92dd7dc5-f357e3bc-74fe4
85cbff1-e6ff63e2f942f6a7&q=1&e=66eee4e1-a18d-47f9-ad21-f3dfab1d6f09&u=
Quoted 1 line
https%3A%2F%2Flists.openwall.net%2Flinux-
kernel%2F2026%2F02%2F11%2F483
Quoted 14 lines
v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +0
-0arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 67
Quoted 8 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ; } }#else Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Borislav Petkov
maintainerOn Thu, Feb 12, 2026 at 05:37:01PM +0800, Jun Miao wrote:
+ Rick.
Quoted 6 lines
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.Power SVM already supports this, but X86 still faces the same limitation.
So?
Quoted 25 lines
Commit:
8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.V1 Latest Feedback : https://lists.openwall.net/linux-kernel/2026/02/11/483
v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +0
-0
arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 64
Quoted 5 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ;
This is not TDX-specific but introduces a change for all encrypted guests.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 13 lines · Jun Miao
+ Rick.
Quoted 6 lines
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.Power SVM already supports this, but X86 still faces the same limitation.
So?
Hi, Boris.
Right, please see 8ba2ed1be90f ("swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction")
Warm regards
Jun Miao
Quoted 41 lines
Quoted 28 lines
Commit:
8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.V1 Latest Feedback :
https://lists.openwall.net/linux-kernel/2026/02/11/483v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +0
-0arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 64
Quoted 5 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ;This is not TDX-specific but introduces a change for all encrypted guests.
--
Regards/Gruss,
Boris.
Borislav Petkov
maintainerQuoted 4 lines · Jun
Quoted 4 lines
Quoted 4 lines
arch/x86/kernel/pci-dma.c +0
-0
Quoted 8 lines
Quoted 8 lines
arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 64
Quoted 6 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ;This is not TDX-specific but introduces a change for all encrypted guests.
^^^^^^^^^^^^
You need to read the whole email.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteWarm regards
Jun Miao
Quoted 13 lines · Jun
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
arch/x86/kernel/pci-dma.c +0
-0Quoted 8 lines
Quoted 8 lines
arch/x86/kernel/pci-dma.c static void __init pci_swiotlb_detect(void) · line 64
Quoted 6 lines
arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ;This is not TDX-specific but introduces a change for all encrypted guests.
Quoted 3 lines
^^^^^^^^^^^^
You need to read the whole email.
Oh, I am so sorry . Aakarsh sent a single email to me writing that:
Hi Jun,
I think the commit message should indeed be updated to reflect that this change benefits all x86 encrypted guests, not just TDX. The condition CC_ATTR_GUEST_MEM_ENCRYPT covers AMD SEV, SEV-ES, SEV-SNP, and Intel TDX. I have tested this on AMD SEV-SNP and it works correctly.
Thanks,
Aakarsh
I replied to him as follows, could you take a look and see how my revisions turned out? Thank you all for pointing this out.
Good suggestion and thank you for testing the ADM SEV-SNP.
I will try V4 adding those to commit with your encouragement O(∩_∩)O. Like this ?
Confidential Virtual Machines (CVMs) include Intel TDX and AMD SEV, SEV-ES, SEV-SNP want to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in swiotlb_memblock_alloc() to allow allocation of SWIOTLB memory beyond low memory restriction.
Quoted 6 lines
--
Regards/Gruss,
Boris.
Borislav Petkov
maintainerQuoted 1 line · Jun
Good suggestion and thank you for testing the ADM SEV-SNP.
I don't think anyone tested it on SNP yet.
Quoted 2 lines
Confidential Virtual Machines (CVMs) include Intel TDX and AMD SEV, SEV-ES, SEV-SNP want to allocate a swiotlb buffer that is not restricted to low memory for
Why do they want that? The "why" is what I am missing in all this text.
Quoted 1 line
the trusted hypervisor scheme.
What is the "trusted hypervisor scheme"?
Quoted 2 lines
Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.
That you don't need to explain - that's visible from the diff.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 4 lines · Jun
Quoted 1 line
Good suggestion and thank you for testing the ADM SEV-SNP.
I don't think anyone tested it on SNP yet.
I only know that SEV-SNP is a more advanced, third-generation feature. Are we using "SEV" here as a shorthand for these?
Quoted 6 lines
Quoted 4 lines
Confidential Virtual Machines (CVMs) include Intel TDX and AMD SEV, SEV-ES, SEV-SNP want to allocate a swiotlb buffer that is not restricted to low memory for
Why do they want that? The "why" is what I am missing in all this text.
This was an oversight on my part. I failed to explain the usage context:
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a
critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected.
Quoted 4 lines
Quoted 2 lines
the trusted hypervisor scheme.
What is the "trusted hypervisor scheme"?
What I mean to convey is that in TEE environments based on AMD SEV or Intel TDX, the core issue is the lack of trust in the hypervisor's VMM.
Quoted 5 lines
Quoted 3 lines
Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.That you don't need to explain - that's visible from the diff.
Ok drop it!
What about the commit description like this in V4 ?
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a
critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected
Confidential VMs include AMD SEV and Intel TDX guests want to allocate a swiotlb buffer that is not restricted to low memory in TEE.
Power SVM already supports this, but X86 still faces the same limitation.
Commit: 8ba2ed1be9 ( "swiotlb: add a SWIOTLB_ANY flag to lift the low memory restriction" )
Quoted 8 lines
Thx.
--
Regards/Gruss,
Boris.
Borislav Petkov
maintainerQuoted 7 lines · Jun
Quoted 4 lines · Jun
Quoted 1 line
Good suggestion and thank you for testing the ADM SEV-SNP.
I don't think anyone tested it on SNP yet.
I only know that SEV-SNP is a more advanced, third-generation feature. Are we using "SEV" here as a shorthand for these?
You have SEV, SEV-ES and SEV-SNP in the order of their appearance and in the order they have gotten additional features. SNP is the one which is has addressed the most if not all? confidential VM attack vectors. And that's the one I care about as the other two are just the prerequisites to the SNP thing. In my opinion only anyway.
Quoted 6 lines
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected.
Yes, that makes more sense. Pls add it to the commit message.
Quoted 2 lines
What I mean to convey is that in TEE environments based on AMD SEV or Intel TDX, the core issue is the lack of trust in the hypervisor's VMM.
Then say it this way. Trusted hypervisor sounds like we trust the HV. Which we absolutely do not.
Quoted 9 lines
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected
Confidential VMs include AMD SEV and Intel TDX guests want to allocate a swiotlb buffer that is not restricted to low memory in TEE.
Sounds better, yes.
Except that we still need to test it on SNP.
Adding some folks on Cc who can do that and take a look at your patch and vet it for SNP - my guest is still broken. :-\
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteHi Borislav,
Quoted 40 lines · Borislav Petkov
Quoted 7 lines · Jun
Quoted 4 lines · Jun
Quoted 1 line
Good suggestion and thank you for testing the ADM SEV-SNP.
I don't think anyone tested it on SNP yet.
I only know that SEV-SNP is a more advanced, third-generation feature. Are we using "SEV" here as a shorthand for these?
You have SEV, SEV-ES and SEV-SNP in the order of their appearance and in the order they have gotten additional features. SNP is the one which is has addressed the most if not all? confidential VM attack vectors. And that's the one I care about as the other two are just the prerequisites to the SNP thing. In my opinion only anyway.
Quoted 6 lines
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected.
Yes, that makes more sense. Pls add it to the commit message.
Quoted 2 lines
What I mean to convey is that in TEE environments based on AMD SEV or Intel TDX, the core issue is the lack of trust in the hypervisor's VMM.
Then say it this way. Trusted hypervisor sounds like we trust the HV. Which we absolutely do not.
Quoted 9 lines
When using confidential VMs, users want to pass through both the high-speed network interface card (NIC) or an 8-GPUs setup into the CVMs. During data transfer, the SWIOTLB bounce buffer becomes a critical "hot path" acting as an intermediary for convertor between private and shared memory. consequently, the capacity requirement increases—otherwise, network or data transfer performance would be adversely affected
Confidential VMs include AMD SEV and Intel TDX guests want to allocate a swiotlb buffer that is not restricted to low memory in TEE.
Quoted 7 lines
Sounds better, yes.
Except that we still need to test it on SNP.
Adding some folks on Cc who can do that and take a look at your patch and vet it for SNP - my guest is still broken. :-\
I tested this patch on a SEV-SNP guest and it works as expected. The SWIOTLB buffer is now allocated above the 4 GB low-memory boundary, confirming that the SWIOTLB_ANY flag takes effect on SNP as well. I was also able to scale the bounce buffer size up to support larger networking workloads.
From kernel dmesg logs:
root@ubuntu:/home/ubuntu# dmesg | grep -i sev [ 21.191917] Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP [ 21.192883] SEV: Status: SEV SEV-ES SEV-SNP [ 21.401897] SEV: APIC: wakeup_secondary_cpu() replaced with wakeup_cpu_via_vmgexit() [ 22.117267] SEV: Using SNP CPUID table, 28 entries present. [ 22.117884] SEV: SNP running at VMPL0. [ 24.164260] SEV: SNP guest platform devices initialized. [ 28.815142] systemd[1]: Detected confidential virtualization sev-snp. [ 30.063831] sev-guest sev-guest: Initialized SEV guest driver (using VMPCK0 communication key) root@ubuntu:/home/ubuntu# dmesg | grep -i "IO TLB" [ 6.743607] software IO TLB: area num 4. [ 24.164169] software IO TLB: mapped [mem 0x0000001df9c00000-0x0000001ff9c00000] (8192MB) [ 24.331266] software IO TLB: Memory encryption is active and system is using DMA bounce buffers root@ubuntu:/home/ubuntu#
Thanks,
Aakarsh> Thx.
Quoted 1 line
Borislav Petkov
maintainerQuoted 4 lines · Aakarsh Jain
I tested this patch on a SEV-SNP guest and it works as expected. The SWIOTLB buffer is now allocated above the 4 GB low-memory boundary, confirming that the
SWIOTLB_ANYflag takes effect on SNP as well. I was also able to scale the bounce buffer size up to support larger networking workloads.
Ok, pls send a Tested-by when Jun sends a new version of the patch.
Thx.
Signature · 4 lines
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquetteQuoted 6 lines
Sounds better, yes.
Except that we still need to test it on SNP.
Adding some folks on Cc who can do that and take a look at your patch and vet it for SNP - my guest is still broken. :-\
Hi Boris,
Thanks for getting involved and showing your support, I look forward to further updates from CC folks :-)
I would also like to further thank Aakarsh for the detailed dmesg information about SEV-SNP:
From kernel dmesg logs:
root@ubuntu:/home/ubuntu# dmesg | grep -i sev [ 21.191917] Memory Encryption Features active: AMD SEV SEV-ES SEV-SNP [ 21.192883] SEV: Status: SEV SEV-ES SEV-SNP ... ... root@ubuntu:/home/ubuntu# dmesg | grep -i "IO TLB" [ 6.743607] software IO TLB: area num 4. [ 24.164169] software IO TLB: mapped [mem 0x0000001df9c00000-0x0000001ff9c00000] (8192MB)
Warm regards
Jun Miao
Quoted 4 lines · Jun Miao
Intel TDX guest wants to allocate a swiotlb buffer that is not restricted to low memory for the trusted hypervisor scheme. Adding a new flag will be used in
swiotlb_memblock_alloc()to allow allocation of SWIOTLB memory beyond low memory restriction.
What about those devices with DMA masks < 64bit which needed swiotlb in the first place?
The DMA layer on coco VMs shares coherent memory (from anywhere), why focus on swiotlb alone?
Here is ongoing work to get rid of SWIOTLB_FORCE and do other things with swiotlb:
https://lore.kernel.org/r/[email protected]
so this patch is likely to conflict with that series. Thanks,
Quoted 35 lines
Power SVM already supports this, but X86 still faces the same limitation.
Commit:8ba2ed1be9(swiotlb: add aSWIOTLB_ANYflag to lift the low memory restriction)Reviewed-by Aakarsh Jain <[email protected]>Tested-by Aakarsh Jain <[email protected]>Signed-off-by Jun Miao <[email protected]>---
V1 -> V2:
1.Updated commit message and description.
2.Add Reviewed and Tested.V1 Latest Feedback : https://lists.openwall.net/linux-kernel/2026/02/11/483
v2 -> v3:
We can alloc 4GB with the dynamic swiotlb, rather than 1GB. 1G is not correct. So change the commit log.--- arch/x86/kernel/pci-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/kernel/pci-dma.c +1
-1@@ -61,7 +61,7 @@ static void __init pci_swiotlb_detect(void)*/ if (cc_platform_has (CC_ATTR_GUEST_MEM_ENCRYPT )) { x86_swiotlb_enable = true; - x86_swiotlb_flags |=SWIOTLB_FORCE ; + x86_swiotlb_flags |=SWIOTLB_ANY |SWIOTLB_FORCE ; } }#else
Signature · 1 line
Alexey