[Skiboot] [PATCH] dt: add ibm, tlbiel-congruence-classes-(hash|radix) for tlbiel IS!=0

Nicholas Piggin npiggin at gmail.com
Sat Apr 22 10:58:53 AEST 2017


>From Power ISA 3.0B, Chapter 5. Storage Control 1033, "The IS!=0 tlbiel
variants operate on a specified congruence class, requiring a software
loop where tlbie operates on the entire TLB."

This adds a dt entry for the number of congruence classes that must be
specified in order to operate on the entire TLB, when using the tlbiel
instruction with IS != 0.

This property does not reflect the TLB geometry, only the tlbiel
instruction behaviour.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 doc/device-tree.rst |  3 +++
 hdata/cpu-common.c  | 15 +++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/doc/device-tree.rst b/doc/device-tree.rst
index fe527c65..838847ee 100644
--- a/doc/device-tree.rst
+++ b/doc/device-tree.rst
@@ -181,6 +181,9 @@ Root node of device tree
 			/* SLB size, use as-is */
 			ibm,slb-size = <0x20>;
 
+			/* TLB congruence classes for tlbiel IS != 0 */
+			ibm,tlbiel-congruence-classes-hash = <0x200>;
+
 			/* VSX support, use as-is */
 			ibm,vmx = <0x2>;
 
diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
index 9a05227f..8b540c01 100644
--- a/hdata/cpu-common.c
+++ b/hdata/cpu-common.c
@@ -64,6 +64,8 @@ struct dt_node * add_core_common(struct dt_node *cpus,
 	       0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 48 .. 55 */
 	       0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 56 .. 63 */
 	};
+	int tlb_congruence_hash = 0;
+	int tlb_congruence_radix = 0;
 
 	const uint8_t *pa_features;
 	size_t pa_features_size;
@@ -84,11 +86,13 @@ struct dt_node * add_core_common(struct dt_node *cpus,
 		name = "PowerPC,POWER7";
 		pa_features = pa_features_p7;
 		pa_features_size = sizeof(pa_features_p7);
+		tlb_congruence_hash = 128;
 		break;
 	case PVR_TYPE_P7P:
 		name = "PowerPC,POWER7+";
 		pa_features = pa_features_p7p;
 		pa_features_size = sizeof(pa_features_p7p);
+		tlb_congruence_hash = 128;
 		break;
 	case PVR_TYPE_P8E:
 	case PVR_TYPE_P8:
@@ -96,6 +100,7 @@ struct dt_node * add_core_common(struct dt_node *cpus,
 		name = "PowerPC,POWER8";
 		pa_features = pa_features_p8;
 		pa_features_size = sizeof(pa_features_p8);
+		tlb_congruence_hash = 512;
 		break;
 	case PVR_TYPE_P9:
 		name = "PowerPC,POWER9";
@@ -106,6 +111,8 @@ struct dt_node * add_core_common(struct dt_node *cpus,
 			pa_features = pa_features_p9_dd2;
 			pa_features_size = sizeof(pa_features_p9_dd2);
 		}
+		tlb_congruence_hash = 256;
+		tlb_congruence_radix = 128;
 		break;
 	default:
 		name = "PowerPC,Unknown";
@@ -147,6 +154,14 @@ struct dt_node * add_core_common(struct dt_node *cpus,
 				pa_features, pa_features_size);
 	}
 	dt_add_property_cells(cpu, "ibm,slb-size", 0x20);
+	if (tlb_congruence_hash) {
+		dt_add_property_cells(cpu, "ibm,tlbiel-congruence-classes-hash",
+						tlb_congruence_hash);
+	}
+	if (tlb_congruence_radix) {
+		dt_add_property_cells(cpu, "ibm,tlbiel-congruence-classes-radix",
+						tlb_congruence_radix);
+	}
 
 	dt_add_property_cells(cpu, "ibm,vmx", 0x2);
 	dt_add_property_cells(cpu, "ibm,dfp", 0x2);
-- 
2.11.0



More information about the Skiboot mailing list