From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 339A221E70D26 for ; Wed, 30 Aug 2017 08:53:32 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A66ADC0587E6; Wed, 30 Aug 2017 15:53:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A66ADC0587E6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=lersek@redhat.com Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-136.rdu2.redhat.com [10.10.120.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id B87378D543; Wed, 30 Aug 2017 15:53:34 +0000 (UTC) From: Laszlo Ersek To: edk2-devel-01 Cc: Brijesh Singh , Jordan Justen Date: Wed, 30 Aug 2017 17:53:16 +0200 Message-Id: <20170830155317.30917-11-lersek@redhat.com> In-Reply-To: <20170830155317.30917-1-lersek@redhat.com> References: <20170830155317.30917-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Wed, 30 Aug 2017 15:53:35 +0000 (UTC) Subject: [PATCH 10/11] OvmfPkg/IoMmuDxe: IoMmuAllocateBuffer(): nicer and more informative DEBUGs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2017 15:53:32 -0000 Log all relevant IN and IN OUT parameters on entry. (Note that the HostAddress parameter is IN OUT rather than OUT due to historical reasons. The "IN EFI_ALLOCATE_TYPE Type" parameter is now to be ignored, but historically it could be set to AllocateMaxAddress for example, and for that HostAddress had to be IN OUT.) When exiting with success, log all relevant OUT parameters (i.e., HostAddress). Also log the new (internal) StashBuffer address, on which IoMmuMap() and IoMmuUnmap() rely on, for BusMasterCommonBuffer operations (in-place decryption and encryption, respectively). Cc: Brijesh Singh Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek --- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c index a153d250d545..0ab7043498bd 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -490,6 +490,15 @@ IoMmuAllocateBuffer ( UINTN CommonBufferPages; COMMON_BUFFER_HEADER *CommonBufferHeader; + DEBUG (( + DEBUG_VERBOSE, + "%a: MemoryType=%u Pages=0x%Lx Attributes=0x%Lx\n", + __FUNCTION__, + (UINT32)MemoryType, + (UINT64)Pages, + Attributes + )); + // // Validate Attributes // @@ -566,10 +575,10 @@ IoMmuAllocateBuffer ( DEBUG (( DEBUG_VERBOSE, - "%a Address 0x%Lx Pages 0x%Lx\n", + "%a: Host=0x%Lx Stash=0x%p\n", __FUNCTION__, PhysicalAddress, - (UINT64)Pages + StashBuffer )); return EFI_SUCCESS; -- 2.14.1.3.gb7cf6e02401b