diff options
author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2022-01-25 16:20:01 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2022-01-26 17:05:54 +0100 |
commit | dfcf2e017f5bb928094952d5d56d3566d3d07ba7 (patch) | |
tree | 8a52cc0db08e9e858df46fd6e5bdb881c80faa41 /kernel/dma | |
parent | 0280e3c58f92b2fe0e8fbbdf8d386449168de4a8 (diff) | |
download | linux-next-dfcf2e017f5bb928094952d5d56d3566d3d07ba7.tar.gz |
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>
Diffstat (limited to 'kernel/dma')
-rw-r--r-- | kernel/dma/swiotlb.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index f1e7ea160b43..9390b38d2897 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -207,8 +207,6 @@ void __init swiotlb_update_mem_attributes(void) mem->vaddr = swiotlb_mem_remap(mem, bytes); if (!mem->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, |