MCPcopy Create free account
hub / github.com/IBM/ACE-RISCV / ace_init

Function ace_init

confidential-vms/linux_vm/overlay/root/ace_module/ace.c:15–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13MODULE_AUTHOR("Wojciech Ozga <woz@zurich.ibm.com>");
14
15static int ace_init(void){
16 volatile u8 *secret;
17 struct sbiret ret;
18 int i;
19
20 printk(KERN_ALERT "Requesting secret from the security monitor\n");
21 secret = kmalloc(1024*sizeof(u8), GFP_KERNEL);
22 ret = sbi_ecall(0x434F5647, 9, virt_to_phys((void *) secret), 1024, 0, 0, 0, 0);
23 if (!ret.error) {
24 printk(KERN_ALERT "Secret=0x");
25 for (i=0; i<ret.value; i++) {
26 printk(KERN_CONT "%02x", secret[i]);
27 }
28 printk(KERN_CONT "\n");
29 } else {
30 printk(KERN_ALERT "Error: %lx %lx", ret.error, ret.value);
31 }
32 return 0;
33}
34
35static void ace_exit(void){
36}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected