Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3489248pxb; Mon, 4 Apr 2022 18:37:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztGWzKpep8e+g3sEdEJfxkjHjsehFoGe8rpyO6lghDaLlZdNhy6gSlFXIEkncaqXoUU6SJ X-Received: by 2002:a17:90b:38c4:b0:1c7:cce4:8e70 with SMTP id nn4-20020a17090b38c400b001c7cce48e70mr1270446pjb.51.1649122649555; Mon, 04 Apr 2022 18:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649122649; cv=none; d=google.com; s=arc-20160816; b=FPnISsgZF1sS7DgwoUhlSO4UMNknGrl4SXPGyTxyaToiM4Zuq6waudJST69Kgoakij QFl5S/1gqqvlULUMrDLMDMtqa6irtxU1AbjnifXiSSVLecEZXPJYDkDkOVY1pTeg7MFV FY7MFV8S3X3n23vltibQMANB0JczVxebPUANiDpss1LV/G1T3j3UhK/XIeALUYfg+ylS rCxBYuEXo9o9we4nUAb9BpvBEEg5T/9+Z6nrmeTBtAGYtAcYDHdKgU/pQrb46R61tmA3 754xlRg6HLF5p+UtsrsMsT8hXLSN2N468rXDcDF59rDrhleFqP8E79trA0QmvdN10vgA b/Zw== 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=6QE4w2g5khQBnxb92HRg/q4BWRmfdIBuDEDmz4MpG6s=; b=XGlp3hGeiTjrC6vw0UuBwDK4myR+uwFsWXgjAvo8on82arowJAhqPI+NS16jv6wC3+ UmHyTA6vbKz8sepFHxsnq7X4n0NfeLaO/rugPWNvAP5AYaTLW4ch8r2ZzhbHLzgzxQ6Y jJcz4rtimVpOcQXj6MY1O83HXoGeqkKqb0769jruLq19a/LC1gAUvyqMxxXxb+th4Gjo UIR54xZqHoM/UNLtdT66Z/sW5lOcv1EqRcxNTKjbNLGKWpfQtdsUQGUZiSru9QCBkhtM haTb2iUr3SdasQnciOpJr4tJgyz6DHc9lvAnlu0t4TY51LiniI/Dt/2I8bXfy9X40E1V GEBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cM4p44W+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p3-20020a170903248300b00153b2d165c0si10992638plw.456.2022.04.04.18.37.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:37:29 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=cM4p44W+; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 17EFA237FFB; Mon, 4 Apr 2022 17:30:41 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353262AbiDBAKk (ORCPT + 99 others); Fri, 1 Apr 2022 20:10:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351761AbiDBAKj (ORCPT ); Fri, 1 Apr 2022 20:10:39 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7EC2B1BD for ; Fri, 1 Apr 2022 17:08:48 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id c23so3812519plo.0 for ; Fri, 01 Apr 2022 17:08:48 -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=6QE4w2g5khQBnxb92HRg/q4BWRmfdIBuDEDmz4MpG6s=; b=cM4p44W+HpG7D1GTx2b7HSUtQsl0rwbFS2wlP6Q8cAes19TeMkZtSZWLDnl1wgvmQ+ KXrQmOQtR7/xs6okhsM9XLjaVwMP+fUkkBDI9ErgbAv17IjjpKp/zoyHIVNX4cCEk7uR xHT5tWx8dygLZq4b3sVCa87rvou6b6ZUiEBmkikLgtDOT6gLK3Efa4TDuHYMbAyCzgSJ b4QHOrEX+WkTJ//pB21OtkskJs8Lz/5rtbucsHAtJsMc1k+cb9dMWtgEZbVfdVlSXtlq JTqR12aD1q7CFLUWEcYhOxQxPiMwkb9KaakkQ8TNBKxBCJugIJWvr8gXzpjue68tVMrk WfNA== 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=6QE4w2g5khQBnxb92HRg/q4BWRmfdIBuDEDmz4MpG6s=; b=b3xcv+3oKB19hc3SsoJskIl7Ls0OjQ/12Ar3W0YV8W/HVjjVHyiVCOKbqZaRtRVFRg I9C3KhDJ+0OW4uuYPZnawRdt+zBWGwzvxPy9I9nAugaCiDQAzdb3K00W+nPfXhzOjhcY XDAZaTSY7WXOYEkTE2pbVPF1wqIOpBpQKWfVYERvbvunfGz82fb+9188SToZk82M6seL zLdmELmCKtTsQng0wEnUwQoz6LaIwrVeAUUkmlU9H2wDwTzcL/IIyL5hHDQx04HtgdwB PyEzdIiO6zB1TFfRWMABTwDs4ALBoKgqJmnV9uf38fGimKuv0NwuIKYdotj/cBsYr689 xVDw== X-Gm-Message-State: AOAM531OoJC0BKXlPPBsJQjfOuwPJK62+re3d1t6Hv+pmnOU2DLJh4qU tQO0Q0v7O13EUn+BP+o29ewAZA== X-Received: by 2002:a17:903:1248:b0:151:9708:d586 with SMTP id u8-20020a170903124800b001519708d586mr13012969plh.15.1648858128229; Fri, 01 Apr 2022 17:08:48 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id x29-20020aa79a5d000000b004f0ef1822d3sm4259169pfj.128.2022.04.01.17.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Apr 2022 17:08:47 -0700 (PDT) Date: Sat, 2 Apr 2022 00:08:44 +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> <43098446667829fc592b7cc7d5fd463319d37562.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43098446667829fc592b7cc7d5fd463319d37562.camel@intel.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 Sat, Apr 02, 2022, Kai Huang wrote: > On Fri, 2022-04-01 at 14:08 +0000, Sean Christopherson wrote: > > 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... > > Hi Sean, > > Is there any reason large page support must be included in the initial merge of > TDX? Large page is more about performance improvement I think. Given this > series is already very big, perhaps we can do it later. I'm ok punting 1gb for now, but I want to have a high level of confidence that 2mb pages will work without requiring significant churn in KVM on top of the initial TDX support. I suspect gaining that level of confidence will mean getting 95%+ of the way to a fully working code base. IIRC, 2mb wasn't expected to be terrible, it was 1gb support where things started to get messy.