Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp12742568rwl; Tue, 3 Jan 2023 20:38:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvB8kMqYyfAxFDmFajNac7MiQ7BZ8tbEb8LjGECmCC6GUcb49LwZH93gKriuGe7N8aBmGcy X-Received: by 2002:a17:90b:4d8c:b0:219:c2f2:f818 with SMTP id oj12-20020a17090b4d8c00b00219c2f2f818mr50493171pjb.42.1672807126189; Tue, 03 Jan 2023 20:38:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672807126; cv=none; d=google.com; s=arc-20160816; b=xNbBq7me9rLeP2CyTHdGyW6wpygXWs5R1Gc2C+xGl1Y9yQiGD/6J8wl2YufPfR0G12 fMtqcBbDmV7bzibgkvR6IrCjei25FQxAnUeFQ+ikVbR/JiKQfHzemqBUVbO+sEpeEwqF x36TMXG4RIr4pCXC+voKp0ful+921fZGFOgPOwHUlvm4oLee/Rg3WNoJd2LKu4IPkNjq JMmK0kf21SPhT8bxrFWDgwr62ptPBZynWg212DPn2CZrCLLIM72R0H41xjMP0wo8d3s2 /XcAW9f487WNtuNGYjkCnCqZ4OU+oJW4X3+RpBlg6rd0V8WUtZB9V+0xblsiLatw93ck Y4pw== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=7VrmO7fz8jPEP9ffvlA3Tap4z9l3sG5DbG14sAvjGi0=; b=BF2VAF4qS6wrB6tzRXviNNT9tYPSZoBqkW1GSMT52AVfzLFvxWu1fgTkq1YcHeqzeq Q/46xE+Pjy6DBPO/GtsCn/axfwcDTKkNJ+GO+E3nlMZgsjzzy9Mmmj7m81rxE3uxH2vQ 1crpyi1A1YpPBiJTHldKvvit3e0gBni+Ha9yy41CRKVcKHaFyEfXdmpYnZXiDTz0/SVh ecbfRzydSpT31TSmZIVDNxX/td3c1JtirOipDaiBMke51rqdisi1XqQidZFLfhgYjWrZ POoCdOmtEy3CEH/MxGVfU7xf2Udh2QYeqgc16nhcC+q52vcWTwE+5LtrjnK0VP/0UDfZ CdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=drZFgwg6; 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 nn11-20020a17090b38cb00b002135a4d80d7si35285856pjb.188.2023.01.03.20.38.36; Tue, 03 Jan 2023 20:38:46 -0800 (PST) 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=drZFgwg6; 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 S234437AbjADD6q (ORCPT + 57 others); Tue, 3 Jan 2023 22:58:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbjADD6o (ORCPT ); Tue, 3 Jan 2023 22:58:44 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB7AE15725; Tue, 3 Jan 2023 19:58:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672804723; x=1704340723; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=gqVwrNz+IXngJzcUQgNb7Bi5jWHHCfdbbMv4DE6dUwY=; b=drZFgwg6uEFtjxRnXJthl0OOfRJhGUMcWP3+sa7V6oBBwNohe8Hn/14b DbaRD3K8SBE4zX/kwwGxLfIpKZVm8Lp/jbdrsdqpCuguL6HGHDN19ON3+ l+2SZDut9Zbre45epUHIoj2g/bt/1Vs+QxElY+Pgwkga6x1o3P+CZXgGX DcC4Qc/qZEv0nda/3XyrHFpEQUdy5T1u1ydkE9nrxfWafsnmpD3xuWxJ8 exbJOJxtYqZ2JR2pzShwdYfxUfQr2eYY6fR9c3vcM/Q4BeNYNr5eKZm/C FAKQ98fXFDyzj9G3I2YPeHJr1bli/+MUH1WtNck6mtDNcUd1bNbk9U68T w==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="305328619" X-IronPort-AV: E=Sophos;i="5.96,297,1665471600"; d="scan'208";a="305328619" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 19:58:43 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="605052443" X-IronPort-AV: E=Sophos;i="5.96,297,1665471600"; d="scan'208";a="605052443" Received: from leiwang7-mobl.ccr.corp.intel.com (HELO [10.254.214.111]) ([10.254.214.111]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 19:58:40 -0800 Message-ID: <6351a1fd-ba60-7e9b-64b3-63b96e16607f@intel.com> Date: Wed, 4 Jan 2023 11:58:37 +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.6.1 Subject: Re: [PATCH v10 016/108] KVM: TDX: create/destroy VM structure Content-Language: en-US To: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Paolo Bonzini , erdemaktas@google.com, Sean Christopherson , Sagi Shahar , David Matlack , Sean Christopherson , Kai Huang References: From: "Wang, Lei" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE 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 10/30/2022 2:22 PM, isaku.yamahata@intel.com wrote:> +static void vt_hardware_unsetup(void) > +{ > + tdx_hardware_unsetup(); > + vmx_hardware_unsetup(); > +} > + > static int vt_vm_init(struct kvm *kvm) > { > if (is_td(kvm)) > - return -EOPNOTSUPP; /* Not ready to create guest TD yet. */ > + return tdx_vm_init(kvm); > > return vmx_vm_init(kvm); > } > > +static void vt_flush_shadow_all_private(struct kvm *kvm) > +{ > + if (is_td(kvm)) > + return tdx_mmu_release_hkid(kvm); > +} nit: there is no need to use the "return" keyword. > + > +static void vt_vm_destroy(struct kvm *kvm) > +{ > + if (is_td(kvm)) > + return; > + > + vmx_vm_destroy(kvm); > +} > + > +static void vt_vm_free(struct kvm *kvm) > +{ > + if (is_td(kvm)) > + return tdx_vm_free(kvm); > +} ditto.