[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220424080737.GA4207@chaop.bj.intel.com>
Date: Sun, 24 Apr 2022 16:07:37 +0800
From: Chao Peng <chao.p.peng@...ux.intel.com>
To: Paolo Bonzini <pbonzini@...hat.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Quentin Perret <qperret@...gle.com>,
Andy Lutomirski <luto@...nel.org>,
Steven Price <steven.price@....com>,
kvm list <kvm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
Linux API <linux-api@...r.kernel.org>, qemu-devel@...gnu.org,
Jonathan Corbet <corbet@....net>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
the arch/x86 maintainers <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>, Hugh Dickins <hughd@...gle.com>,
Jeff Layton <jlayton@...nel.org>,
"J . Bruce Fields" <bfields@...ldses.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Rapoport <rppt@...nel.org>,
"Maciej S . Szmigiero" <mail@...iej.szmigiero.name>,
Vlastimil Babka <vbabka@...e.cz>,
Vishal Annapurve <vannapurve@...gle.com>,
Yu Zhang <yu.c.zhang@...ux.intel.com>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
"Nakajima, Jun" <jun.nakajima@...el.com>,
Dave Hansen <dave.hansen@...el.com>,
Andi Kleen <ak@...ux.intel.com>,
David Hildenbrand <david@...hat.com>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>
Subject: Re: [PATCH v5 00/13] KVM: mm: fd-based approach for supporting KVM
guest private memory
On Fri, Apr 22, 2022 at 01:06:25PM +0200, Paolo Bonzini wrote:
> On 4/22/22 12:56, Chao Peng wrote:
> > /* memfile notifier flags */
> > #define MFN_F_USER_INACCESSIBLE 0x0001 /* memory allocated in the file is inaccessible from userspace (e.g. read/write/mmap) */
> > #define MFN_F_UNMOVABLE 0x0002 /* memory allocated in the file is unmovable */
> > #define MFN_F_UNRECLAIMABLE 0x0003 /* memory allocated in the file is unreclaimable (e.g. via kswapd or any other pathes) */
>
> You probably mean BIT(0/1/2) here.
Right, it's BIT(n), Thanks.
Chao
>
> Paolo
>
> > When memfile_notifier is being registered, memfile_register_notifier will
> > need check these flags. E.g. for MFN_F_USER_INACCESSIBLE, it fails when
> > previous mmap-ed mapping exists on the fd (I'm still unclear on how to do
> > this). When multiple consumers are supported it also need check all
> > registered consumers to see if any conflict (e.g. all consumers should have
> > MFN_F_USER_INACCESSIBLE set). Only when the register succeeds, the fd is
> > converted into a private fd, before that, the fd is just a normal (shared)
> > one. During this conversion, the previous data is preserved so you can put
> > some initial data in guest pages (whether the architecture allows this is
> > architecture-specific and out of the scope of this patch).
Powered by blists - more mailing lists