Re: [PATCHv12 9/9] x86/tdx: Add unaccepted memory support

From: Isaku Yamahata
Date: Tue May 30 2023 - 20:58:45 EST


On Fri, May 19, 2023 at 02:14:34AM +0300,
"Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx> wrote:

> Hookup TDX-specific code to accept memory.
>
> Accepting the memory is the same process as converting memory from
> shared to private: kernel notifies VMM with MAP_GPA hypercall and then
> accept pages with ACCEPT_PAGE module call.
>
> THE implementation in core kernel uses tdx_enc_status_changed(). It
> already used for converting memory to shared and back for I/O
> transactions.

Because unaccepted memory reported in e820 means private[1], MAP_GPA isn't
needed to accept memory. (Or are you seeing TDX KVM/qemu issue?)

[1]TDX Virtual Firmware Design Guide.
7.2.1 Memroy Type in TD Resrouce HOB. Table 7-1: Mmeory Typein TD Resource HOB.
--
Isaku Yamahata <isaku.yamahata@xxxxxxxxx>