lkml.org 
[lkml]   [2023]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v6 2/6] x86/tdx: Support vmalloc() for tdx_enc_status_changed()
    On Tue, May 23, 2023 at 01:39:11PM -0700, Dave Hansen wrote:
    > On 5/4/23 15:53, 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.
    >
    > I think this sets a bad precedent.
    >
    > There are consequences for converting pages between shared and private.
    > Doing it on a vmalloc() mapping is guaranteed to fracture the underlying
    > EPT/SEPT mappings.
    >
    > How does this work with load_unaligned_zeropad()? Couldn't it be
    > running around poking at one of these vmalloc()'d pages via the direct
    > map during a shared->private conversion before the page has been accepted?

    Alias processing in __change_page_attr_set_clr() will change direct
    mapping if you call it on vmalloc()ed memory. I think we are safe wrt
    load_unaligned_zeropad() here.
    --
    Kiryl Shutsemau / Kirill A. Shutemov

    \
     
     \ /
      Last update: 2023-05-24 00:39    [W:3.634 / U:0.252 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site