Skip to content

Commit dfcf2e0

Browse files
kirylChristoph Hellwig
authored andcommitted
swiotlb: do not zero buffer in set_memory_decrypted()
For larger TDX VM, memset() after set_memory_decrypted() in swiotlb_update_mem_attributes() takes substantial portion of boot time. Zeroing doesn't serve any functional purpose. Malicious VMM can mess with decrypted/shared buffer at any point. Remove the memset(). Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Acked-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 0280e3c commit dfcf2e0

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

kernel/dma/swiotlb.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,6 @@ void __init swiotlb_update_mem_attributes(void)
207207
mem->vaddr = swiotlb_mem_remap(mem, bytes);
208208
if (!mem->vaddr)
209209
mem->vaddr = vaddr;
210-
211-
memset(mem->vaddr, 0, bytes);
212210
}
213211

214212
static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,

0 commit comments

Comments
 (0)