From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.groups.io with SMTP id smtpd.web12.8892.1585063578747414782 for ; Tue, 24 Mar 2020 08:26:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=TN23vpgq; spf=pass (domain: redhat.com, ip: 63.128.21.74, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585063577; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZIeffhr3Ii2sJetniTpba+3t8aGYJqbLvzNgSFMSO+4=; b=TN23vpgqMswEnucCSnuJmUV7GoHN1/8mS7a87j4vSZjM+KEag+vHpbuiTrpKobfTmUxGg8 4zFAbNMCLQqDyIAcGep2754/e9En+utarbITwdFBg94mj2Ulh5JGF2SzJE0QmfEgQ0Vl5d AKBVSBdMLO/kJA0enmZI1MDRw09XFq8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-44-2t8xtcm9PBKP67g3_qAO-w-1; Tue, 24 Mar 2020 11:26:14 -0400 X-MC-Unique: 2t8xtcm9PBKP67g3_qAO-w-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 9AAD0800D5E; Tue, 24 Mar 2020 15:26:12 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-139.ams2.redhat.com [10.36.115.139]) by smtp.corp.redhat.com (Postfix) with ESMTP id D93CD1001B3F; Tue, 24 Mar 2020 15:26:08 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH 17/17] OvmfPkg/PvScsiDxe: Enable device 64-bit DMA addresses To: devel@edk2.groups.io, liran.alon@oracle.com Cc: nikita.leshchenko@oracle.com, aaron.young@oracle.com, jordan.l.justen@intel.com, ard.biesheuvel@linaro.org References: <20200316150113.104630-1-liran.alon@oracle.com> <20200316150113.104630-18-liran.alon@oracle.com> From: "Laszlo Ersek" Message-ID: Date: Tue, 24 Mar 2020 16:26:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200316150113.104630-18-liran.alon@oracle.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 03/16/20 16:01, Liran Alon wrote: > Enable PCI dual-address cycle attribute to signal device supports > 64-bit DMA addresses. > > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2567 > Reviewed-by: Nikita Leshenko > Signed-off-by: Liran Alon > --- > OvmfPkg/PvScsiDxe/PvScsi.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/OvmfPkg/PvScsiDxe/PvScsi.c b/OvmfPkg/PvScsiDxe/PvScsi.c > index 33167c177b42..e673ed8ba6a0 100644 > --- a/OvmfPkg/PvScsiDxe/PvScsi.c > +++ b/OvmfPkg/PvScsiDxe/PvScsi.c > @@ -814,6 +814,27 @@ PvScsiSetPCIAttributes ( > return Status; > } > > + // > + // Signal device supports 64-bit DMA addresses > + // > + Status = Dev->PciIo->Attributes ( > + Dev->PciIo, > + EfiPciIoAttributeOperationEnable, > + EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE, > + NULL > + ); > + if (EFI_ERROR (Status)) { > + // > + // Warn user device will only be using 32-bit DMA addresses. > + // > + // Note that this does not prevent device/driver from working > + // and therefore we only warn and continue as usual. > + // > + DEBUG ((DEBUG_WARN, > + "%a: failed to enable 64-bit DMA addresses\n", > + __FUNCTION__)); > + } > + > return EFI_SUCCESS; > } > > I've consulted the UEFI spec, and it indeed makes sense to attempt enabling this attribute in a separate step. So, good idea. Regarding the DEBUG message: (1) The indentation of the 2nd and 3rd argument is incorrect. Please pick: DEBUG ((DEBUG_WARN, "%a: failed to enable 64-bit DMA addresses\n", __FUNCTION__)); or: DEBUG (( DEBUG_WARN, "%a: failed to enable 64-bit DMA addresses\n", __FUNCTION__ )); Thanks! Laszlo