From: Christoph Hellwig <hch@infradead.org>
To: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Christoph Hellwig <hch@infradead.org>,
"Kirill A. Shutemov" <kirill@shutemov.name>,
iommu@lists.linux-foundation.org
Subject: Re: Memory clearing in swiotlb_update_mem_attributes()
Date: Wed, 5 Jan 2022 06:12:34 -0800 [thread overview]
Message-ID: <YdWnUmJsjPUYiycV@infradead.org> (raw)
In-Reply-To: <d16046ad-7828-a015-b6a3-3ed01ed15bac@amd.com>
On Wed, Jan 05, 2022 at 08:06:10AM -0600, Tom Lendacky wrote:
> On 1/4/22 4:49 PM, Kirill A. Shutemov wrote:
> > Hi Tom,
> >
> > For larger TDX VM, memset() after set_memory_decrypted() in
> > swiotlb_update_mem_attributes() takes substantial portion of boot time.
> >
> > It makes me wounder why do we need it there? Malicious VMM can mess with
> > decrypted/shared buffer at any point and for normal use it will be
> > populated with real data anyway.
> >
> > Can we drop it?
>
> Probably more a question for Christoph. Does SWIOTLB need to be initialized
> to zeroes? If it does, then the memset after the set_memory_decrypted() is
> required, otherwise it will appear as ciphertext to SWIOTLB.
While the traditional swiotlb initialization zeroes it I can't really
see any reason why we would want to zero it. If we really care about
not leaking data to the device we'd need to zero the padding at mapping
time.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2022-01-05 14:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 22:49 Memory clearing in swiotlb_update_mem_attributes() Kirill A. Shutemov
2022-01-05 14:06 ` Tom Lendacky via iommu
2022-01-05 14:12 ` Christoph Hellwig [this message]
2022-01-05 15:58 ` Kirill A. Shutemov
2022-01-10 15:58 ` Tom Lendacky via iommu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YdWnUmJsjPUYiycV@infradead.org \
--to=hch@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=kirill@shutemov.name \
--cc=thomas.lendacky@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.