From 593d9f53c558ebe5dbc6b1bae877f911f8f84e94 Mon Sep 17 00:00:00 2001 From: Maxim Baryshnikov Date: Thu, 12 May 2016 22:08:37 +0200 Subject: [PATCH] fiasco: Improved access to APIC through Jailhosue. Read and write instructions are the same as in Jailhouse (inmate.h). --- kernel/fiasco/src/kern/ia32/apic-ia32.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/fiasco/src/kern/ia32/apic-ia32.cpp b/kernel/fiasco/src/kern/ia32/apic-ia32.cpp index d60f003ae..5ddb75917 100644 --- a/kernel/fiasco/src/kern/ia32/apic-ia32.cpp +++ b/kernel/fiasco/src/kern/ia32/apic-ia32.cpp @@ -288,7 +288,9 @@ Unsigned32 Apic::reg_read(unsigned reg) { Unsigned32 val; - asm volatile ("mov %1,%0\n" : "=b" (val) : "m" (*(Unsigned32*)(io_base + reg)) : "memory"); + /* assembly-encoded to match the Jailhouse hypervisor MMIO parser support */ + void *address = (void*)(/*(Unsigned32*)*/(io_base + reg)); + asm volatile("mov (%1),%0" : "=r" (val) : "r" (address)); return val; } @@ -296,7 +298,9 @@ PUBLIC static inline void Apic::reg_write(unsigned reg, Unsigned32 val) { - asm volatile ("mov %1,%0\n" : "=m" (*(Unsigned32*)(io_base + reg)) : "b" (val) : "memory"); + /* assembly-encoded to match the Jailhouse hypervisor MMIO parser support */ + void *address = (void*)(/*(Unsigned32*)*/(io_base + reg)); + asm volatile("mov %0,(%1)" : : "r" (val), "r" (address)); } PUBLIC static inline -- 2.39.2