@@ -1,6 +1,6 @@
#include "kvm/kvm.h"
-void kvm__arch_validate_cfg(struct kvm *kvm)
+void kvm__arm_validate_cfg(struct kvm *kvm)
{
if (kvm->cfg.ram_size > ARM_LOMAP_MAX_MEMORY) {
die("RAM size 0x%llx exceeds maximum allowed 0x%llx",
@@ -10,7 +10,7 @@ u64 kvm__arch_default_ram_address(void)
return ARM_MEMORY_AREA;
}
-void kvm__arch_validate_cfg(struct kvm *kvm)
+void kvm__arm_validate_cfg(struct kvm *kvm)
{
if (kvm->cfg.arch.aarch32_guest &&
kvm->cfg.ram_size > ARM_LOMAP_MAX_MEMORY) {
@@ -88,6 +88,9 @@ static inline bool arm_addr_in_ioport_region(u64 phys_addr)
return phys_addr >= KVM_IOPORT_AREA && phys_addr < limit;
}
+struct kvm;
+void kvm__arm_validate_cfg(struct kvm *kvm);
+
struct kvm_arch {
/*
* We may have to align the guest memory for virtio, so keep the
@@ -31,6 +31,14 @@ int fw_addr_parser(const struct option *opt, const char *arg, int unset)
return 0;
}
+void kvm__arch_validate_cfg(struct kvm *kvm)
+{
+ if (kvm->cfg.arch.fw_addr && !kvm->cfg.firmware_filename)
+ die("--firmware-address is only valid when loading a firmware image");
+
+ kvm__arm_validate_cfg(kvm);
+}
+
bool kvm__arch_cpu_supports_vm(void)
{
/* The KVM capability check is enough. */
It makes little sense for the user to specify the firmware address when loading a kernel instead of a firmware image. Treat it as an error. Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> --- arm/aarch32/kvm.c | 2 +- arm/aarch64/kvm.c | 2 +- arm/include/arm-common/kvm-arch.h | 3 +++ arm/kvm.c | 8 ++++++++ 4 files changed, 13 insertions(+), 2 deletions(-)