lkml.org 
[lkml]   [2022]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 046/108] KVM: Add flags to struct kvm_gfn_range
On Wed, Dec 14, 2022 at 10:51:31AM +0000,
"Huang, Kai" <kai.huang@intel.com> wrote:

> On Sat, 2022-10-29 at 23:22 -0700, isaku.yamahata@intel.com wrote:
> > From: Isaku Yamahata <isaku.yamahata@intel.com>
> >
> > kvm_unmap_gfn_range() needs to know the reason of the callback for TDX.
> > mmu notifier, set memattr ioctl or restrictedmem notifier. Based on the
> > reason, TDX changes the behavior. For mmu notifier, it's the operation on
> > shared memory slot to zap shared PTE. For set memattr, private<->shared
> > conversion, zap the original PTE. For restrictedmem, it's a hint that TDX
> > can ignore.
>
> Could you elaborate why restricted memfd notifier can be ignored? IIUC if
> userspace punch a hole, the pages within the hole will be de-allocated. So why
> can such notifier be ignored?

Because set-memory-attribute ioctl is expected to follow the callback from
restrictedmem. So set memory attributes can do de-allocation. I wanted to avoid
zapping twice.

With v9 UPM, the restrictedmem callback was triggered for both allocation and
punch-hole.
With v10 UPM, the callback is triggered only for punch-hole. With v10 callback
semantics, probably this can be cleaned up slightly.
--
Isaku Yamahata <isaku.yamahata@gmail.com>

\
 
 \ /
  Last update: 2022-12-15 23:11    [W:0.189 / U:0.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site