Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp41212pxp; Thu, 10 Mar 2022 21:59:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJz27IiMjFHdDDKxe41LxuBIRjAqgYGmqiyqLxYNtRutfmViRKy8mAXlpZRMRhn7eOGi1sKB X-Received: by 2002:a65:5a06:0:b0:375:81c9:74b1 with SMTP id y6-20020a655a06000000b0037581c974b1mr7217012pgs.122.1646978370517; Thu, 10 Mar 2022 21:59:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646978370; cv=none; d=google.com; s=arc-20160816; b=KEU9ZO1kY0yJ7ICYABcSM4p5XYHDt/8B2b0tYnPUH3v++ZvNi8G7aj9/WI5CXJfr/a rPv2F1CcbpSsXp1Ifshcp4AhRr7YEWMvnvExxtTkdKJyXVAgoS4BzZ8Rc35aTpBwDA5b WnSt9iq9H+PeysGfCeAbxTTVyDccJe09zd4FkmFike9w70f9CkBCsj8EXdfQ8vQUQsvC 6I6Ac1ShDBGjUpz5llPlW/LSr8YpVobagGZVclTOClxTItKn/0PC9kllkDPN0POcmJ9t GKPO9R6JHxQWBl124ONPxIiXcXwPj3InqYWB5IC+9qgdVb7UBpmRkqsEPlMcEqu/zVH+ 0QpQ== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature; bh=HgAwrOPJ0wUt69/DCcwksEbQBZaqMX+wLVhD5w9OVsU=; b=Z4K66yEjSiQYsOxcYD7LFRlrtuCIXDCoA2yW0W+ItTx2BCoYtLafLeHLjipAjyWaqH EU+KAh+UZf9UaWPa1l7HE8dvOG5AaUC03EkMDmzTySGMz/sFReDuyxFcTCM8B5NaXAwT r89nuGTbACvTVPi6q2Yp0tYTVD8KMDQyEiMyQgDsDppGVgVlTLU/ClJFXyvymAaDwhEx OpFO+BM4W0QuvqSwd24f/q7HDHaXnuwNoKU1U+B+iQKBiWIp4e2urgfeCwkfKQim2q2C bqhI9G8Bur4VQ7Q7YUVOJzJpy16+g2iK0/ABqTpVgU1tP2d1mHxhm49S/Ij73WEbo1H9 UIoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WxtvJAq4; 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 i8-20020a17090332c800b00151f4b0bb7dsi7537865plr.173.2022.03.10.21.59.14; Thu, 10 Mar 2022 21:59:30 -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=WxtvJAq4; 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 S237681AbiCIUId (ORCPT + 99 others); Wed, 9 Mar 2022 15:08:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236182AbiCIUIb (ORCPT ); Wed, 9 Mar 2022 15:08:31 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 919B9DECC for ; Wed, 9 Mar 2022 12:07:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646856451; x=1678392451; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=vqAgO5Hj65MNywbPhSvspwjP9xV2an55S1XITiL2rCs=; b=WxtvJAq4BJFBON00/prxE0O9DbGRJIc0+hLwxJgatPnEyRRf8hjUXTWn EPq0pCkExKlrrceyFvSghWXi4QnOCw+riu4JaV+BaInLn28qZcwp2y0dV gsy3zOPccYyHpDTlB7AoEysAsBHFNO9eXYbe/rWiXtXtezcCCXNIIRiBp HNV6jgEI8rgjFL9bJZsb+uBBOIim9NSG7ZEGMVZLblNWFJexcxJZv7hBH 3Ctv+wEAxVhcuRO0Lf1UIYMpH/ZV9LfIKC7a8/O5bGjOl+bDiXwJIh2Xm avke7SWdK8aArP3XllKltn1QR5Ai4xxvBoGBxBQkK+Ef989BedDnRfazj Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10281"; a="318304179" X-IronPort-AV: E=Sophos;i="5.90,168,1643702400"; d="scan'208";a="318304179" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 12:07:30 -0800 X-IronPort-AV: E=Sophos;i="5.90,168,1643702400"; d="scan'208";a="642285288" Received: from sli6-mobl.amr.corp.intel.com (HELO [10.209.104.236]) ([10.209.104.236]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 12:07:29 -0800 Message-ID: Date: Wed, 9 Mar 2022 12:07:22 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org Cc: sathyanarayanan.kuppuswamy@linux.intel.com, aarcange@redhat.com, ak@linux.intel.com, dan.j.williams@intel.com, david@redhat.com, hpa@zytor.com, jgross@suse.com, jmattson@google.com, joro@8bytes.org, jpoimboe@redhat.com, knsathya@kernel.org, pbonzini@redhat.com, sdeep@vmware.com, seanjc@google.com, tony.luck@intel.com, vkuznets@redhat.com, wanpengli@tencent.com, thomas.lendacky@amd.com, brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <20220302142806.51844-1-kirill.shutemov@linux.intel.com> <20220302142806.51844-28-kirill.shutemov@linux.intel.com> From: Dave Hansen Subject: Re: [PATCHv5 27/30] x86/kvm: Use bounce buffers for TD guest In-Reply-To: <20220302142806.51844-28-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 3/2/22 06:28, Kirill A. Shutemov wrote: > --- a/arch/x86/coco/tdx.c > +++ b/arch/x86/coco/tdx.c > @@ -5,6 +5,7 @@ > #define pr_fmt(fmt) "tdx: " fmt > > #include > +#include > #include > #include > #include > @@ -627,5 +628,7 @@ void __init tdx_early_init(void) > x86_platform.guest.enc_tlb_flush_required = tdx_tlb_flush_required; > x86_platform.guest.enc_status_change_finish = tdx_enc_status_changed; > > + swiotlb_force = SWIOTLB_FORCE; > + > pr_info("Guest detected\n"); > } AMD currently does: if (cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT)) swiotlb_force = SWIOTLB_FORCE; which somewhat begs the question of why we can't do the swiotlb_force = SWIOTLB_FORCE; thing in: void __init mem_encrypt_init(void) { if (!cc_platform_has(CC_ATTR_MEM_ENCRYPT)) return; /// Here I recall there being a reason for this. But I don't see any mention in the changelog.