Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1346493pxb; Fri, 1 Apr 2022 10:48:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBcENx8Utautrz36sErsz+Y/ewelkq0DSqjBbn2ztXtVKNFM3QBNicR6bUhcN8A2dCxcH4 X-Received: by 2002:a17:90b:1e0e:b0:1c7:5b03:1d8b with SMTP id pg14-20020a17090b1e0e00b001c75b031d8bmr12978748pjb.121.1648835312763; Fri, 01 Apr 2022 10:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648835312; cv=none; d=google.com; s=arc-20160816; b=U+3cUimZZJQmI2WGvnj7To3Nh3v84IihMG7fmwlImwC00iv1oWaWmpUwLU5vOhhJ5k YrW6oXKkOJ6WblPvnxaDEqjaMKsi/TmJMp+wOZg73899kj7Z8OG5VxGE51a4GoaZ1XnX EyhNjb6v3gUbuiH6X5xZaCaauDaATSJxVTUOhxXaPXiUC4uO6+LhUFP5L65Ek4OU9Q/k w3UCiSqlKVXjCcrGQa/+n15MNLPpWHhYxThNOWEr0wZMiepW+44sGJRZeSCy+RTY4Ag6 OfvGlJ4/n6WiKnpNUFO7hfLhCQy3ruXXKaovwiAyylfrFD783MJ2fwsRUBc6X8MGGfNY m88g== 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=4Y01ccpg4aRT7Y3aBGXmonKaDsl4cnQt+ZD5CqEeB9o=; b=QtLqsCuk6qveRrqCAXyeIeTGQEeIjOVTeyDhVxiFdLee53dTsskxjWRZ4U7gnvhwBR RbgZ3e7TNo94IRWgtGh9TEczxC7m/kdD6LtmheCpDbLFXfHq7D1pOMBbHpsDoerHJuJV gqq+mskulfswOvKV00WH9txmWkD8vVEdra7+IQYg6TPL7VLZy7c3UPm+DcEN6w3APRf9 qI3ovgnN8qVi0gx652HJ1+GXU0g1lLLJwqFm2e5TgiQSQeDiL+yeFYPi9tDbwz5EvWoc 1f/T1NSCkJFD/Uy0SdK8gDaT7iVgYcffEQYaZq+TFN3y03gN7QVoDTGr1nEEtvmr0VyP 9Gdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="BIF/4cp0"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a17-20020a1709027d9100b00153b2d16593si2496100plm.411.2022.04.01.10.48.17; Fri, 01 Apr 2022 10:48:32 -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=@google.com header.s=20210112 header.b="BIF/4cp0"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346680AbiDAOKf (ORCPT + 99 others); Fri, 1 Apr 2022 10:10:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346679AbiDAOKd (ORCPT ); Fri, 1 Apr 2022 10:10:33 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F538137F54 for ; Fri, 1 Apr 2022 07:08:43 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id bc27so2496473pgb.4 for ; Fri, 01 Apr 2022 07:08:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=4Y01ccpg4aRT7Y3aBGXmonKaDsl4cnQt+ZD5CqEeB9o=; b=BIF/4cp0GMNppj/pJYpz/PIku56d0u+v9cjCE2X0WM7u9Ka9o51X5OL9WJoJMqMayF /Z/rOvkXYI90QanST6RsDdIxj+0YUvGQOH6VSpqYmv2sYWNZvYAo0FH7/z5xHPKii14h KUpxnCLjhAxWRRhGPrc2fxAkC37ygvJ66rjnqXVpTYpxm4yLTOk/65ZrDiGFh27I84Dt FfdkU13D3qtDIEoFOPEjdWg3hxmz46o2hsYi5UF2/JBXH6S+bMnCc2bDXKtg8vdQfaQI JjwwRaBGdo3ainePBLK4xtqtFYM9nGD5+wDTWeb5dCxGvaz0ZzRmJVRfokJDBxslTpuz 1EiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4Y01ccpg4aRT7Y3aBGXmonKaDsl4cnQt+ZD5CqEeB9o=; b=MJ331ai8H2wdhNLjZsCqaXz9H8I2rMt9BYwtIpsmsHc9Yqaxm0PuM/3fzPDK+b9ccd +5Zdv2opCkkgoLyrY43Cr+Oe/u2FPBXH8lGdL3qbeRmToGkxGfduBUcxINfOx47LefTL QKoamgqxT9bxZsoDfclq5PYOGm6XF+NHr9OQ6dFN0BRqjUbBsCos5QBevj+b62WtOFbs NfrKyldKyyn1h0NC+Hc8Pmv326BAYxg4iwyqzKJEqTFoE+RB5evFRWtoC2wEsrGv1MKp ueDWoDe1liTqIYin8F0LDSRWx8Goy8MDOyqG6G5KP2KqNrZ+wEpwvok/gk2QGZNAbeFh ywug== X-Gm-Message-State: AOAM530DnHJXsGuC+IrsJ+ZsFLNNrEV2WBayCJV6UL7BQHkJNpUqI28J 2qYyRKQE/Wqxmhx25eMk+jesNjIQhN3NJQ== X-Received: by 2002:aa7:8490:0:b0:4fa:a623:b036 with SMTP id u16-20020aa78490000000b004faa623b036mr11150575pfn.64.1648822122488; Fri, 01 Apr 2022 07:08:42 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id s22-20020a056a00179600b004fb28a97abdsm3612801pfg.12.2022.04.01.07.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 07:08:41 -0700 (PDT) Date: Fri, 1 Apr 2022 14:08:38 +0000 From: Sean Christopherson To: Kai Huang Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Paolo Bonzini , Jim Mattson , erdemaktas@google.com, Connor Kuehl Subject: Re: [RFC PATCH v5 038/104] KVM: x86/mmu: Allow per-VM override of the TDP max page level Message-ID: References: <5cc4b1c90d929b7f4f9829a42c0b63b52af0c1ed.1646422845.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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, Apr 01, 2022, Kai Huang wrote: > On Fri, 2022-03-04 at 11:48 -0800, isaku.yamahata@intel.com wrote: > > From: Sean Christopherson > > > > In the existing x86 KVM MMU code, there is already max_level member in > > struct kvm_page_fault with KVM_MAX_HUGEPAGE_LEVEL initial value. The KVM > > page fault handler denies page size larger than max_level. > > > > Add per-VM member to indicate the allowed maximum page size with > > KVM_MAX_HUGEPAGE_LEVEL as default value and initialize max_level in struct > > kvm_page_fault with it. > > > > For the guest TD, the set per-VM value for allows maximum page size to 4K > > page size. Then only allowed page size is 4K. It means large page is > > disabled. > > Do not support large page for TD is the reason that you want this change, but > not the result. Please refine a little bit. Not supporting huge pages was fine for the PoC, but I'd prefer not to merge TDX without support for huge pages. Has any work been put into enabling huge pages? If so, what's the technical blocker? If not...