From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web11.38079.1639559939162105202 for ; Wed, 15 Dec 2021 01:18:59 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gENReACR; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639559938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=haxqFix9HPP7LGiqpIamLvKJLydt6/gMO23qxk0yPK4=; b=gENReACR4kmfDjNwc6534EETQMeivePXe63xTciiyLO/1pVAUtrrt/0lKIB7LA54V6ClWl Re0Fcu/FGA8hNA1Gawqx8EOfy0LXdcFk0eV6MNh2k9MKUss5NUr90iqd9gp9noX+CR4QWf ArUXeFpYtaul8GNCTt+6YB6Huj7Yl4g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-83-XE7I8oBnMt6TJ6fdnPhCtA-1; Wed, 15 Dec 2021 04:18:53 -0500 X-MC-Unique: XE7I8oBnMt6TJ6fdnPhCtA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BC632F24; Wed, 15 Dec 2021 09:18:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2402310927A7; Wed, 15 Dec 2021 09:18:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 87817180039F; Wed, 15 Dec 2021 10:18:49 +0100 (CET) Date: Wed, 15 Dec 2021 10:18:49 +0100 From: "Gerd Hoffmann" To: Min Xu Cc: devel@edk2.groups.io, Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky Subject: Re: [PATCH V4 27/31] OvmfPkg: Update IoMmuDxe to support TDX Message-ID: <20211215091849.uumo6bubqownvxpa@sirius.home.kraxel.org> References: <329c6fdb80d1277504ff4cf55ddc9e528fbe8091.1639399598.git.min.m.xu@intel.com> MIME-Version: 1.0 In-Reply-To: <329c6fdb80d1277504ff4cf55ddc9e528fbe8091.1639399598.git.min.m.xu@intel.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Dec 13, 2021 at 08:56:58PM +0800, Min Xu wrote: > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429 > > The IOMMU protocol driver provides capabilities to set a DMA access > attribute and methods to allocate, free, map and unmap the DMA memory > for the PCI Bus devices. > > The current IoMmuDxe driver supports DMA operations inside SEV guest. > To support DMA operation in TDX guest, > CC_GUEST_IS_XXX (PcdConfidentialComputingGuestAttr) is used to determine > if it is SEV guest or TDX guest. > > Due to security reasons all DMA operations inside the SEV/TDX guest must > be performed on shared pages. The IOMMU protocol driver for the SEV/TDX > guest uses a bounce buffer to map guest DMA buffer to shared pages in > order to provide the support for DMA operations inside SEV/TDX guest. > > The call of SEV or TDX specific function to set/clear EncMask/SharedBit > is determined by CC_GUEST_IS_XXX (PcdConfidentialComputingGuestAttr). > > Cc: Ard Biesheuvel > Cc: Jordan Justen > Cc: Brijesh Singh > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Gerd Hoffmann > Signed-off-by: Min Xu Acked-by: Gerd Hoffmann