Skip to contentSkip to conversation

hw/cxl: Fix missing write mask for HDM decoder target list registers

PATCH Superseded Jonathan Cameron 2 participants 3 messages May 31, 2022 – Jun 7, 2022

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/cxl: Fix missing write mask for HDM decoder target list registers

Without being able to write these registers, no interleaving is possible. More refined checks of HDM register state on commit to follow.

---
 hw/cxl/cxl-component-utils.c | 2 ++
 1 file changed, 2 insertions(+)
hw/cxl/cxl-component-utils.c +2 -0
index 7985c9bfca..993248b5c0 100644
@@ -174,6 +174,8 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk)
         write_msk[R_CXL_HDM_DECODER0_SIZE_LO + i * 0x20] = 0xf0000000;
         write_msk[R_CXL_HDM_DECODER0_SIZE_HI + i * 0x20] = 0xffffffff;
         write_msk[R_CXL_HDM_DECODER0_CTRL + i * 0x20] = 0x13ff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] = 0xffffffff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_HI + i * 0x20] = 0xffffffff;
     }
 }
 
Signature · 1 line
2.32.0
#1 lore raw
Quoted 13 lines · Jonathan Cameron

Without being able to write these registers, no interleaving is possible. More refined checks of HDM register state on commit to follow.

---
 hw/cxl/cxl-component-utils.c | 2 ++
 1 file changed, 2 insertions(+)
hw/cxl/cxl-component-utils.c +0 -0
index 7985c9bfca..993248b5c0 100644

hw/cxl/cxl-component-utils.c static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk) · line 178

Quoted 5 lines
hw/cxl/cxl-component-utils.c +2 -0
@@ -174,6 +174,8 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk)
         write_msk[R_CXL_HDM_DECODER0_SIZE_LO + i * 0x20] = 0xf0000000;
         write_msk[R_CXL_HDM_DECODER0_SIZE_HI + i * 0x20] = 0xffffffff;
         write_msk[R_CXL_HDM_DECODER0_CTRL + i * 0x20] = 0x13ff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] = 0xffffffff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_HI + i * 0x20] = 0xffffffff;

I wonder if this should be 0. It will be weird for endpoints to have a skip value of 0xff.

Quoted 6 lines
hw/cxl/cxl-component-utils.c +0 -0
     }
 }
 
Signature · 1 line
2.32.0
#2 lore raw
Quoted 9 lines · On Mon, 6 Jun 2022 10:39:52 -0700 Ben Widawsky <[email protected]> wrote:
Quoted 8 lines · Jonathan Cameron

Without being able to write these registers, no interleaving is possible. More refined checks of HDM register state on commit to follow.

---
 hw/cxl/cxl-component-utils.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

hw/cxl/cxl-component-utils.c static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk) · line 178

Quoted 10 lines
hw/cxl/cxl-component-utils.c +2 -0
index 7985c9bfca..993248b5c0 100644
@@ -174,6 +174,8 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk)
         write_msk[R_CXL_HDM_DECODER0_SIZE_LO + i * 0x20] = 0xf0000000;
         write_msk[R_CXL_HDM_DECODER0_SIZE_HI + i * 0x20] = 0xffffffff;
         write_msk[R_CXL_HDM_DECODER0_CTRL + i * 0x20] = 0x13ff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] = 0xffffffff;
+        write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_HI + i * 0x20] = 0xffffffff;  

I wonder if this should be 0. It will be weird for endpoints to have a skip value of 0xff.

For EP _LO should be 0xf0000000. But we haven't implemented skip yet IIRC.

It should be all bits set for host bridges (or switches) and that's the bug this is fixing.

We have access to the device type at the caller of this function, so I can make it right for both changes with a trivial change.

Will send a v2 shortly...

Thanks,

Jonathan

Quoted 7 lines
Quoted 7 lines
hw/cxl/cxl-component-utils.c +0 -0
     }
 }
 
Signature · 1 line
2.32.0