Skip to content

Commit d463751

Browse files
jannaumarcan
authored andcommitted
WIP: m1n1.hv: add support for starting CPUs on the second M1 Ultra die
notes: - macos guest only works if the display is not initialized - macos guest appears to be very slow Signed-off-by: Janne Grunau <[email protected]>
1 parent 6df73d8 commit d463751

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

proxyclient/m1n1/hv.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,21 +1167,25 @@ def cpustart_wh(base, off, data, width):
11671167
self.log(f"CPUSTART W {base:x}+{off:x}:{width} = 0x{data:x}")
11681168
if off >= 8:
11691169
assert width == 32
1170+
die = base // 0x20_0000_0000
11701171
cluster = (off - 8) // 4
11711172
for i in range(32):
11721173
if data & (1 << i):
1173-
self.start_secondary(cluster, i)
1174+
self.start_secondary(die, cluster, i)
11741175

1175-
PMGR_CPU_START = 0x54000
1176-
zone = irange(pmgr0_start + PMGR_CPU_START, 0x20)
1177-
self.map_hook(pmgr0_start + PMGR_CPU_START, 0x20, write=cpustart_wh)
1178-
self.add_tracer(zone, "CPU_START", TraceMode.RESERVED)
1176+
die_count = self.adt["/arm-io"].die_count if hasattr(self.adt["/arm-io"], "die-count") else 1
11791177

1180-
def start_secondary(self, cluster, cpu):
1181-
self.log(f"Starting guest secondary {cluster}:{cpu}")
1178+
for die in range(0, die_count):
1179+
PMGR_CPU_START = 0x54000 + die * 0x20_0000_0000
1180+
zone = irange(pmgr0_start + PMGR_CPU_START, 0x20)
1181+
self.map_hook(pmgr0_start + PMGR_CPU_START, 0x20, write=cpustart_wh)
1182+
self.add_tracer(zone, "CPU_START", TraceMode.RESERVED)
1183+
1184+
def start_secondary(self, die, cluster, cpu):
1185+
self.log(f"Starting guest secondary {die}:{cluster}:{cpu}")
11821186

11831187
for node in list(self.adt["cpus"]):
1184-
if ((cluster << 8) | cpu) == node.reg:
1188+
if ((die << 11) | (cluster << 8) | cpu) == node.reg:
11851189
break
11861190
else:
11871191
self.log("CPU not found!")

0 commit comments

Comments
 (0)