@@ -165,6 +165,7 @@ ifeq ($(ARCH), arm)
OBJS += $(OBJS_ARM_COMMON)
OBJS += arm/aarch32/arm-cpu.o
OBJS += arm/aarch32/kvm-cpu.o
+ OBJS += arm/aarch32/kvm.o
ARCH_INCLUDE := $(HDRS_ARM_COMMON)
ARCH_INCLUDE += -Iarm/aarch32/include
CFLAGS += -march=armv7-a
new file mode 100644
@@ -0,0 +1,8 @@
+#include "kvm/kvm.h"
+
+#include <sys/mman.h>
+
+void kvm__arch_delete_ram(struct kvm *kvm)
+{
+ munmap(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size);
+}
@@ -1,6 +1,7 @@
#include "kvm/kvm.h"
#include <asm/image.h>
+#include <sys/mman.h>
#include <linux/byteorder.h>
@@ -46,3 +47,7 @@ fail:
return 0x80000;
}
+void kvm__arch_delete_ram(struct kvm *kvm)
+{
+ munmap(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size);
+}
@@ -42,11 +42,6 @@ void kvm__init_ram(struct kvm *kvm)
kvm->arch.memory_guest_start = phys_start;
}
-void kvm__arch_delete_ram(struct kvm *kvm)
-{
- munmap(kvm->arch.ram_alloc_start, kvm->arch.ram_alloc_size);
-}
-
void kvm__arch_read_term(struct kvm *kvm)
{
serial8250__update_consoles(kvm);
Move kvm__arch_delete_ram() into aarch32 and aarch64 specific locations. The function is kept identical between the two architectures, but adding KVM SPE support will mean making changes to the aarch64 version of the function to unlock the guest memory on virtual machine tear down. No functional change intended. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- Makefile | 1 + arm/aarch32/kvm.c | 8 ++++++++ arm/aarch64/kvm.c | 5 +++++ arm/kvm.c | 5 ----- 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 arm/aarch32/kvm.c