]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
Revert "core: make the jailhouse-header arch-independent"
authorJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 Sep 2014 13:37:18 +0000 (15:37 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Thu, 25 Sep 2014 13:41:49 +0000 (15:41 +0200)
This reverts commit 17f8453876f8b143022278e6438c8ebb157d1821.

It turned out to break 32-bit architectures: At least core_size and
entry must be of the size the hypervisor uses for pointer, otherwise
link-time initialization of those fields fail.

We will need a more sophisticated solution if including the header in
i386 mode is really necessary.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
driver.c
hypervisor/include/jailhouse/entry.h
hypervisor/include/jailhouse/header.h
hypervisor/setup.c

index d47c7ee5ff753dd113b251a37aa4b14e7d884106..983764a1fbf37fef8ef367cc919a1cff9a3b5cfe 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -386,11 +386,10 @@ static void *jailhouse_ioremap(phys_addr_t phys, unsigned long virt,
 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 = entry(smp_processor_id());
+       err = header->entry(smp_processor_id());
        if (err)
                error_code = err;
 
index 3f7f431dc38198861ca43e6c214bd8a318a3d2a2..6e67454eb73aef538454a2701b89c75051a2cde6 100644 (file)
@@ -13,8 +13,8 @@
 #ifndef _JAILHOUSE_ENTRY_H
 #define _JAILHOUSE_ENTRY_H
 
-#include <asm/types.h>
 #include <jailhouse/header.h>
+#include <asm/types.h>
 
 #include <jailhouse/cell-config.h>
 
index 43b70b31ad3bf3691f795b378881cc7a75d1ab25..24c90a971e9a4a77679b78941ebc85cc6e06eb4f 100644 (file)
 
 #define JAILHOUSE_SIGNATURE    "JAILHOUS"
 
-typedef int (*jailhouse_entry)(unsigned int);
-
 struct jailhouse_header {
        /* filled at build time */
-       __u8    signature[8];
-       __u64   core_size;
-       __u64   percpu_size;
-
-       /* jailhouse_entry */
-       __u64   entry;
+       char signature[8];
+       unsigned long core_size;
+       unsigned long percpu_size;
+       int (*entry)(unsigned int);
 
        /* filled by loader */
-       __u32   max_cpus;
-       __u32   online_cpus;
+       unsigned int max_cpus;
+       unsigned int online_cpus;
 };
index aea0e929f418395e59bf921c81bf4701737a4b9c..c6a9932fdf768c9735876058fce49065d0b55e88 100644 (file)
@@ -206,5 +206,5 @@ hypervisor_header = {
        .signature = JAILHOUSE_SIGNATURE,
        .core_size = (unsigned long)__hv_core_end - JAILHOUSE_BASE,
        .percpu_size = sizeof(struct per_cpu),
-       .entry = (unsigned long)arch_entry,
+       .entry = arch_entry,
 };