@@ -24,7 +24,7 @@ bool kvm__arch_cpu_supports_vm(void)
return true;
}
-void kvm__init_ram(struct kvm *kvm)
+static void init_ram(struct kvm *kvm)
{
int err;
u64 phys_start, phys_size;
@@ -126,6 +126,8 @@ void kvm__arch_init(struct kvm *kvm)
/* Create the virtual GIC. */
if (gic__create(kvm, kvm->cfg.arch.irqchip))
die("Failed to create virtual GIC");
+
+ init_ram(kvm);
}
#define FDT_ALIGN SZ_2M
@@ -94,7 +94,6 @@ int kvm__init(struct kvm *kvm);
struct kvm *kvm__new(void);
int kvm__recommended_cpus(struct kvm *kvm);
int kvm__max_cpus(struct kvm *kvm);
-void kvm__init_ram(struct kvm *kvm);
int kvm__exit(struct kvm *kvm);
bool kvm__load_firmware(struct kvm *kvm, const char *firmware_filename);
bool kvm__load_kernel(struct kvm *kvm, const char *kernel_filename,
@@ -398,10 +398,8 @@ int kvm__init(struct kvm *kvm)
goto err_vm_fd;
}
- kvm__arch_init(kvm);
-
INIT_LIST_HEAD(&kvm->mem_banks);
- kvm__init_ram(kvm);
+ kvm__arch_init(kvm);
if (!kvm->cfg.firmware_filename) {
if (!kvm__load_kernel(kvm, kvm->cfg.kernel_filename,
@@ -17,7 +17,7 @@ void kvm__arch_read_term(struct kvm *kvm)
virtio_console__inject_interrupt(kvm);
}
-void kvm__init_ram(struct kvm *kvm)
+static void init_ram(struct kvm *kvm)
{
u64 phys_start, phys_size;
void *host_mem;
@@ -80,6 +80,8 @@ void kvm__arch_init(struct kvm *kvm)
ret = ioctl(kvm->vm_fd, KVM_CREATE_IRQCHIP);
if (ret < 0)
die_perror("KVM_CREATE_IRQCHIP ioctl");
+
+ init_ram(kvm);
}
void kvm__irq_line(struct kvm *kvm, int irq, int level)
@@ -60,7 +60,7 @@ bool kvm__arch_cpu_supports_vm(void)
return true;
}
-void kvm__init_ram(struct kvm *kvm)
+static void init_ram(struct kvm *kvm)
{
u64 phys_start, phys_size;
void *host_mem;
@@ -144,6 +144,8 @@ void kvm__arch_init(struct kvm *kvm)
SPAPR_PCI_MEM_WIN_SIZE,
SPAPR_PCI_IO_WIN_ADDR,
SPAPR_PCI_IO_WIN_SIZE);
+
+ init_ram(kvm);
}
void kvm__arch_delete_ram(struct kvm *kvm)
@@ -86,7 +86,7 @@ bool kvm__arch_cpu_supports_vm(void)
* a gap between 0xe0000000 and 0x100000000 in the guest virtual mem space.
*/
-void kvm__init_ram(struct kvm *kvm)
+static void init_ram(struct kvm *kvm)
{
u64 phys_start, phys_size;
void *host_mem;
@@ -165,7 +165,7 @@ void kvm__arch_init(struct kvm *kvm)
kvm->ram_size = ram_size + KVM_32BIT_GAP_SIZE;
if (kvm->ram_start != MAP_FAILED)
/*
- * We mprotect the gap (see kvm__init_ram() for details) PROT_NONE so that
+ * We mprotect the gap (see init_ram() for details) PROT_NONE so that
* if we accidently write to it, we will know.
*/
mprotect(kvm->ram_start + KVM_32BIT_GAP_START, KVM_32BIT_GAP_SIZE, PROT_NONE);
@@ -178,6 +178,8 @@ void kvm__arch_init(struct kvm *kvm)
ret = ioctl(kvm->vm_fd, KVM_CREATE_IRQCHIP);
if (ret < 0)
die_perror("KVM_CREATE_IRQCHIP ioctl");
+
+ init_ram(kvm);
}
void kvm__arch_delete_ram(struct kvm *kvm)