diff mbox series

[ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable

Message ID 20210225112620.1827-1-yuzenghui@huawei.com (mailing list archive)
State Not Applicable, archived
Headers show
Series [ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable | expand

Commit Message

Zenghui Yu Feb. 25, 2021, 11:26 a.m. UTC
As per the IORT spec, this field overrides the value in SMMU_IRD0.HTTU
which should always have been 2 bits.

Fixes: 9f7c3e148f44 ("IORT: Add in support for the SMMUv3 subtable")
Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 source/common/dmtbinfo2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zenghui Yu Feb. 25, 2021, 11:31 a.m. UTC | #1
On 2021/2/25 19:26, Zenghui Yu wrote:
> As per the IORT spec, this field overrides the value in SMMU_IRD0.HTTU

s/SMMU_IRD0/SMMU_IDR0/
Moore, Robert Feb. 25, 2021, 8:45 p.m. UTC | #2
If the field is two bits, I think the ACPI_DMT_* symbol should be ACPI_DMT_FLAGS2, not ACPI_DMT_FLAGS1

-----Original Message-----
From: Zenghui Yu <yuzenghui@huawei.com> 
Sent: Thursday, February 25, 2021 3:26 AM
To: devel@acpica.org; linux-acpi@vger.kernel.org
Cc: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik <erik.kaneda@intel.com>; robin.murphy@arm.com; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; guohanjun@huawei.com; wanghaibin.wang@huawei.com; Zenghui Yu <yuzenghui@huawei.com>; Kunkun Jiang <jiangkunkun@huawei.com>
Subject: [PATCH] [ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable

As per the IORT spec, this field overrides the value in SMMU_IRD0.HTTU which should always have been 2 bits.

Fixes: 9f7c3e148f44 ("IORT: Add in support for the SMMUv3 subtable")
Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
---
 source/common/dmtbinfo2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c index 17a80ba21..321f106fa 100644
--- a/source/common/dmtbinfo2.c
+++ b/source/common/dmtbinfo2.c
@@ -343,7 +343,7 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoIort4[] =
     {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (BaseAddress),            "Base Address", 0},
     {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Flags),                  "Flags (decoded below)", 0},
     {ACPI_DMT_FLAG0,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "COHACC Override", 0},
-    {ACPI_DMT_FLAG1,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
+    {ACPI_DMT_FLAGS1,   ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
     {ACPI_DMT_FLAG3,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "Proximity Domain Valid", 0},
     {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Reserved),               "Reserved", 0},
     {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (VatosAddress),           "VATOS Address", 0},
--
2.19.1
Zenghui Yu Feb. 26, 2021, 1:59 a.m. UTC | #3
On 2021/2/26 4:45, Moore, Robert wrote:
> If the field is two bits, I think the ACPI_DMT_* symbol should be ACPI_DMT_FLAGS2, not ACPI_DMT_FLAGS1

The SMMUv3 flags is decoded as:

- bit[0]	"COHACC Override"
- bit[2:1]	"HTTU Override"
- bit[3]	"Proximity Domain Valid"
- bit[31:4]	"Reserved"

whilst ACPI_DMT_FLAGS2 will extract bit[3:2] for us, right?

> -----Original Message-----
> From: Zenghui Yu <yuzenghui@huawei.com>
> Sent: Thursday, February 25, 2021 3:26 AM
> To: devel@acpica.org; linux-acpi@vger.kernel.org
> Cc: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik <erik.kaneda@intel.com>; robin.murphy@arm.com; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; guohanjun@huawei.com; wanghaibin.wang@huawei.com; Zenghui Yu <yuzenghui@huawei.com>; Kunkun Jiang <jiangkunkun@huawei.com>
> Subject: [PATCH] [ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable
> 
> As per the IORT spec, this field overrides the value in SMMU_IRD0.HTTU which should always have been 2 bits.
> 
> Fixes: 9f7c3e148f44 ("IORT: Add in support for the SMMUv3 subtable")
> Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>   source/common/dmtbinfo2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c index 17a80ba21..321f106fa 100644
> --- a/source/common/dmtbinfo2.c
> +++ b/source/common/dmtbinfo2.c
> @@ -343,7 +343,7 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoIort4[] =
>       {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (BaseAddress),            "Base Address", 0},
>       {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Flags),                  "Flags (decoded below)", 0},
>       {ACPI_DMT_FLAG0,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "COHACC Override", 0},
> -    {ACPI_DMT_FLAG1,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
> +    {ACPI_DMT_FLAGS1,   ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
>       {ACPI_DMT_FLAG3,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "Proximity Domain Valid", 0},
>       {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Reserved),               "Reserved", 0},
>       {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (VatosAddress),           "VATOS Address", 0},
> --
> 2.19.1
> 
> .
>
Moore, Robert Feb. 26, 2021, 3:12 p.m. UTC | #4
Yes, you are correct. ACPI_DMT_FLAGS1 Will pick up two bits at bit [2:1]
Sorry for the noise,
Bob


-----Original Message-----
From: Zenghui Yu <yuzenghui@huawei.com> 
Sent: Thursday, February 25, 2021 5:59 PM
To: Moore, Robert <robert.moore@intel.com>; devel@acpica.org; linux-acpi@vger.kernel.org
Cc: Kaneda, Erik <erik.kaneda@intel.com>; robin.murphy@arm.com; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; guohanjun@huawei.com; wanghaibin.wang@huawei.com; Kunkun Jiang <jiangkunkun@huawei.com>
Subject: Re: [PATCH] [ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable

On 2021/2/26 4:45, Moore, Robert wrote:
> If the field is two bits, I think the ACPI_DMT_* symbol should be ACPI_DMT_FLAGS2, not ACPI_DMT_FLAGS1

The SMMUv3 flags is decoded as:

- bit[0]	"COHACC Override"
- bit[2:1]	"HTTU Override"
- bit[3]	"Proximity Domain Valid"
- bit[31:4]	"Reserved"

whilst ACPI_DMT_FLAGS2 will extract bit[3:2] for us, right?

> -----Original Message-----
> From: Zenghui Yu <yuzenghui@huawei.com>
> Sent: Thursday, February 25, 2021 3:26 AM
> To: devel@acpica.org; linux-acpi@vger.kernel.org
> Cc: Moore, Robert <robert.moore@intel.com>; Kaneda, Erik <erik.kaneda@intel.com>; robin.murphy@arm.com; Wysocki, Rafael J <rafael.j.wysocki@intel.com>; guohanjun@huawei.com; wanghaibin.wang@huawei.com; Zenghui Yu <yuzenghui@huawei.com>; Kunkun Jiang <jiangkunkun@huawei.com>
> Subject: [PATCH] [ACPICA] IORT: Fix HTTU Override mask for the SMMUv3 subtable
> 
> As per the IORT spec, this field overrides the value in SMMU_IRD0.HTTU which should always have been 2 bits.
> 
> Fixes: 9f7c3e148f44 ("IORT: Add in support for the SMMUv3 subtable")
> Reported-by: Kunkun Jiang <jiangkunkun@huawei.com>
> Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
> ---
>   source/common/dmtbinfo2.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c index 17a80ba21..321f106fa 100644
> --- a/source/common/dmtbinfo2.c
> +++ b/source/common/dmtbinfo2.c
> @@ -343,7 +343,7 @@ ACPI_DMTABLE_INFO           AcpiDmTableInfoIort4[] =
>       {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (BaseAddress),            "Base Address", 0},
>       {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Flags),                  "Flags (decoded below)", 0},
>       {ACPI_DMT_FLAG0,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "COHACC Override", 0},
> -    {ACPI_DMT_FLAG1,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
> +    {ACPI_DMT_FLAGS1,   ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
>       {ACPI_DMT_FLAG3,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "Proximity Domain Valid", 0},
>       {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Reserved),               "Reserved", 0},
>       {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (VatosAddress),           "VATOS Address", 0},
> --
> 2.19.1
> 
> .
>
diff mbox series

Patch

diff --git a/source/common/dmtbinfo2.c b/source/common/dmtbinfo2.c
index 17a80ba21..321f106fa 100644
--- a/source/common/dmtbinfo2.c
+++ b/source/common/dmtbinfo2.c
@@ -343,7 +343,7 @@  ACPI_DMTABLE_INFO           AcpiDmTableInfoIort4[] =
     {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (BaseAddress),            "Base Address", 0},
     {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Flags),                  "Flags (decoded below)", 0},
     {ACPI_DMT_FLAG0,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "COHACC Override", 0},
-    {ACPI_DMT_FLAG1,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
+    {ACPI_DMT_FLAGS1,   ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "HTTU Override", 0},
     {ACPI_DMT_FLAG3,    ACPI_IORT4_FLAG_OFFSET (Flags, 0),          "Proximity Domain Valid", 0},
     {ACPI_DMT_UINT32,   ACPI_IORT4_OFFSET (Reserved),               "Reserved", 0},
     {ACPI_DMT_UINT64,   ACPI_IORT4_OFFSET (VatosAddress),           "VATOS Address", 0},