Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp188117pxh; Thu, 7 Apr 2022 18:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx1A7zZuddbuEAgILcKEiUdKxCqcF0KAkTEEFpMrJSkwJKGnf9wsjRRGkapwgtgpvTa1Ud X-Received: by 2002:a17:902:ec87:b0:156:9eed:b7de with SMTP id x7-20020a170902ec8700b001569eedb7demr16439381plg.5.1649380804258; Thu, 07 Apr 2022 18:20:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649380804; cv=none; d=google.com; s=arc-20160816; b=bWbGY1WKUOGkz+lcZxLdYcJtaFevKIla8KTdO6Q1RgBbk4R057x9e/FZ/of61EJuBF fWGllnIFUk3ukLl8MQM3ESP5akXkUw2ZXxrkIYBebdb0a2NYVy42O/rcQTx+vJgfwiG8 eMolt4QHRCktn+2F9w3C6AmL2NxT1E8Yyd0M97qWM0rmp77MMOS7ZTcMDUuUH0/6e7Zz 7rhclhLrWKBftrSGx2sCWRLs1m5Qv6gq/5coseR/6tZBNGmUOCIayxRWvfA24EXsbZU6 +lDHnvNqr7CV7oTNBfPhR/JTk0k6aD8RWN5IS6bVW9UHvon/NgdirL41k50EsTANzEUS NFJw== 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=dodW1fVEcct0O/JyTL9zJf6rBjh5DGa2iEPmEpDwu9E=; b=tTPlxC8xzmukKHxoMkm/LSkmH18xtxncq/JOnZ5JbeDnnJdUgbdSyqRR97DnwcmHvu A+Qa040D+alBpeXuyUZ1267zevd/BqQ4+LpWMFdL432P5BAIb7pzoZ1nRnf88Yq1qDVk 5AZ46roN5uWFQYvn2gMJSr2btiz9zDGzjdFbtTM2MD5RzQn9bZdPzVhcbvTiR78TyL/d knEVemAPqkTzet4+CQDiPjM0f0LRkiFWPii7/8UgzyYMkRuoxSaOwKnvulefhave6Tyj az00yyekxKTvtx8S0G1a8o1I50ho/cYYLu+EHdzOUXBMByidBhQgINmIrkkemwK52aq7 gDEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=iGn315jR; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i28-20020a63221c000000b00382b764cc76si20007321pgi.299.2022.04.07.18.20.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 18:20:04 -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=@gmail.com header.s=20210112 header.b=iGn315jR; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3208D184B71; Thu, 7 Apr 2022 17:51:34 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233278AbiDHAxV (ORCPT + 99 others); Thu, 7 Apr 2022 20:53:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233266AbiDHAxT (ORCPT ); Thu, 7 Apr 2022 20:53:19 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26AC4158DAC; Thu, 7 Apr 2022 17:51:18 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id s14-20020a17090a880e00b001caaf6d3dd1so10484941pjn.3; Thu, 07 Apr 2022 17:51:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=dodW1fVEcct0O/JyTL9zJf6rBjh5DGa2iEPmEpDwu9E=; b=iGn315jREigICcuAlexjNs/dQW2YimHhkdZ6DFgrcVuZ5toRN1Q5rj2y9rBYzaGnNl wpaS21Gs9jPXTC4O/oE5jGfHUtOcHBoTB1Ld4Zj+FFLUvbEbYvhDXzktSETJ4gVy+xQq ptJneqDeE5zUFualS3xAcOSvLJ2bstW2ahzeUMO66oCKx5QyFoaauXrtKjrb8S19osBT mNcC4SuvCtFI00dC7+d341B6LLsNmzeZYqjhYBx37zjkKzRviwMhkGoEfvJxlHQU0417 40Sbqjq6ksgVUqEI25ZAQhMn3bfqEmedthlaXeCexvuqSQcNw3zozAQOnUfJ+ACmHzCK RbDA== 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=dodW1fVEcct0O/JyTL9zJf6rBjh5DGa2iEPmEpDwu9E=; b=eIr33VScwj5iVGsdDoxkjRWPV3l/vv4k5tFFlfQt6eZRJzLXfly582qHjGL5jKy9UL nbt8XlKkJPt8BCu4elDBhPl0Uf7d5syiAuRdrJ/B6KdA+iWJPNwnYdKFdLE2pX9hnQk4 m6wyniLIMDswkTFDoELaqGwOQqAcXHpvp/+Ea2kQR/yXAFhZQ0f6ZOo0e1310PkUxoBN rvsbq2z1ZEYzEwhkNNuVcgJniO3pviu0JMibbK52isb33Ys2rQrsPi6jIy4hZ6HUDf/8 rvT0NP+FLliCU1BiVhsclbOuCFU5v9IJauWHTv7GLcda8wR9RF1WzkN0S3QTeR6vndfo n3CA== X-Gm-Message-State: AOAM533cIYSA4Qosmjs/2Qr/mTAmsZ434dkOf0aLVZ02DoPeRRBoEMZy YTRB5OmYGvfJa0+K1MItbeM= X-Received: by 2002:a17:903:240c:b0:153:c452:f282 with SMTP id e12-20020a170903240c00b00153c452f282mr16186894plo.88.1649379077566; Thu, 07 Apr 2022 17:51:17 -0700 (PDT) Received: from localhost ([192.55.54.52]) by smtp.gmail.com with ESMTPSA id q17-20020aa79831000000b0050566040330sm4245426pfl.126.2022.04.07.17.51.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 17:51:17 -0700 (PDT) Date: Thu, 7 Apr 2022 17:51:16 -0700 From: Isaku Yamahata To: Paolo Bonzini Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson Subject: Re: [RFC PATCH v5 024/104] KVM: TDX: create/destroy VM structure Message-ID: <20220408005116.GB2864606@ls.amr.corp.intel.com> References: <36805b6b6b668669d5205183c338a4020df584dd.1646422845.git.isaku.yamahata@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Tue, Apr 05, 2022 at 02:44:04PM +0200, Paolo Bonzini wrote: > > diff --git a/arch/x86/kvm/vmx/main.c b/arch/x86/kvm/vmx/main.c > > index 6111c6485d8e..5c3a904a30e8 100644 > > --- a/arch/x86/kvm/vmx/main.c > > +++ b/arch/x86/kvm/vmx/main.c > > @@ -39,12 +39,24 @@ static int vt_vm_init(struct kvm *kvm) > > ret = tdx_module_setup(); > > if (ret) > > return ret; > > - return -EOPNOTSUPP; /* Not ready to create guest TD yet. */ > > + return tdx_vm_init(kvm); > > } > > return vmx_vm_init(kvm); > > } > > +static void vt_mmu_prezap(struct kvm *kvm) > > +{ > > + if (is_td(kvm)) > > + return tdx_mmu_prezap(kvm); > > +} > > Please rename the function to explain what it does, for example > tdx_mmu_release_hkid. In the patch 021/104, you suggested flush_shadow_all_private(). Which do you prefer? flush_shadow_all_private or tdx_mmu_release_hkid. -- Isaku Yamahata