From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web11.47795.1598634352604340758 for ; Fri, 28 Aug 2020 10:05:52 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jFIqIyj8; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598634351; 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=Atse8AO8wz9VVLm1Ny0wPTUXcx+oxAZCOnleNvS+Zs8=; b=jFIqIyj8IztvpNIU7f7AESYL1xjOPRTea4KU73GdsBj0XN1/rIa3ynbn0dYnReBwegWLQ4 DgYi6W67H31I5MAep2aKwo3p3IFovdRejJqIXGLwi1fGyfLccue4M+eI5/w1QXkAD7rDVc S3s0CV3MSV3N8U9wZety9c8qdzSkmQs= 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-65-jFJXfrAjNl-i9kKmM3JLTw-1; Fri, 28 Aug 2020 13:05:42 -0400 X-MC-Unique: jFJXfrAjNl-i9kKmM3JLTw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FC8781CBE5; Fri, 28 Aug 2020 17:05:40 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-112-96.ams2.redhat.com [10.36.112.96]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0270160CD1; Fri, 28 Aug 2020 17:05:36 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg: Correcting EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT definition To: devel@edk2.groups.io, paul.grimes@amd.com Cc: Michael D Kinney , Liming Gao , Zhiguang Liu References: <20200827204051.777-1-Paul.Grimes@amd.com> <20200827204051.777-2-Paul.Grimes@amd.com> From: "Laszlo Ersek" Message-ID: <12ee54f0-976f-239c-81c7-3c6e71cc8892@redhat.com> Date: Fri, 28 Aug 2020 19:05:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200827204051.777-2-Paul.Grimes@amd.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=lersek@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US On 08/27/20 22:40, Paul wrote: > In Acpi10.h, EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT is defined as 0x10, > but should be 0x02 per the ACPI Specification. > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2937 > > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Signed-off-by: Paul G > --- > MdePkg/Include/IndustryStandard/Acpi10.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/MdePkg/Include/IndustryStandard/Acpi10.h b/MdePkg/Include/IndustryStandard/Acpi10.h > index fa06eefbb6e6..adeb5ae8c219 100644 > --- a/MdePkg/Include/IndustryStandard/Acpi10.h > +++ b/MdePkg/Include/IndustryStandard/Acpi10.h > @@ -358,7 +358,7 @@ typedef struct { > #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x03 > > #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x00 > > #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x01 > > -#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x10 > > +#define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x02 > > > > // > > // IO Information > Good catch. The ACPI spec text was likely cut n' pasted into the edk2 source, and then prefixed with "0x". The spec says, """ Bits [1:0] DMA transfer type preference, _SIZ 00 8-bit only 01 8- and 16-bit 10 16-bit only 11 Reserved """ but that's in binary, not in hexadecimal. In fact, the leading zero on *all four* macros (including EFI_ACPI_DMA_TRANSFER_TYPE_MASK) is misleading. In hex, the leading zero in the current macros stands for bits [7:4], which are completely irrelevant for the _SIZ bit-field in the DMA Descriptor. So optimally we'd have #define EFI_ACPI_DMA_TRANSFER_TYPE_MASK 0x3 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x0 #define EFI_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x1 #define EFI_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x2 But I agree the current patch is OK too: Reviewed-by: Laszlo Ersek I also agree it's a bugfix and should be merged now. Thanks Laszlo