Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1570885pxp; Thu, 10 Mar 2022 08:01:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFzVFaEebETFrw06lvrW9oVYN1RJNP44ImJCSAp55htZjkb0Cl5KWzfzmWRdyOgiS1YUxX X-Received: by 2002:a17:907:1c0e:b0:6db:41b2:8d98 with SMTP id nc14-20020a1709071c0e00b006db41b28d98mr4795854ejc.102.1646928063877; Thu, 10 Mar 2022 08:01:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646928063; cv=none; d=google.com; s=arc-20160816; b=K24I5VzkEIZzPNvd+e0q+3BurHqCuST98mrXD+wzzq1kU8U0ynRhDv9Vj6rGQ7RNCi rtAEgJNt6mofcxJ8PT+fjNo/IOpS42bDblJi0dm0LT2kchhDwMAoc7DR3V7bgIZvxn6z OWkHRfxIi27f4s3FeSU86FFYZZz9H/0tJb5z88GacxOTA3WdQPUH+298uGm5+ys/lfOe eoXIMufc4EPf3bZtdsAmg6odDX2mW/cILBn9kOTX0qJ1/jvS/kYz/gPT5ICFZzYZhWRl rvHeI5opVoR3fUPZGSl8JxBdh4npWGKkvxf8WloiAkyHVWH3NrTCKg+a0CtSz6b41FxN gm2A== 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=t73Bn5PoTBPP0h6uAMsqu927EETHhd4aAadtdVAgAbI=; b=CuOZHRUcTfR1QEw3HUucWw5qDCoOV9MwWl1YuyqkmLNcx9p7LbYCvu6L/rr0kBCD8n KB63Z+cIM71JNtV8JPiylWLuIiUmvSM3Lemk3FwcN+aV+RvNVU97bFXCjVvGiGscYV92 mLxQ75a8+4PTRvYwcRF+02dud9bv4ZUAZkK98iVs7/SCXpCQPkqX4a+YL8KcSSYAp4wc Y8jZLOv6skZ4aqxneJrpMBR84Fuz+qVlFDTD3AO2g1Wz5qw7sTKwrvvd38cyCP2J7e8G TG+tp6oQnrAaWZmxVSVunldWfvR9TcslJdHfk7TmzzxNz0ypnhPdeVSoe06UHa7IBOnc Q8Xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=GtrxBXAP; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc17-20020a170907169100b006db381c3815si3408570ejc.601.2022.03.10.08.00.37; Thu, 10 Mar 2022 08:01:03 -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=@infradead.org header.s=bombadil.20210309 header.b=GtrxBXAP; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233928AbiCJPBq (ORCPT + 99 others); Thu, 10 Mar 2022 10:01:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343499AbiCJO6U (ORCPT ); Thu, 10 Mar 2022 09:58:20 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F4DC188854 for ; Thu, 10 Mar 2022 06:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=t73Bn5PoTBPP0h6uAMsqu927EETHhd4aAadtdVAgAbI=; b=GtrxBXAPcQ6W9QFb4AnsRDaHP/ kiSQAqB0AS19/oFYHmdKvwDO9nCZOBWN+iU9DWJKEjVu1wtnxR4xlOv50QPKef4JQNoJAtQ8q8i6F NfR0hD8PF29RiTIFK1TJiAGqOkJnr5YpeSPnLr+rCR4ommax42/RENOPa5qi413UKaDIC7aAkuAvQ rqfx4QbnNO46yN5K/29ItPfhuunkjA+iqyTcy8AbeR0GEXk7KpM4gArnxD4xE8qrNmVJbesTSsNRT 8xcM5Ok6SSyr0AprRM+Pih8y8h6rUlYFsGd0z/kiZzkUpS9F+4kEu7mdn0TqfEhHPr5R++7oB93Hf 1D1uiTyQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nSK8a-00DDWC-JW; Thu, 10 Mar 2022 14:51:32 +0000 Date: Thu, 10 Mar 2022 06:51:32 -0800 From: Christoph Hellwig To: Tom Lendacky Cc: Dave Hansen , "Kirill A. Shutemov" , tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, luto@kernel.org, peterz@infradead.org, 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, brijesh.singh@amd.com, x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv5 27/30] x86/kvm: Use bounce buffers for TD guest Message-ID: References: <20220302142806.51844-1-kirill.shutemov@linux.intel.com> <20220302142806.51844-28-kirill.shutemov@linux.intel.com> <65577d45-8b15-08b6-2de4-3ca820e4d7a3@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65577d45-8b15-08b6-2de4-3ca820e4d7a3@amd.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Thu, Mar 10, 2022 at 08:29:01AM -0600, Tom Lendacky wrote: > > void __init mem_encrypt_init(void) > > { > > if (!cc_platform_has(CC_ATTR_MEM_ENCRYPT)) > > If you make this cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT), then it should > work for both, I would think. If you use CC_ATTR_MEM_ENCRYPT, you'll force > bare-metal SME to always use bounce buffers when doing I/O. But SME can do > I/O to encrypted memory if the device supports 64-bit DMA or if the IOMMU is > being used, so we don't want to force SWIOTLB in this case. http://git.infradead.org/users/hch/misc.git/commitdiff/18b0547fe0467cb48e64ee403f50f2587fe04e3a