proxy: Add EL0 SMP ops

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2024-04-09 09:17:56 +09:00
parent 3b9a71422e
commit af6ca83187
3 changed files with 21 additions and 0 deletions

View file

@ -558,6 +558,8 @@ class M1N1Proxy(Reloadable):
P_SMP_STOP_SECONDARIES = 0x506
P_SMP_CALL_EL1 = 0x507
P_SMP_CALL_SYNC_EL1 = 0x508
P_SMP_CALL_EL0 = 0x509
P_SMP_CALL_SYNC_EL0 = 0x50a
P_HEAPBLOCK_ALLOC = 0x600
P_MALLOC = 0x601
@ -970,6 +972,14 @@ class M1N1Proxy(Reloadable):
if len(args) > 3:
raise ValueError("Too many arguments")
return self.request(self.P_SMP_CALL_SYNC_EL1, cpu, addr, *args)
def smp_call_el0(self, cpu, addr, *args):
if len(args) > 3:
raise ValueError("Too many arguments")
self.request(self.P_SMP_CALL_EL0, cpu, addr, *args)
def smp_call_sync_el0(self, cpu, addr, *args):
if len(args) > 3:
raise ValueError("Too many arguments")
return self.request(self.P_SMP_CALL_SYNC_EL0, cpu, addr, *args)
def heapblock_alloc(self, size):
return self.request(self.P_HEAPBLOCK_ALLOC, size)

View file

@ -358,6 +358,15 @@ int proxy_process(ProxyRequest *request, ProxyReply *reply)
request->args[3], request->args[4]);
reply->retval = smp_wait(request->args[0]);
break;
case P_SMP_CALL_EL0:
smp_call4(request->args[0], el0_call, request->args[1], request->args[2],
request->args[3], request->args[4]);
break;
case P_SMP_CALL_EL0_SYNC:
smp_call4(request->args[0], el0_call, request->args[1], request->args[2],
request->args[3], request->args[4]);
reply->retval = smp_wait(request->args[0]);
break;
case P_HEAPBLOCK_ALLOC:
reply->retval = (u64)heapblock_alloc(request->args[0]);

View file

@ -88,6 +88,8 @@ typedef enum {
P_SMP_STOP_SECONDARIES,
P_SMP_CALL_EL1,
P_SMP_CALL_EL1_SYNC,
P_SMP_CALL_EL0,
P_SMP_CALL_EL0_SYNC,
P_HEAPBLOCK_ALLOC = 0x600, // Heap and memory management ops
P_MALLOC,