Commit dfcf2e01 authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Christoph Hellwig

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: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 0280e3c5
...@@ -207,8 +207,6 @@ void __init swiotlb_update_mem_attributes(void) ...@@ -207,8 +207,6 @@ void __init swiotlb_update_mem_attributes(void)
mem->vaddr = swiotlb_mem_remap(mem, bytes); mem->vaddr = swiotlb_mem_remap(mem, bytes);
if (!mem->vaddr) if (!mem->vaddr)
mem->vaddr = vaddr; mem->vaddr = vaddr;
memset(mem->vaddr, 0, bytes);
} }
static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start, static void swiotlb_init_io_tlb_mem(struct io_tlb_mem *mem, phys_addr_t start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment