This patch finally allows us to run inmates on bare metal, without Linux
and without Jailhouse.

This is useful, for comparing inmate behaviour, with and without an
active hypervisor.

>From now on, inmates can be loaded from u-boot when defining
CONFIG_INMATE_BASE and CONFIG_BARE_METAL.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 inmates/lib/arm/include/arch/inmate.h   | 4 ++++
 inmates/lib/arm64/include/arch/inmate.h | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/inmates/lib/arm/include/arch/inmate.h 
b/inmates/lib/arm/include/arch/inmate.h
index 02f0a8e3..4916ed65 100644
--- a/inmates/lib/arm/include/arch/inmate.h
+++ b/inmates/lib/arm/include/arch/inmate.h
@@ -14,6 +14,9 @@
  * To ease the debugging, we can send a spurious hypercall, which should return
  * -ENOSYS, but appear in the hypervisor stats for this cell.
  */
+#ifdef CONFIG_BARE_METAL
+#define heartbeat()
+#else
 static inline void heartbeat(void)
 {
        asm volatile (
@@ -22,5 +25,6 @@ static inline void heartbeat(void)
        "hvc    #0\n"
        : : "r" (0xbea7) : "r0");
 }
+#endif
 
 void __attribute__((interrupt("IRQ"), used)) vector_irq(void);
diff --git a/inmates/lib/arm64/include/arch/inmate.h 
b/inmates/lib/arm64/include/arch/inmate.h
index cd9275dd..dd9d6d9d 100644
--- a/inmates/lib/arm64/include/arch/inmate.h
+++ b/inmates/lib/arm64/include/arch/inmate.h
@@ -14,6 +14,9 @@
  * To ease the debugging, we can send a spurious hypercall, which should return
  * -ENOSYS, but appear in the hypervisor stats for this cell.
  */
+#ifdef CONFIG_BARE_METAL
+#define heartbeat()
+#else
 static inline void heartbeat(void)
 {
        asm volatile (
@@ -21,5 +24,6 @@ static inline void heartbeat(void)
        "hvc    #0\n"
        : : "r" (0xbea7) : "x0");
 }
+#endif
 
 void __attribute__((used)) vector_irq(void);
-- 
2.12.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to