lkml.org 
[lkml]   [2024]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH 08/16] KVM: x86/mmu: Bug the VM if kvm_zap_gfn_range() is called for TDX
    From


    On 17/05/2024 9:46 am, Edgecombe, Rick P wrote:
    > On Tue, 2024-05-14 at 17:59 -0700, Rick Edgecombe wrote:
    >>
    >> For lack of a better method currently, use kvm_gfn_shared_mask() to
    >> determine if private memory cannot be zapped (as in TDX, the only VM type
    >> that sets it).
    >
    > Trying to replace kvm_gfn_shared_mask() with something appropriate, I saw that
    > SNP actually uses this function:
    > https://lore.kernel.org/kvm/20240501085210.2213060-12-michael.roth@amd.com/
    >
    > So trying to have a helper that says "The VM can't zap and refault in memory at
    > will" won't cut it. I guess there would have to be some more specific. I'm
    > thinking to just drop this patch instead.

    Or KVM_BUG_ON() in the callers by explicitly checking VM type being TDX
    as I mentioned before.

    Having such checking in a generic function like this is just dangerous
    and not flexible.

    Just my 2 cents, though.

    \
     
     \ /
      Last update: 2024-05-27 18:30    [W:4.081 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site