diff mbox series

hdata: add mmu-pid-bits and mmu-lpid-bits for POWER10 CPUs

Message ID 20211109075932.2051108-1-npiggin@gmail.com
State Accepted
Headers show
Series hdata: add mmu-pid-bits and mmu-lpid-bits for POWER10 CPUs | expand

Checks

Context Check Description
snowpatch_ozlabs/github-Docker_builds_and_checks success Successfully ran 9 jobs.

Commit Message

Nicholas Piggin Nov. 9, 2021, 7:59 a.m. UTC
This adds ibm,mmu-pid-bits and a new ibm,mmu-lpid-bits to POWER10 CPUs.
POWER9 Linux has some workarounds for processors bugs that means it's
probably safer to not add the entries there.

Linux already hard codes these values correctly on these processors, but
this allows more flexibility to change things.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---

The Linux patch for mmu-lpid-bits is posted to the mailing list but not
upstream yet.

 external/mambo/skiboot.tcl | 5 +++++
 hdata/cpu-common.c         | 4 ++++
 2 files changed, 9 insertions(+)

Comments

Cédric Le Goater Nov. 10, 2021, 6:30 a.m. UTC | #1
On 11/9/21 08:59, Nicholas Piggin wrote:
> This adds ibm,mmu-pid-bits and a new ibm,mmu-lpid-bits to POWER10 CPUs.
> POWER9 Linux has some workarounds for processors bugs that means it's
> probably safer to not add the entries there.
> 
> Linux already hard codes these values correctly on these processors, but
> this allows more flexibility to change things.
> 
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
> ---

Applied on master.

Thanks,

C.
diff mbox series

Patch

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index fb6c93547..5e1e7ab87 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -553,6 +553,11 @@  for { set c 0 } { $c < $mconf(cpus) } { incr c } {
 	mysim of addprop $cpu_node array64 "ibm,pa-features" reg
     }
 
+    if { $default_config == "P10" } {
+        mysim of addprop $cpu_node int "ibm,mmu-pid-bits" 20
+        mysim of addprop $cpu_node int "ibm,mmu-lpid-bits" 12
+    }
+
     set irqreg [list]
     for { set t 0 } { $t < $mconf(threads) } { incr t } {
 	mysim mcm 0 cpu $c thread $t set spr pc $mconf(boot_pc)
diff --git a/hdata/cpu-common.c b/hdata/cpu-common.c
index bf821c154..2248f9b61 100644
--- a/hdata/cpu-common.c
+++ b/hdata/cpu-common.c
@@ -123,6 +123,10 @@  struct dt_node * add_core_common(struct dt_node *cpus,
 	if (proc_gen >= proc_gen_p9)
 		dt_add_property_cells(cpu, "ibm,processor-radix-AP-encodings",
 			0x0000000c, 0xa0000010, 0x20000015, 0x4000001e);
+	if (proc_gen >= proc_gen_p10) {
+		dt_add_property_cells(cpu, "ibm,mmu-pid-bits", 20);
+		dt_add_property_cells(cpu, "ibm,mmu-lpid-bits", 12);
+	}
 
 	/* HPT segment page size encodings, common to all supported CPUs */
 	dt_add_property_cells(cpu, "ibm,segment-page-sizes",