Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1959789rwe; Fri, 2 Sep 2022 06:37:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7mMA7V/5YCGVXkwGDbh5QxvIxfAiklW4Gm4aIHR7wx06dU343xOw4U5/W9fiMbIt9mqb90 X-Received: by 2002:a05:6a00:1308:b0:53a:9663:1c19 with SMTP id j8-20020a056a00130800b0053a96631c19mr15745479pfu.60.1662125845218; Fri, 02 Sep 2022 06:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662125845; cv=none; d=google.com; s=arc-20160816; b=nqb+2XYFSF0bYyFPOiE4MMjCGYuvTDuAYKRM9DEDDSJNFchPlV7C2naznRcw2EX5p8 CBn3hEM8gr0Yp/WdpHLmH4FnR7pfFSIiVbyJYLoFGpjIkMMlyymmD+Uz/bduOhb1Z/ik utnWUAIPpg1fjtPZjCXztOc+yVdVNb1BDMgiqxeFlnZOrj43vN19OvgmUvm4peY1LlxA ZDdxUr3H3am9fnzoNrv6dVtMwA4iypnI0ufKrKTxxm8/NCeiccry5uVU3iyXNtOCJCkE v4jhFYz8dxYrdgWOwmMp4HPfwjq89TcuGwdtzVpavBplBQhuj0W7gCer8H8Cfh2wIR3s q4GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nBjVXmSlczMt63tNmrVY6UrEbVKjwZkzdcEg/HWlM8w=; b=KcYBY/w/HYbv52yNoYvl9NdU90cKGiwqt1bBVphTpqXbTzyy8lQMy59y4QHFcBQHLC EHG+9wDroodTvZUFqAtuGwzAvrXwZ3WX2+0rdGRqEeB1zfY1KHOtsgGPgULZ+bm6dwMb bOp1UceGvn0urcxW737UOOmSIGbbVg7NHnA0ZZTN91uOnm5Gt/UQ0pVc4nNC4RvZ4kc6 c8gEhy8svxBBKipv7K5YU2PIHOBNWF81A+5Fdz9DkCGkUJ+I1aSLNUkp89brSH00CnOk tiiHiHITT93UmyErEk7wBsqXhrOU10b8dk88PoUFutG+WHDPque3M/9Job5XnleiB8P8 B5VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X5d4yMTd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a656aaa000000b0042b1e17d98csi2179947pgu.438.2022.09.02.06.37.12; Fri, 02 Sep 2022 06:37:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X5d4yMTd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236713AbiIBMm1 (ORCPT + 99 others); Fri, 2 Sep 2022 08:42:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237278AbiIBMlH (ORCPT ); Fri, 2 Sep 2022 08:41:07 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3798E868D; Fri, 2 Sep 2022 05:31:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662121886; x=1693657886; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=fDpXS+mwMN4S7KTgnVwvjs5feZwWXlXraJAIEBzDX2M=; b=X5d4yMTdb9rqtJD/vFsu0rl5cEeihbax9+NUBhn3Tz/9DdE4C77fA9/x GoZxapb2TGuT6GuW9i0/rpEFS202ZVzf43K/cWLgLOHFal5NcV2llukp5 hX93eW6BqcrWARumP4aPweBKwUO4zGhuhVSB1mVvFnix2jUoMwJODE0A3 IjSrGO3s0+ewxi+P4F9JbmuTxkYsiRVkI6qi7Zqs2115FRKiEpVRzjmmR 4CGGTnIPsPPChV5v0UoXcmiamjo+uaDcv5GNc24O8JU0Y1KkhBbb/xVJn RW0T3o4nBWLF0srw1o5c96COprmU6l6nr/Z5RnWNsI2MP8/yLkYTGjHeu g==; X-IronPort-AV: E=McAfee;i="6500,9779,10457"; a="382268005" X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="382268005" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2022 05:30:23 -0700 X-IronPort-AV: E=Sophos;i="5.93,283,1654585200"; d="scan'208";a="674338766" Received: from azmijews-mobl2.ger.corp.intel.com (HELO box.shutemov.name) ([10.252.45.129]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2022 05:30:12 -0700 Received: by box.shutemov.name (Postfix, from userid 1000) id 5AC6D10484B; Fri, 2 Sep 2022 15:30:10 +0300 (+03) Date: Fri, 2 Sep 2022 15:30:10 +0300 From: "Kirill A . Shutemov" To: Chao Peng Cc: Hugh Dickins , "Kirill A. Shutemov" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, qemu-devel@nongnu.org, linux-kselftest@vger.kernel.org, Paolo Bonzini , Jonathan Corbet , Sean Christopherson , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Jeff Layton , "J . Bruce Fields" , Andrew Morton , Shuah Khan , Mike Rapoport , Steven Price , "Maciej S . Szmigiero" , Vlastimil Babka , Vishal Annapurve , Yu Zhang , luto@kernel.org, jun.nakajima@intel.com, dave.hansen@intel.com, ak@linux.intel.com, david@redhat.com, aarcange@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, Quentin Perret , Michael Roth , mhocko@suse.com, Muchun Song , "Gupta, Pankaj" , Elena Reshetova Subject: Re: [PATCH v7 00/14] KVM: mm: fd-based approach for supporting KVM guest private memory Message-ID: <20220902123010.zfyv6apmo3v67a2i@box.shutemov.name> References: <20220706082016.2603916-1-chao.p.peng@linux.intel.com> <20220818132421.6xmjqduempmxnnu2@box> <20220820002700.6yflrxklmpsavdzi@box.shutemov.name> <20220831142439.65q2gi4g2d2z4ofh@box.shutemov.name> <20220902102757.GB1712673@chaop.bj.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220902102757.GB1712673@chaop.bj.intel.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 02, 2022 at 06:27:57PM +0800, Chao Peng wrote: > > + if (flags & MFD_INACCESSIBLE) { > > + struct file *inaccessible_file; > > + > > + inaccessible_file = memfd_mkinaccessible(file); > > + if (IS_ERR(inaccessible_file)) { > > + error = PTR_ERR(inaccessible_file); > > + goto err_file; > > + } > > The new file should alse be marked as O_LARGEFILE otherwise setting the > initial size greater than 2^31 on the fd will be refused by ftruncate(). > > + inaccessible_file->f_flags |= O_LARGEFILE; > + Good catch. Thanks. I will modify memfd_mkinaccessible() to do this. -- Kiryl Shutsemau / Kirill A. Shutemov