History

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().

Kirill A. Shutemov committed 4 years ago

Commit dfcf2e01 parent 0280e3c1 file · +0 −2Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/dma/swiotlb.c+0−2
@@ -207,8 +207,6 @@ void __init swiotlb_update_mem_attributes(void) · 206 unmodified lines
207 mem->vaddr = swiotlb_mem_remap(mem, bytes);207 mem->vaddr = swiotlb_mem_remap(mem, bytes);
208 if (!mem->vaddr)208 if (!mem->vaddr)
209 mem->vaddr = vaddr;209 mem->vaddr = vaddr;
210
211 memset(mem->vaddr, 0, bytes);
212}210}
213 211
214static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,212static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,