4 The Jailhouse hypervisor is started by performing the following steps:
6 - map physical memory region reserved for Jailhouse at fixed virtual address
7 JAILHOUSE_BASE (definition available via jailhouse/hypercall.h)
9 - load its binary image at beginning of hypervisor memory region
11 - load system configuration [1] at its target address in hypervisor memory
14 - set "Number of Possible CPUs" and "Number of Online CPUs" in hypervisor
15 header according to system state
17 - initialize remaining hypervisor memory to zero
19 - on each online CPU, call function at address stored in "Initialization
20 Function" hypervisor header field
26 The hypervisor binary image starts with a header structure as defined in the
27 following. Its first part is preset during the build process of the hypervisor
28 core. The second part needs to be filled by the Linux driver that loads
35 +------------------------------+ - begin of hypervisor header
36 | Signature "JAILHOUS" | (lower address)
38 +------------------------------+
39 | Hypervisor Core Size |
41 +------------------------------+
42 | Per-CPU Data Structure Size |
44 +------------------------------+
45 | Address of Initialization |
46 | Function (pointer) | preset in binary image
47 +------------------------------+ - - - - - - - - - - - - - - - - -
48 | Number of Possible CPUs | set by driver while loading
50 +------------------------------+
51 | Number of Online CPUs |
53 +------------------------------+ - higher address
55 All fields use the native endianness of the system.
61 Hypervisor Core Size - size of hypervisor core, starting with its
62 header, ending after its bss section [2]
63 Per-CPU Data Structure Size - size of data structure used for a single
65 Address of Initialization Function - virtual address of initialization
67 Number of Possible CPUs - 0 to possible CPUs - 1 defines the range
68 of CPU ID that can be passed as argument
69 to the initialization function
70 Number of Online CPUs - defines the number of CPUs the
71 initialization function will expect
74 Hypervisor Initialization Function
75 ----------------------------------
77 The initialization function has to be called on each online CPU in order to
78 hand over control of the system to Jailhouse. Jailhouse will wait for as many
79 CPUs as specified in the "Number of Online CPUs" header field and will not
80 return from the function until all started the initialization. CPUs not
81 initialized during hypervisor activation cannot be used by any cell until
82 Jailhouse is deactivated again.
84 Prototype: int entry(unsigned int cpu_id)
86 Calling convention: as used by Linux kernel on target architecture
88 Arguments: cpu_id - unique logical ID of caller's CPU
90 Return code: 0 on success, negative error code otherwise
93 -EIO (-5) - lacking hardware capabilities or unsupported hardware
94 state (as configured by Linux)
95 -ENOMEM (-12) - insufficient hypervisor-internal memory
96 -EBUSY (-16) - a required hardware resource is already in use
97 -ENODEV (-19) - CPU or I/O virtualization unit missing
98 -EINVAL (-22) - invalid system configuration
99 -ERANGE (-34) - a resource ID is out of supported range
101 The initialization function will always return the same code on all CPUs for a
102 single initialization attempt.
108 [1] Documentation/configuration-format.txt
109 [2] Documentation/memory-layout.txt