Skip to contentSkip to conversation

pnv_lpc: disable reentrancy detection for lpc-hc

PATCH Applied Cédric Le Goater 4 participants 4 messages May 26, 2023 – May 27, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pnv_lpc: disable reentrancy detection for lpc-hc

From: Alexander Bulekov <[email protected]>

As lpc-hc is designed for re-entrant calls from xscom, mark it re-entrancy safe.

[clg: mark opb_master_regs as re-entrancy safe also ]
---
 hw/ppc/pnv_lpc.c | 3 +++
 1 file changed, 3 insertions(+)
hw/ppc/pnv_lpc.c +3 -0
index 01f44c19ebba..605d3908617a 100644
@@ -734,10 +734,13 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)
     /* Create MMIO regions for LPC HC and OPB registers */
     memory_region_init_io(&lpc->opb_master_regs, OBJECT(dev), &opb_master_ops,
                           lpc, "lpc-opb-master", LPC_OPB_REGS_OPB_SIZE);
+    lpc->opb_master_regs.disable_reentrancy_guard = true;
     memory_region_add_subregion(&lpc->opb_mr, LPC_OPB_REGS_OPB_ADDR,
                                 &lpc->opb_master_regs);
     memory_region_init_io(&lpc->lpc_hc_regs, OBJECT(dev), &lpc_hc_ops, lpc,
                           "lpc-hc", LPC_HC_REGS_OPB_SIZE);
+    /* xscom writes to lpc-hc. As such mark lpc-hc re-entrancy safe */
+    lpc->lpc_hc_regs.disable_reentrancy_guard = true;
     memory_region_add_subregion(&lpc->opb_mr, LPC_HC_REGS_OPB_ADDR,
                                 &lpc->lpc_hc_regs);
 
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Cédric Le Goater

From: Alexander Bulekov <[email protected]>

As lpc-hc is designed for re-entrant calls from xscom, mark it re-entrancy safe.

[clg: mark opb_master_regs as re-entrancy safe also ]

---

Thanks,

Fred

Quoted 21 lines
  hw/ppc/pnv_lpc.c | 3 +++
  1 file changed, 3 insertions(+)
hw/ppc/pnv_lpc.c +3 -0
index 01f44c19ebba..605d3908617a 100644
@@ -734,10 +734,13 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)
      /* Create MMIO regions for LPC HC and OPB registers */
      memory_region_init_io(&lpc->opb_master_regs, OBJECT(dev), &opb_master_ops,
                            lpc, "lpc-opb-master", LPC_OPB_REGS_OPB_SIZE);
+    lpc->opb_master_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_OPB_REGS_OPB_ADDR,
                                  &lpc->opb_master_regs);
      memory_region_init_io(&lpc->lpc_hc_regs, OBJECT(dev), &lpc_hc_ops, lpc,
                            "lpc-hc", LPC_HC_REGS_OPB_SIZE);
+    /* xscom writes to lpc-hc. As such mark lpc-hc re-entrancy safe */
+    lpc->lpc_hc_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_HC_REGS_OPB_ADDR,
                                  &lpc->lpc_hc_regs);
 
Tested-by on v1 1/1
#2 lore raw
In reply to Cédric Le Goater
Quoted 21 lines · Cédric Le Goater

From: Alexander Bulekov <[email protected]>

As lpc-hc is designed for re-entrant calls from xscom, mark it re-entrancy safe.

[clg: mark opb_master_regs as re-entrancy safe also ]
---
  hw/ppc/pnv_lpc.c | 3 +++
  1 file changed, 3 insertions(+)
hw/ppc/pnv_lpc.c +0 -0
index 01f44c19ebba..605d3908617a 100644
@@ -734,10 +734,13 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)
      /* Create MMIO regions for LPC HC and OPB registers */
      memory_region_init_io(&lpc->opb_master_regs, OBJECT(dev), &opb_master_ops,
                            lpc, "lpc-opb-master", LPC_OPB_REGS_OPB_SIZE);

hw/ppc/pnv_lpc.c static void pnv_lpc_realize(DeviceState *dev, Error **errp) · line 746

Quoted 10 lines
hw/ppc/pnv_lpc.c +3 -0
+    lpc->opb_master_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_OPB_REGS_OPB_ADDR,
                                  &lpc->opb_master_regs);
      memory_region_init_io(&lpc->lpc_hc_regs, OBJECT(dev), &lpc_hc_ops, lpc,
                            "lpc-hc", LPC_HC_REGS_OPB_SIZE);
+    /* xscom writes to lpc-hc. As such mark lpc-hc re-entrancy safe */
+    lpc->lpc_hc_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_HC_REGS_OPB_ADDR,
                                  &lpc->lpc_hc_regs);
 
#3 lore raw
In reply to Cédric Le Goater
Quoted 10 lines · Cédric Le Goater

From: Alexander Bulekov <[email protected]>

As lpc-hc is designed for re-entrant calls from xscom, mark it re-entrancy safe.

[clg: mark opb_master_regs as re-entrancy safe also ]

---

Queued in gitlab.com/danielhb/qemu/tree/ppc-next. Thanks,

Daniel

Quoted 21 lines
  hw/ppc/pnv_lpc.c | 3 +++
  1 file changed, 3 insertions(+)
hw/ppc/pnv_lpc.c +3 -0
index 01f44c19ebba..605d3908617a 100644
@@ -734,10 +734,13 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp)
      /* Create MMIO regions for LPC HC and OPB registers */
      memory_region_init_io(&lpc->opb_master_regs, OBJECT(dev), &opb_master_ops,
                            lpc, "lpc-opb-master", LPC_OPB_REGS_OPB_SIZE);
+    lpc->opb_master_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_OPB_REGS_OPB_ADDR,
                                  &lpc->opb_master_regs);
      memory_region_init_io(&lpc->lpc_hc_regs, OBJECT(dev), &lpc_hc_ops, lpc,
                            "lpc-hc", LPC_HC_REGS_OPB_SIZE);
+    /* xscom writes to lpc-hc. As such mark lpc-hc re-entrancy safe */
+    lpc->lpc_hc_regs.disable_reentrancy_guard = true;
      memory_region_add_subregion(&lpc->opb_mr, LPC_HC_REGS_OPB_ADDR,
                                  &lpc->lpc_hc_regs);