Messages in this thread | | | From | Dexuan Cui <> | Subject | RE: [PATCH v10 2/2] x86/tdx: Support vmalloc() for tdx_enc_status_changed() | Date | Tue, 5 Sep 2023 18:04:58 +0000 |
| |
> From: Edgecombe, Rick P <rick.p.edgecombe@intel.com> > Sent: Tuesday, September 5, 2023 9:25 AM > [...] > On Fri, 2023-08-11 at 14:48 -0700, Dexuan Cui wrote: > > When a TDX guest runs on Hyper-V, the hv_netvsc driver's > > netvsc_init_buf() > > allocates buffers using vzalloc(), and needs to share the buffers > > with the > > host OS by calling set_memory_decrypted(), which is not working for > > vmalloc() yet. Add the support by handling the pages one by one. > > > > Co-developed-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> > > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com> > > Reviewed-by: Kuppuswamy Sathyanarayanan > > <sathyanarayanan.kuppuswamy@linux.intel.com> > > Signed-off-by: Dexuan Cui <decui@microsoft.com> > > --- > > arch/x86/coco/tdx/tdx.c | 36 ++++++++++++++++++++++++++++++------ > > 1 file changed, 30 insertions(+), 6 deletions(-) > > Reviewed-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Thanks!
> Only small comment, it is possible to have huge vmalloc's now, which > would mean this would do 512 TDVMCALL_MAP_GPA calls instead of 1 when > encountering a huge vmalloc mapping. If this used lookup_address() > directly instead of slow_virt_to_phys(), it could catch this case. I > don't think there are any cases of huge vmallocs today that would get > passed into set_memory_en/decrypted(), so would only be future > proofing. Thanks for the suggestion! So I think let's keep the code as-is for simplicity. We can enhance the code in future when it's necessary.
| |