diff mbox series

[48/61] xive/p10: Change alignment of the queue overflow pages

Message ID 20210719132012.150948-49-hegdevasant@linux.vnet.ibm.com
State Superseded
Headers show
Series P10 Enablement | expand

Commit Message

Vasant Hegde July 19, 2021, 1:19 p.m. UTC
From: Cédric Le Goater <clg@kaod.org>

The Memory Coherence Directory uses 16M "granule" to track shared
copies of a cache line. If any cache line within the 16M range gets
touched by someone outside of the group, the MCD forces accesses to
any cache line within the range to include everyone that might have a
shared copy.

Allocate the queue overflow pages and use a 16M alignment to avoid
sharing with other structures and reduce traffic on the PowerBus.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
 hw/xive2.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/xive2.c b/hw/xive2.c
index 1f08ddef6..b79635cc9 100644
--- a/hw/xive2.c
+++ b/hw/xive2.c
@@ -1497,6 +1497,8 @@  static bool xive_configure_bars(struct xive *x)
 	xive_dbg(x, "NVP: %14p [0x%012llx]\n", x->nvp_base, x->nvp_size);
 	xive_dbg(x, "ESB: %14p [0x%012llx]\n", x->esb_base, x->esb_size);
 	xive_dbg(x, "END: %14p [0x%012llx]\n", x->end_base, x->end_size);
+	xive_dbg(x, "OVF: %14p [0x%012x]\n", x->q_ovf,
+		 VC_QUEUE_COUNT * PAGE_SIZE);
 
 	return true;
 }
@@ -1903,8 +1905,22 @@  static bool xive_prealloc_tables(struct xive *x)
 		return false;
 	}
 
-	/* Allocate the queue overflow pages */
-	x->q_ovf = local_alloc(x->chip_id, VC_QUEUE_COUNT * PAGE_SIZE, PAGE_SIZE);
+	/*
+	 * The Memory Coherence Directory uses 16M "granule" to track
+	 * shared copies of a cache line. If any cache line within the
+	 * 16M range gets touched by someone outside of the group, the
+	 * MCD forces accesses to any cache line within the range to
+	 * include everyone that might have a shared copy.
+	 */
+#define QUEUE_OVF_ALIGN (16 << 20) /* MCD granule size */
+
+	/*
+	 * Allocate the queue overflow pages and use a 16M alignment
+	 * to avoid sharing with other structures and reduce traffic
+	 * on the PowerBus.
+	 */
+	x->q_ovf = local_alloc(x->chip_id, VC_QUEUE_COUNT * PAGE_SIZE,
+			       QUEUE_OVF_ALIGN);
 	if (!x->q_ovf) {
 		xive_err(x, "Failed to allocate queue overflow\n");
 		return false;