Skip to content

Commit ebd4613

Browse files
committed
proxy: Add smp_call[_sync]_el1 variants
Signed-off-by: Hector Martin <[email protected]>
1 parent 254a2ac commit ebd4613

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

proxyclient/m1n1/proxy.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ class M1N1Proxy(Reloadable):
551551
P_SMP_SET_WFE_MODE = 0x504
552552
P_SMP_IS_ALIVE = 0x505
553553
P_SMP_STOP_SECONDARIES = 0x506
554+
P_SMP_CALL_EL1 = 0x507
555+
P_SMP_CALL_SYNC_EL1 = 0x508
554556

555557
P_HEAPBLOCK_ALLOC = 0x600
556558
P_MALLOC = 0x601
@@ -953,6 +955,14 @@ def smp_is_alive(self, cpu):
953955
return self.request(self.P_SMP_IS_ALIVE, cpu)
954956
def smp_stop_secondaries(self, deep_sleep=False):
955957
self.request(self.P_SMP_STOP_SECONDARIES, deep_sleep)
958+
def smp_call_el1(self, cpu, addr, *args):
959+
if len(args) > 3:
960+
raise ValueError("Too many arguments")
961+
self.request(self.P_SMP_CALL_EL1, cpu, addr, *args)
962+
def smp_call_sync_el1(self, cpu, addr, *args):
963+
if len(args) > 3:
964+
raise ValueError("Too many arguments")
965+
return self.request(self.P_SMP_CALL_SYNC_EL1, cpu, addr, *args)
956966

957967
def heapblock_alloc(self, size):
958968
return self.request(self.P_HEAPBLOCK_ALLOC, size)

src/proxy.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,15 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
348348
case P_SMP_IS_ALIVE:
349349
reply->retval = smp_is_alive(request->args[0]);
350350
break;
351+
case P_SMP_CALL_EL1:
352+
smp_call4(request->args[0], el1_call, request->args[1], request->args[2],
353+
request->args[3], request->args[4]);
354+
break;
355+
case P_SMP_CALL_EL1_SYNC:
356+
smp_call4(request->args[0], el1_call, request->args[1], request->args[2],
357+
request->args[3], request->args[4]);
358+
reply->retval = smp_wait(request->args[0]);
359+
break;
351360

352361
case P_HEAPBLOCK_ALLOC:
353362
reply->retval = (u64)heapblock_alloc(request->args[0]);

src/proxy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ typedef enum {
8686
P_SMP_SET_WFE_MODE,
8787
P_SMP_IS_ALIVE,
8888
P_SMP_STOP_SECONDARIES,
89+
P_SMP_CALL_EL1,
90+
P_SMP_CALL_EL1_SYNC,
8991

9092
P_HEAPBLOCK_ALLOC = 0x600, // Heap and memory management ops
9193
P_MALLOC,

0 commit comments

Comments
 (0)