There's little reason to use a heap-allocated buffer for requesting TD reports putting it behind a global lock. Furthermore, the TDX module doesn't require the additional data to be inside the TD report buffer. Instead, put the buffer on the stack and directly pass a pointer to the additional data.
Note that with and without this patch, the memory passed to the TDX module must be identity-mapped.
There's little reason to use a heap-allocated buffer for requesting TD reports putting it behind a global lock. Furthermore, the TDX module doesn't require the additional data to be inside the TD report buffer. Instead, put the buffer on the stack and directly pass a pointer to the additional data. Note that with and without this patch, the memory passed to the TDX module must be identity-mapped.