Re: [PATCH v5 4/6] virt: tdx-guest: Add a helper for the Quote buffer size

From: Edgecombe, Rick P

Date: Tue Sep 29 2026 - 11:45:55 EST


On Tue, 2026-09-29 at 03:32 -0700, Peter Fang wrote:
> On Mon, Sep 28, 2026 at 12:13:12PM -0700, Edgecombe, Rick P wrote:
> > On Mon, 2026-09-28 at 09:13 -0700, Dave Hansen wrote:
> > > Please explain the goal of this function. Why is it doing what it is
> > > doing? This should also explain why it is page-aligning and caching
> > > things.
> >
> > I'm not sure it actually needs to be. It shortens the math in the places
> > where it needs to calculate the pages. And then in tdx_report_new_locked()
> > it skips zeroing the whole buffer (not sure why to zero the buffer actually.
> > Seems it
>
> I talked to the TDX security folks and this seems to be a hygiene thing.

???

> Skipping the zeroing shouldn't pose a security risk.

It is allocated __GFP_ZERO so today the whole thing already gets zeroed before
being set shared. After that it is a shared buffer and host can read/write it as
much as they want.