The header of jailhouse is defined with arch-dependent types such as
`unsigned long` which on linux varies in size. Because this header can
be considered the "communication"-relay with the environment, it should
be type-safe on any arch. Thus change all types into fixed-size-types.
Signed-off-by: Benjamin Block <bebl@mageta.org>
[Jan: adjusted jailhouse_entry to keep unsigned int]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
static void enter_hypervisor(void *info)
{
struct jailhouse_header *header = info;
+ jailhouse_entry entry = (jailhouse_entry)header->entry;
int err;
/* either returns 0 or the same error code across all CPUs */
- err = header->entry(smp_processor_id());
+ err = entry(smp_processor_id());
if (err)
error_code = err;
#ifndef _JAILHOUSE_ENTRY_H
#define _JAILHOUSE_ENTRY_H
-#include <jailhouse/header.h>
#include <asm/types.h>
+#include <jailhouse/header.h>
#include <jailhouse/cell-config.h>
#define JAILHOUSE_SIGNATURE "JAILHOUS"
+typedef int (*jailhouse_entry)(unsigned int);
+
struct jailhouse_header {
/* filled at build time */
- char signature[8];
- unsigned long core_size;
- unsigned long percpu_size;
- int (*entry)(unsigned int);
+ __u8 signature[8];
+ __u64 core_size;
+ __u64 percpu_size;
+
+ /* jailhouse_entry */
+ __u64 entry;
/* filled by loader */
- unsigned int max_cpus;
- unsigned int online_cpus;
+ __u32 max_cpus;
+ __u32 online_cpus;
};
.signature = JAILHOUSE_SIGNATURE,
.core_size = (unsigned long)__hv_core_end - JAILHOUSE_BASE,
.percpu_size = sizeof(struct per_cpu),
- .entry = arch_entry,
+ .entry = (unsigned long)arch_entry,
};