Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp186797rdh; Mon, 30 Oct 2023 19:28:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ462lmw6auC+Bs6q8+qabBysRHJ3Xvvod8W37F64u+YHHvn/TZBATG7ivEpCANCIe+GKA X-Received: by 2002:a05:6a00:994:b0:68a:5cf8:dac5 with SMTP id u20-20020a056a00099400b0068a5cf8dac5mr13696374pfg.22.1698719305789; Mon, 30 Oct 2023 19:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698719305; cv=none; d=google.com; s=arc-20160816; b=ZE/OqpyaLBDiuuk2RojJAjvxn9LswCLlozh8sFuR4tOmAf9cGL/LHYWLCpmqunyh1h d+aFXDkDwifhWxa9aGgu5sVfmtMVQhTzSWetKQAXt2coQBjWvhmOFPEaWHxAW5FOJAG9 l4fwesntNAfBdSDu3B1dl8fHv15TGoQxdI/bMr64+DCg4/vUJWp0uxMUo7IEJ7sPiRGb cp5Fl7ddpYSJZ8w14oRDVtN6Zo2kgq+uMDGFfU85h0RcrQL3XwyCmssEXsjgeNkZBBuT Wg0WJpvA2NHD9291rnpd2vzCQbu+M01gGn9nys2iNeQachJ/zhi2iqH8KyKF2GqSj5nl rfdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ErT9bozsFB6/ospkjZ5lveEr38iAXU0gXWZJxToBdTg=; fh=uso6SWbZqyN3ePA8mgN8HdHg5pNnB37ye2azP8XIY3I=; b=EPiUsOq5g5volzZX/rQwOjmmkgwnOj1mZdO+5XpvH6v7PgNsgtlceXHkv3AnVtTbFt RA83ySTJcxJMnuOeyJheWvEF5oOJGkgAmg60Za2L6gJNdMK2VCeRCONzgYZTIJAddbdK pARFyo/DNBltwgqyI3Rg+WfZ6JHC0K1UN8qWzi7Ldz7t/nIPv99Au8zrtxDYbOPAvyFI +oPvjmwj4xAnTA9olBVKJMrIThBHzmevuLRNGigXXgskJxd7ugDT6nhBOCB6TvyA4wCh pGHZvZiSkEoUGcsV95BDTY+Qq28jpfSk8j1+EBoLUzIySnXAkbB+Az6w+YX1M5sHIAje sWEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BuIMI15p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id p5-20020a625b05000000b0068a590d8043si280146pfb.375.2023.10.30.19.28.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 19:28:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=BuIMI15p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id AA30B80BD741; Mon, 30 Oct 2023 19:28:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231551AbjJaC2N (ORCPT + 99 others); Mon, 30 Oct 2023 22:28:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229766AbjJaC2M (ORCPT ); Mon, 30 Oct 2023 22:28:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09774E4; Mon, 30 Oct 2023 19:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698719290; x=1730255290; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vr6E776DqFsISXT/abuJv1DHpqFpjFuaZ5JfgggngVk=; b=BuIMI15paS4O474D/tJ3ESPG+5u1lGEewVuhvPJe7YZ0/1HEWfN/7M3c HpzVSw1qB1JI+u3zMh3NP36trFyqcHAkKXSSr7f5Rqjr1iY62B7OofwuO l1F52dqdFmmbEHHERIKtgpaW4kciWfagziccCFuEhZlrwYzxqIxi7FOgI UPYZ9Rtios6G1zuaTVEbKTGCOiIlBUjtoEZvAuRXf+fUHEMNPacOa+FT2 ntoIrjUluGFo7ilMLu7a1B5BV/LL6a6d6KnSb4KMTIMbskfw1TsJUj3A3 4PRUVCE/Zl6k0peS5ngn/KtHf9FH5kH5o1F38/SVmYOa9zyUfGFPHRdSi Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="373249925" X-IronPort-AV: E=Sophos;i="6.03,264,1694761200"; d="scan'208";a="373249925" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 19:28:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,264,1694761200"; d="scan'208";a="8161979" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.9.145]) ([10.93.9.145]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 19:27:57 -0700 Message-ID: Date: Tue, 31 Oct 2023 10:27:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 16/35] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory Content-Language: en-US To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexander Viro , Christian Brauner , "Matthew Wilcox (Oracle)" , Andrew Morton Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xu Yilun , Chao Peng , Fuad Tabba , Jarkko Sakkinen , Anish Moorthy , David Matlack , Yu Zhang , Isaku Yamahata , =?UTF-8?B?TWlja2HDq2wgU2FsYcO8?= =?UTF-8?Q?n?= , Vlastimil Babka , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" References: <20231027182217.3615211-1-seanjc@google.com> <20231027182217.3615211-17-seanjc@google.com> From: Xiaoyao Li In-Reply-To: <20231027182217.3615211-17-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HK_RANDOM_FROM, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 30 Oct 2023 19:28:22 -0700 (PDT) On 10/28/2023 2:21 AM, Sean Christopherson wrote: ... > +KVM_SET_USER_MEMORY_REGION2 is an extension to KVM_SET_USER_MEMORY_REGION that > +allows mapping guest_memfd memory into a guest. All fields shared with > +KVM_SET_USER_MEMORY_REGION identically. Userspace can set KVM_MEM_PRIVATE in > +flags to have KVM bind the memory region to a given guest_memfd range of > +[guest_memfd_offset, guest_memfd_offset + memory_size]. The target guest_memfd > +must point at a file created via KVM_CREATE_GUEST_MEMFD on the current VM, and > +the target range must not be bound to any other memory region. All standard > +bounds checks apply (use common sense). > + > :: > > struct kvm_userspace_memory_region2 { > @@ -6087,9 +6096,24 @@ applied. > __u64 guest_phys_addr; > __u64 memory_size; /* bytes */ > __u64 userspace_addr; /* start of the userspace allocated memory */ > + __u64 guest_memfd_offset; missing a tab > + __u32 guest_memfd; > + __u32 pad1; > + __u64 pad2[14]; > }; >