Skip to contentSkip to conversation

mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

PATCH Superseded Yao Xingtao via 1 participant 6 messages Apr 7, 2024 – May 8, 2024

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

So implements this feature is needed.

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +14 -4
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr host_addr, uint64_t *dpa)
             continue;
         }
 
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
-              >> iw));
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) & hpa_offset)
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
         return true;
     }
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk = ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;
 
     cxl_component_register_init_common(reg_state, write_msk, CXL2_TYPE3_DEVICE);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY, 3_6_12_WAY, 1);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY, 16_WAY, 1);
+
     cxl_device_register_init_t3(ct3d);
 
     /*
Signature · 1 line
2.37.3
#1 lore raw

ping.

Quoted 71 lines

-----Original Message-----
From: Yao Xingtao <[email protected]>
Sent: Sunday, April 7, 2024 11:07 AM
To: [email protected]; [email protected]
Cc: [email protected]; Yao, Xingtao/姚 幸涛 <[email protected]>
Subject: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

So implements this feature is needed.

Link:
https://lore.kernel.org/linux-cxl/3e84b919-7631-d1db-3e1d-33000f3f3868@fujits
u.com/

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +11 -4
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr
 host_addr, uint64_t *dpa)
             continue;
         }
 
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
-              >> iw));
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) & hpa_offset)
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
         return true;
     }
hw/mem/cxl_type3.c +3 -0
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk = ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;
 
     cxl_component_register_init_common(reg_state, write_msk,
 CXL2_TYPE3_DEVICE);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 3_6_12_WAY, 1);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 16_WAY, 1);
+
     cxl_device_register_init_t3(ct3d);

     /*

--
2.37.3

#2 lore raw
Quoted 61 lines · On Wed, 24 Apr 2024 01:36:56 +0000 "Xingtao Yao (Fujitsu)"…

ping.

Quoted 59 lines

-----Original Message-----
From: Yao Xingtao <[email protected]>
Sent: Sunday, April 7, 2024 11:07 AM
To: [email protected]; [email protected]
Cc: [email protected]; Yao, Xingtao/姚 幸涛 <[email protected]>
Subject: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

So implements this feature is needed.

Link:
https://lore.kernel.org/linux-cxl/3e84b919-7631-d1db-3e1d-33000f3f3868@fujits
u.com/

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +11 -4
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr
 host_addr, uint64_t *dpa)
             continue;
         }
 
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)  
-              >> iw));  
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) & hpa_offset)
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
         return true;
     }
hw/mem/cxl_type3.c +0 -0
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk = ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;
 
Quoted 7 lines

hw/mem/cxl_type3.c static void ct3d_reset(DeviceState *dev) · line 921

Quoted 7 lines
hw/mem/cxl_type3.c +3 -0
     cxl_component_register_init_common(reg_state, write_msk,
 CXL2_TYPE3_DEVICE);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 3_6_12_WAY, 1);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 16_WAY, 1);
+

Why here rather than in hdm_reg_init_common()? It's constant data and is currently being set to 0 in there.

Quoted 6 lines
Quoted 5 lines
     cxl_device_register_init_t3(ct3d);

     /*

--
2.37.3

#3 lore raw
Quoted 86 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Tuesday, April 30, 2024 10:43 PM
To: Yao, Xingtao/姚 幸涛 <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Quoted 7 lines · On Wed, 24 Apr 2024 01:36:56 +0000 "Xingtao Yao (Fujitsu)"…

ping.

Quoted 5 lines

-----Original Message-----
From: Yao Xingtao <[email protected]>
Sent: Sunday, April 7, 2024 11:07 AM
To: [email protected]; [email protected]
Cc: [email protected]; Yao, Xingtao/姚 幸涛

<[email protected]>

Quoted 10 lines
Quoted 10 lines

Subject: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

Quoted 8 lines
Quoted 8 lines

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

So implements this feature is needed.

Link:

https://lore.kernel.org/linux-cxl/3e84b919-7631-d1db-3e1d-33000f3f3868@fujits

Quoted 11 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d,

Quoted 11 lines

u.com/

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +0 -0
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d,

hwaddr

Quoted 4 lines
Quoted 4 lines
hw/mem/cxl_type3.c +0 -0
 host_addr, uint64_t *dpa)
             continue;
         }
 
Quoted 8 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr host_addr, uint64_t *dpa)

Quoted 8 lines
hw/mem/cxl_type3.c +4 -4
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)
-              >> iw));
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) &

hpa_offset)

Quoted 8 lines
Quoted 8 lines
hw/mem/cxl_type3.c +7 -0
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) & hpa_offset)
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
Quoted 4 lines

hw/mem/cxl_type3.c static void ct3d_reset(DeviceState *dev) · line 913

Quoted 4 lines
hw/mem/cxl_type3.c +0 -0
         return true;
     }
hw/mem/cxl_type3.c +0 -0
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk =

ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;

Quoted 8 lines

hw/mem/cxl_type3.c static void ct3d_reset(DeviceState *dev) · line 920

Quoted 8 lines
hw/mem/cxl_type3.c +3 -0
     cxl_component_register_init_common(reg_state, write_msk,
 CXL2_TYPE3_DEVICE);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 3_6_12_WAY, 1);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 16_WAY, 1);
+
Quoted 2 lines

Why here rather than in hdm_reg_init_common()? It's constant data and is currently being set to 0 in there.

according to the CXL specifications (8.2.4.20.1 CXL HDM Decoder Capability Register (Offset 00h)), this feature is only applicable to cxl.mem, upstream switch port and CXL host bridges shall hardwrite these bits to 0.

so I think it would be more appropriate to set these bits here.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
hw/mem/cxl_type3.c +0 -0
     cxl_device_register_init_t3(ct3d);
     /*

--
2.37.3

#4 lore raw
Quoted 84 lines · On Tue, 7 May 2024 00:22:00 +0000 "Xingtao Yao (Fujitsu)"…
Quoted 84 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Tuesday, April 30, 2024 10:43 PM
To: Yao, Xingtao/姚 幸涛 <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Quoted 7 lines · On Wed, 24 Apr 2024 01:36:56 +0000 "Xingtao Yao (Fujitsu)"…

ping.

Quoted 5 lines

-----Original Message-----
From: Yao Xingtao <[email protected]>
Sent: Sunday, April 7, 2024 11:07 AM
To: [email protected]; [email protected]
Cc: [email protected]; Yao, Xingtao/姚 幸涛

<[email protected]>

Quoted 10 lines
Quoted 10 lines

Subject: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

Quoted 8 lines
Quoted 8 lines

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

So implements this feature is needed.

Link:

https://lore.kernel.org/linux-cxl/3e84b919-7631-d1db-3e1d-33000f3f3868@fujits

Quoted 11 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d,

Quoted 11 lines

u.com/

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +0 -0
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d,  

hwaddr

Quoted 4 lines
Quoted 4 lines
hw/mem/cxl_type3.c +0 -0
 host_addr, uint64_t *dpa)
             continue;
         }
 
Quoted 8 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr host_addr, uint64_t *dpa)

Quoted 8 lines
hw/mem/cxl_type3.c +4 -4
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) & hpa_offset)  
-              >> iw));  
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) &  

hpa_offset)

Quoted 8 lines
Quoted 8 lines
hw/mem/cxl_type3.c +7 -0
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) & hpa_offset)
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
Quoted 4 lines

hw/mem/cxl_type3.c static void ct3d_reset(DeviceState *dev) · line 913

Quoted 4 lines
hw/mem/cxl_type3.c +0 -0
         return true;
     }
hw/mem/cxl_type3.c +0 -0
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk =  

ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;

Quoted 8 lines
Quoted 8 lines
hw/mem/cxl_type3.c +3 -0
     cxl_component_register_init_common(reg_state, write_msk,
 CXL2_TYPE3_DEVICE);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 3_6_12_WAY, 1);
+    ARRAY_FIELD_DP32(reg_state, CXL_HDM_DECODER_CAPABILITY,
 16_WAY, 1);
+  
Quoted 8 lines
Quoted 2 lines

Why here rather than in hdm_reg_init_common()? It's constant data and is currently being set to 0 in there.

according to the CXL specifications (8.2.4.20.1 CXL HDM Decoder Capability Register (Offset 00h)), this feature is only applicable to cxl.mem, upstream switch port and CXL host bridges shall hardwrite these bits to 0.

so I think it would be more appropriate to set these bits here.

I don't follow. hdm_init_common() (sorry wrong function name above) has some type specific stuff already to show how this can be done. I'd prefer to minimize what we set directly in the ct3d_reset() call because it loses the connection to the rest of the register setup.

Jonathan

Jonathan

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
hw/mem/cxl_type3.c +0 -0
     cxl_device_register_init_t3(ct3d);
     /*

--
2.37.3

#5 lore raw
Quoted 109 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Wednesday, May 8, 2024 12:31 AM
To: Yao, Xingtao/姚 幸涛 <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave ways

Quoted 6 lines · On Tue, 7 May 2024 00:22:00 +0000 "Xingtao Yao (Fujitsu)"…
Quoted 6 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Tuesday, April 30, 2024 10:43 PM
To: Yao, Xingtao/姚 幸涛 <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave

ways

Quoted 6 lines
Quoted 6 lines
Quoted 2 lines · On Wed, 24 Apr 2024 01:36:56 +0000 "Xingtao Yao (Fujitsu)"…

ping.

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
Quoted 5 lines

-----Original Message-----
From: Yao Xingtao <[email protected]>
Sent: Sunday, April 7, 2024 11:07 AM
To: [email protected]; [email protected]
Cc: [email protected]; Yao, Xingtao/姚 幸涛

<[email protected]>

Quoted 1 line
Quoted 1 line

Subject: [PATCH v2] mem/cxl_type3: support 3, 6, 12 and 16 interleave

ways

Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

Since the kernel does not check the interleave capability, a 3-way, 6-way, 12-way or 16-way region can be create normally.

Applications can access the memory of 16-way region normally because qemu can convert hpa to dpa correctly for the power of 2 interleave ways, after kernel implementing the check, this kind of region will not be created any more.

For non power of 2 interleave ways, applications could not access the memory normally and may occur some unexpected behaviors, such as segmentation fault.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

So implements this feature is needed.

Link:

https://lore.kernel.org/linux-cxl/3e84b919-7631-d1db-3e1d-33000f3f3868@fujits

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d,

Quoted 11 lines

u.com/

---
 hw/mem/cxl_type3.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
hw/mem/cxl_type3.c +0 -0
index b0a7e9f11b..d6ef784e96 100644
@@ -805,10 +805,17 @@ static bool cxl_type3_dpa(CXLType3Dev *ct3d,

hwaddr

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr host_addr, uint64_t *dpa)

Quoted 7 lines
hw/mem/cxl_type3.c +0 -3
 host_addr, uint64_t *dpa)
             continue;
         }
 
-        *dpa = dpa_base +
-            ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
-             ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) &

hpa_offset)

Quoted 11 lines
Quoted 11 lines
Quoted 5 lines

hw/mem/cxl_type3.c static bool cxl_type3_dpa(CXLType3Dev *ct3d, hwaddr host_addr, uint64_t *dpa)

Quoted 5 lines
hw/mem/cxl_type3.c +4 -1
-              >> iw));
+        if (iw < 8) {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((MAKE_64BIT_MASK(8 + ig + iw, 64 - 8 - ig - iw) &

hpa_offset)

Quoted 5 lines
Quoted 5 lines
hw/mem/cxl_type3.c +5 -0
+                  >> iw));
+        } else {
+            *dpa = dpa_base +
+                ((MAKE_64BIT_MASK(0, 8 + ig) & hpa_offset) |
+                 ((((MAKE_64BIT_MASK(ig + iw, 64 - ig - iw) &

hpa_offset)

Quoted 9 lines
Quoted 9 lines
Quoted 7 lines

hw/mem/cxl_type3.c static void ct3d_reset(DeviceState *dev) · line 913

Quoted 7 lines
hw/mem/cxl_type3.c +2 -0
+                   >> (ig + iw)) / 3) << (ig + 8)));
+        }
 
         return true;
     }
hw/mem/cxl_type3.c +0 -0
@@ -906,6 +913,9 @@ static void ct3d_reset(DeviceState *dev)
     uint32_t *write_msk =

ct3d->cxl_cstate.crb.cache_mem_regs_write_mask;

Quoted 1 line
Quoted 1 line
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

cxl_component_register_init_common(reg_state, write_msk,
CXL2_TYPE3_DEVICE);
+ ARRAY_FIELD_DP32(reg_state,

CXL_HDM_DECODER_CAPABILITY,

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

3_6_12_WAY, 1);
+ ARRAY_FIELD_DP32(reg_state,

CXL_HDM_DECODER_CAPABILITY,

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Quoted 2 lines

16_WAY, 1);
+

Why here rather than in hdm_reg_init_common()? It's constant data and is currently being set to 0 in there.

according to the CXL specifications (8.2.4.20.1 CXL HDM Decoder Capability

Register (Offset 00h)),

Quoted 1 line

this feature is only applicable to cxl.mem, upstream switch port and CXL host

Quoted 8 lines

bridges shall hardwrite

Quoted 3 lines

these bits to 0.

so I think it would be more appropriate to set these bits here.

I don't follow. hdm_init_common() (sorry wrong function name above) has some type specific stuff already to show how this can be done. I'd prefer to minimize what we set directly in the ct3d_reset() call because it loses the connection to the rest of the register setup.

thanks, got it.

Quoted 17 lines

Jonathan

Jonathan

Quoted 9 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

     cxl_device_register_init_t3(ct3d);

     /*

--
2.37.3