@@ -167,6 +167,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
@@ -583,4 +584,4 @@ ifneq ($(MAKECMDGOALS),clean)
KVMTOOLS-VERSION-FILE:
@$(SHELL_PATH) util/KVMTOOLS-VERSION-GEN $(OUTPUT)
-endif
\ No newline at end of file
+endif
new file mode 100644
@@ -0,0 +1,5 @@
+#include "kvm/kvm.h"
+
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
@@ -5,6 +5,10 @@
#include <linux/byteorder.h>
#include <kvm/util.h>
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
+
/*
* Return the TEXT_OFFSET value that the guest kernel expects. Note
* that pre-3.17 kernels expose this value using the native endianness
@@ -531,6 +531,8 @@ static void kvm_run_validate_cfg(struct kvm *kvm)
(unsigned long long)available_ram >> MB_SHIFT);
}
}
+
+ kvm__arch_validate_cfg(kvm);
}
static struct kvm *kvm_cmd_run_init(int argc, const char **argv)
@@ -187,6 +187,7 @@ int kvm__get_sock_by_instance(const char *name);
int kvm__enumerate_instances(int (*callback)(const char *name, int pid));
void kvm__remove_socket(const char *name);
+void kvm__arch_validate_cfg(struct kvm *kvm);
void kvm__arch_set_cmdline(char *cmdline, bool video);
void kvm__arch_init(struct kvm *kvm, const char *hugetlbfs_path, u64 ram_size);
void kvm__arch_delete_ram(struct kvm *kvm);
@@ -12,6 +12,10 @@ struct kvm_ext kvm_req_ext[] = {
{ 0, 0 }
};
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
+
void kvm__arch_read_term(struct kvm *kvm)
{
virtio_console__inject_interrupt(kvm);
@@ -48,6 +48,10 @@ struct kvm_ext kvm_req_ext[] = {
{ 0, 0 }
};
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
+
static uint32_t mfpvr(void)
{
uint32_t r;
@@ -13,6 +13,10 @@ struct kvm_ext kvm_req_ext[] = {
{ 0, 0 },
};
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
+
bool kvm__arch_cpu_supports_vm(void)
{
/* The KVM capability check is enough. */
@@ -35,6 +35,10 @@ struct kvm_ext kvm_req_ext[] = {
{ 0, 0 }
};
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+}
+
bool kvm__arch_cpu_supports_vm(void)
{
struct cpuid_regs regs;
Architectures are free to set their own command line options. Add an architecture specific hook to validate these options. For now, the hook does nothing, but it will be used in later patches. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- Makefile | 3 ++- arm/aarch32/kvm.c | 5 +++++ arm/aarch64/kvm.c | 4 ++++ builtin-run.c | 2 ++ include/kvm/kvm.h | 1 + mips/kvm.c | 4 ++++ powerpc/kvm.c | 4 ++++ riscv/kvm.c | 4 ++++ x86/kvm.c | 4 ++++ 9 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 arm/aarch32/kvm.c