Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp165218rwo; Fri, 21 Jul 2023 09:59:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlHDk+Fx0tEMVEKyZGMr5jhTJXw9JREmdfvm06lkUpiNb5Zva62tW1Snglb9wbXCj/gBMWPd X-Received: by 2002:a05:6a20:8401:b0:132:7d91:aadb with SMTP id c1-20020a056a20840100b001327d91aadbmr4304162pzd.6.1689958753661; Fri, 21 Jul 2023 09:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689958753; cv=none; d=google.com; s=arc-20160816; b=rU+qgYukpAzyE2g0lbcdOYW2KJHURf3CZmE3YyeR8ptF3oXIYTcCYqeaEGv/A7NkFI AWRavctxfp0SAG+vXwzWolUOswPy7KS7NIo9/3ckvGJ1wNcglauJLiyCsu4EL/1A9w6i m23l+M9Ruxi5l977UODnUf3GNpF7E2CZjEiAoGpBe7AV6p0sAl9hD787Q2VwBYtrHJi/ BOCYRPdNvn7Heiz4RceZ7GkhWIA/Fi+uczR5cd/Ecu+MD8/fUiHZKW1Q27ptmyWPnOqV KlnKhF/vsA6K6/xNSvwRp7h91U/ar46AklB6aj8a1wMEg645JTB8VWZI0vWJPJageHm2 T3yQ== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=nwd61PHEoroNvWfwA0YfCCwXlvtNgCfLCXWmosCWze8=; fh=jE7QoK0/lr13qHmuFy54VModz3HmNuamHVcGclJFSFc=; b=hJEs45eEc+eTIP450rREwVT0XclZv51QUSg+CmC7J0+AeUn0R6HvqW3fYF+mQkyW90 47SDEINyaZcz6mYfaVcXlctIQtZPhqgvqVygrjXetWm/g+35j62PnI1cLxWlemK33g/P zVtlMLSDQPAtYkzIgF6g8q9IEY+i4JRsk5vQrD+nQSsKIQ59VpmVA7aEPnRHItpXOQh2 6Fp81KkcdeqqehwjZxdvM2K0yU49712B5xBL41gMB1w61i77K0JnJaFvxK0nP2jVVWl1 vmhgCEhTVe08xx5w/G6EAKJxfwr7RSdFawJeCKpMxEtO6dWQLPYY8a0g3bw7g16aojcj sWqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=enTN2DYR; 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 bv14-20020a056a00414e00b0068250f2627asi3350161pfb.61.2023.07.21.09.59.01; Fri, 21 Jul 2023 09:59:13 -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=enTN2DYR; 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 S230345AbjGUPmd (ORCPT + 99 others); Fri, 21 Jul 2023 11:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbjGUPmZ (ORCPT ); Fri, 21 Jul 2023 11:42:25 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA863A93; Fri, 21 Jul 2023 08:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689954139; x=1721490139; h=message-id:date:mime-version:subject:from:to:cc: references:in-reply-to:content-transfer-encoding; bh=dgWqCDpNSWuzZvJih5GvRdqDtkxO0fYOrqXInsikkp8=; b=enTN2DYR+jkPr1C9NodRkoYiZ+uFSTaBnX123/beZlQ6HwkEe0+qRirf 9iegdY3Gi3hoNR5DifAWSgLwavd1gHllxwKZr+Z/5RQzgmKjtxglab2bl 1FkECfsQ0a8weuvqNn9uIsh3h55qIRB3O18YdnF2i2OWP6v30QvkQXY3S FE/eYH39SwVStCKqR9LGJPs9g9jZWGjmXRKNjSCyyy699Zqzbx96e61wV ycd+TykTbsZwxSWrsPwgvKH+aSnSfIHB+69lqhJSJffTiTKEqwWz8GodR KEvMgI+x+GGmbvB7a82247ysgVY31lH6pdpW9tOF7QwYNVWbEseZ22arD Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="367087040" X-IronPort-AV: E=Sophos;i="6.01,222,1684825200"; d="scan'208";a="367087040" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 08:42:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.01,202,1684825200"; d="scan'208";a="868274880" Received: from xiaoyaol-hp-g830.ccr.corp.intel.com (HELO [10.93.6.77]) ([10.93.6.77]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 08:42:09 -0700 Message-ID: <29baac45-7736-a28c-3b2d-2a6e45171b8b@intel.com> Date: Fri, 21 Jul 2023 23:42:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Subject: Re: [RFC PATCH v11 12/29] KVM: Add KVM_CREATE_GUEST_MEMFD ioctl() for guest-specific backing memory Content-Language: en-US From: Xiaoyao Li To: Sean Christopherson , Paolo Bonzini , Marc Zyngier , Oliver Upton , Huacai Chen , Michael Ellerman , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Matthew Wilcox (Oracle)" , Andrew Morton , Paul Moore , James Morris , "Serge E. Hallyn" 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-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, Chao Peng , Fuad Tabba , Jarkko Sakkinen , Yu Zhang , Vishal Annapurve , Ackerley Tng , Maciej Szmigiero , Vlastimil Babka , David Hildenbrand , Quentin Perret , Michael Roth , Wang , Liam Merwick , Isaku Yamahata , "Kirill A . Shutemov" References: <20230718234512.1690985-1-seanjc@google.com> <20230718234512.1690985-13-seanjc@google.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HK_RANDOM_ENVFROM, HK_RANDOM_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 7/21/2023 11:05 PM, Xiaoyao Li wrote: > On 7/19/2023 7:44 AM, Sean Christopherson wrote: >> @@ -6255,12 +6298,17 @@ int kvm_init(unsigned vcpu_size, unsigned >> vcpu_align, struct module *module) >>       if (r) >>           goto err_async_pf; >> +    r = kvm_gmem_init(); >> +    if (r) >> +        goto err_gmem; >> + >>       kvm_chardev_ops.owner = module; >>       kvm_preempt_ops.sched_in = kvm_sched_in; >>       kvm_preempt_ops.sched_out = kvm_sched_out; >>       kvm_init_debug(); >> +    kvm_gmem_init(); > > why kvm_gmem_init() needs to be called again? by mistake? I'm sure it's a mistake. I'm testing the gmem QEMU with this series. SW_PROTECTED_VM gets stuck in a loop in early OVMF code due to two shared page of OVMF get zapped and re-mapped infinitely. Removing the second call of kvm_gmem_init() can solve the issue, though I'm not sure about the reason.