From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 502E5C433F5 for ; Sat, 2 Apr 2022 00:08:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353436AbiDBAKl (ORCPT ); Fri, 1 Apr 2022 20:10:41 -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-Google-Smtp-Source: ABdhPJzthtmq4iSAuF0g2nH0IfT9pVuq7f+MEOhY7gtmuECg++lc8OVxw4fj2pA0+NyBKk/NoUGDyg== 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> 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.