socsvn commit: r287842 - in soc2015/mihai/bhyve-on-arm-head/sys: arm/include arm/vmm modules/vmm-arm
mihai at FreeBSD.org
mihai at FreeBSD.org
Thu Jul 2 13:47:18 UTC 2015
Author: mihai
Date: Thu Jul 2 13:47:14 2015
New Revision: 287842
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287842
Log:
soc2015: mihai: bhyve-on-arm: sys: arm: vmm: add memory management support - wired
Added:
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.c
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.h
Modified:
soc2015/mihai/bhyve-on-arm-head/sys/arm/include/vmm.h
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.c
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.h
soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm.c
soc2015/mihai/bhyve-on-arm-head/sys/modules/vmm-arm/Makefile
Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/include/vmm.h
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/include/vmm.h Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/include/vmm.h Thu Jul 2 13:47:14 2015 (r287842)
@@ -127,6 +127,11 @@
struct pmap *pmap, void *rendezvous_cookie,
void *suspend_cookie);
typedef void (*vmi_cleanup_func_t)(void *vmi);
+typedef int (*vmi_mmap_set_func_t)(void *vmi, uint64_t gpa,
+ uint64_t hpa, size_t length,
+ int prot);
+typedef uint64_t (*vmi_mmap_get_func_t)(void *vmi, uint64_t ipa);
+
typedef int (*vmi_get_register_t)(void *vmi, int vcpu, int num,
uint64_t *retval);
typedef int (*vmi_set_register_t)(void *vmi, int vcpu, int num,
@@ -150,6 +155,8 @@
vmi_init_func_t vminit; /* vm-specific initialization */
vmi_run_func_t vmrun;
vmi_cleanup_func_t vmcleanup;
+ vmi_mmap_set_func_t vmmapset;
+ vmi_mmap_get_func_t vmmapget;
vmi_get_register_t vmgetreg;
vmi_set_register_t vmsetreg;
vmi_get_desc_t vmgetdesc;
@@ -203,7 +210,7 @@
int vm_get_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state *state);
int vm_set_x2apic_state(struct vm *vm, int vcpu, enum x2apic_state state);
int vm_apicid2vcpuid(struct vm *vm, int apicid);
-int vm_activate_cpu(struct vm *vm, int vcpu);
+void vm_activate_cpu(struct vm *vm, int vcpu);
struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid);
void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip);
void vm_exit_rendezvous(struct vm *vm, int vcpuid, uint64_t rip);
Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/arm.c Thu Jul 2 13:47:14 2015 (r287842)
@@ -259,6 +259,8 @@
arm_vminit,
arm_vmrun,
arm_vmcleanup,
+ lpae_vmmmap_set,
+ NULL,
arm_getreg,
arm_setreg,
NULL, /* vmi_get_desc_t */
Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.c
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.c Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.c Thu Jul 2 13:47:14 2015 (r287842)
@@ -179,10 +179,10 @@
}
}
int lpae_vmmmap_set(void *arg,
- lpae_vm_vaddr_t virt_start,
- lpae_vm_paddr_t phys_start,
+ uint64_t virt_start,
+ uint64_t phys_start,
size_t len,
- vm_prot_t prot)
+ int prot)
{
size_t n;
struct hyp *vm_hyp;
Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.h
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.h Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/mmu.h Thu Jul 2 13:47:14 2015 (r287842)
@@ -5,13 +5,13 @@
typedef uint64_t lpae_pt_entry_t; /* LPAE page table entry */
typedef uint64_t lpae_vm_paddr_t; /* LPAE VM paddr */
-typedef uint32_t lpae_vm_vaddr_t; /* LPAE VM vaddr */
+typedef uint64_t lpae_vm_vaddr_t; /* LPAE VM vaddr */
int lpae_vmmmap_set(void *arg,
- lpae_vm_vaddr_t virt_start,
- lpae_vm_paddr_t phys_start,
+ uint64_t virt_start,
+ uint64_t phys_start,
size_t len,
- vm_prot_t prot);
+ int prot);
void lpae_vmcleanup(void *arg);
void dump_lpae_mapping(void *arg);
Modified: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm.c
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm.c Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm.c Thu Jul 2 13:47:14 2015 (r287842)
@@ -33,27 +33,16 @@
#include <machine/vmm_dev.h>
#include "vmm_stat.h"
+#include "vmm_mem.h"
-/*
- * Initialization:
- * (a) allocated when vcpu is created
- * (i) initialized when vcpu is created and when it is reinitialized
- * (o) initialized the first time the vcpu is created
- * (x) initialized before use
- */
struct vcpu {
- struct mtx mtx; /* (o) protects 'state' and 'hostcpu' */
- enum vcpu_state state; /* (o) vcpu state */
- int hostcpu; /* (o) vcpu's host cpu */
- uint64_t exitintinfo; /* (i) events pending at VM exit */
- int nmi_pending; /* (i) NMI pending */
- int extint_pending; /* (i) INTR pending */
- int exception_pending; /* (i) exception pending */
- int exc_vector; /* (x) exception collateral */
- int exc_errcode_valid;
- uint32_t exc_errcode;
- void *stats; /* (a,i) statistics */
- struct vm_exit exitinfo; /* (x) exit reason and collateral */
+ int flags;
+ enum vcpu_state state;
+ struct mtx mtx;
+ int hostcpu; /* host cpuid this vcpu last ran on */
+ int vcpuid;
+ void *stats;
+ struct vm_exit exitinfo;
uint64_t nextrip; /* (x) next instruction to execute */
};
@@ -71,52 +60,39 @@
};
#define VM_MAX_MEMORY_SEGMENTS 2
-/*
- * Initialization:
- * (o) initialized the first time the VM is created
- * (i) initialized when VM is created and when it is reinitialized
- * (x) initialized before use
- */
struct vm {
- void *cookie; /* (i) cpu-specific data */
- void *iommu; /* (x) iommu-specific data */
- struct vhpet *vhpet; /* (i) virtual HPET */
- struct vioapic *vioapic; /* (i) virtual ioapic */
- struct vatpic *vatpic; /* (i) virtual atpic */
- struct vatpit *vatpit; /* (i) virtual atpit */
- struct vpmtmr *vpmtmr; /* (i) virtual ACPI PM timer */
- struct vrtc *vrtc; /* (o) virtual RTC */
- volatile cpuset_t active_cpus; /* (i) active vcpus */
- int suspend; /* (i) stop VM execution */
- volatile cpuset_t suspended_cpus; /* (i) suspended vcpus */
- volatile cpuset_t halted_cpus; /* (x) cpus in a hard halt */
- cpuset_t rendezvous_req_cpus; /* (x) rendezvous requested */
- cpuset_t rendezvous_done_cpus; /* (x) rendezvous finished */
- void *rendezvous_arg; /* (x) rendezvous func/arg */
- vm_rendezvous_func_t rendezvous_func;
- struct mtx rendezvous_mtx; /* (o) rendezvous lock */
- int num_mem_segs; /* (o) guest memory segments */
- struct mem_seg mem_segs[VM_MAX_MEMORY_SEGMENTS];
- struct vmspace *vmspace; /* (o) guest's address space */
- char name[VM_MAX_NAMELEN]; /* (o) virtual machine name */
- struct vcpu vcpu[VM_MAXCPU]; /* (i) guest vcpus */
+ void *cookie; /* processor-specific data */
+ void *iommu; /* iommu-specific data */
+ struct vcpu vcpu[VM_MAXCPU];
+ int num_mem_segs;
+ struct vm_memory_segment mem_segs[VM_MAX_MEMORY_SEGMENTS];
+ char name[VM_MAX_NAMELEN];
+
+ /*
+ * Set of active vcpus.
+ * An active vcpu is one that has been started implicitly (BSP) or
+ * explicitly (AP) by sending it a startup ipi.
+ */
+ cpuset_t active_cpus;
};
+
static int vmm_initialized;
static struct vmm_ops *ops;
#define VMM_INIT(num) (ops != NULL ? (*ops->init)(num) : 0)
#define VMM_CLEANUP() (ops != NULL ? (*ops->cleanup)() : 0)
-#define VMM_RESUME() (ops != NULL ? (*ops->resume)() : 0)
-#define VMINIT(vm, pmap) (ops != NULL ? (*ops->vminit)(vm, pmap): NULL)
+#define VMINIT(vm) (ops != NULL ? (*ops->vminit)(vm, NULL): NULL)
#define VMRUN(vmi, vcpu, rip, pmap, rptr, sptr) \
(ops != NULL ? (*ops->vmrun)(vmi, vcpu, rip, pmap, rptr, sptr) : ENXIO)
#define VMCLEANUP(vmi) (ops != NULL ? (*ops->vmcleanup)(vmi) : NULL)
-#define VMSPACE_ALLOC(min, max) \
- (ops != NULL ? (*ops->vmspace_alloc)(min, max) : NULL)
-#define VMSPACE_FREE(vmspace) \
- (ops != NULL ? (*ops->vmspace_free)(vmspace) : ENXIO)
+#define VMMMAP_SET(vmi, gpa, hpa, len, attr, prot, spm) \
+ (ops != NULL ? \
+ (*ops->vmmmap_set)(vmi, gpa, hpa, len, attr, prot, spm) : \
+ ENXIO)
+#define VMMMAP_GET(vmi, gpa) \
+ (ops != NULL ? (*ops->vmmmap_get)(vmi, gpa) : ENXIO)
#define VMGETREG(vmi, vcpu, num, retval) \
(ops != NULL ? (*ops->vmgetreg)(vmi, vcpu, num, retval) : ENXIO)
#define VMSETREG(vmi, vcpu, num, val) \
@@ -129,10 +105,6 @@
(ops != NULL ? (*ops->vmgetcap)(vmi, vcpu, num, retval) : ENXIO)
#define VMSETCAP(vmi, vcpu, num, val) \
(ops != NULL ? (*ops->vmsetcap)(vmi, vcpu, num, val) : ENXIO)
-#define VLAPIC_INIT(vmi, vcpu) \
- (ops != NULL ? (*ops->vlapic_init)(vmi, vcpu) : NULL)
-#define VLAPIC_CLEANUP(vmi, vlapic) \
- (ops != NULL ? (*ops->vlapic_cleanup)(vmi, vlapic) : NULL)
#define fpu_start_emulating() load_cr0(rcr0() | CR0_TS)
#define fpu_stop_emulating() clts()
@@ -168,31 +140,16 @@
// struct vcpu *vcpu = &vm->vcpu[i];
}
-
static void
-vcpu_init(struct vm *vm, int vcpu_id, bool create)
+vcpu_init(struct vm *vm, uint32_t vcpu_id)
{
struct vcpu *vcpu;
-
- KASSERT(vcpu_id >= 0 && vcpu_id < VM_MAXCPU,
- ("vcpu_init: invalid vcpu %d", vcpu_id));
-
+
vcpu = &vm->vcpu[vcpu_id];
- if (create) {
- KASSERT(!vcpu_lock_initialized(vcpu), ("vcpu %d already "
- "initialized", vcpu_id));
- vcpu_lock_init(vcpu);
- vcpu->state = VCPU_IDLE;
- vcpu->hostcpu = NOCPU;
- }
-
-}
-
-static void
-vmm_resume(void)
-{
- VMM_RESUME();
+ vcpu_lock_init(vcpu);
+ vcpu->hostcpu = NOCPU;
+ vcpu->vcpuid = vcpu_id;
}
static int
@@ -248,28 +205,14 @@
DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY);
MODULE_VERSION(vmm, 1);
-static void
-vm_init(struct vm *vm, bool create)
-{
- int i;
-
- vm->cookie = VMINIT(vm, vmspace_pmap(vm->vmspace));
- vm->iommu = NULL;
-
- CPU_ZERO(&vm->active_cpus);
-
- vm->suspend = 0;
- CPU_ZERO(&vm->suspended_cpus);
-
- for (i = 0; i < VM_MAXCPU; i++)
- vcpu_init(vm, i, create);
-}
-
int
vm_create(const char *name, struct vm **retvm)
{
+ int i;
struct vm *vm;
- struct vmspace *vmspace;
+ vm_paddr_t maxaddr;
+
+ const int BSP = 0;
/*
* If vmm.ko could not be successfully initialized then don't attempt
@@ -281,32 +224,25 @@
if (name == NULL || strlen(name) >= VM_MAX_NAMELEN)
return (EINVAL);
- vmspace = VMSPACE_ALLOC(0, VM_MAXUSER_ADDRESS);
- if (vmspace == NULL)
- return (ENOMEM);
-
vm = malloc(sizeof(struct vm), M_VM, M_WAITOK | M_ZERO);
strcpy(vm->name, name);
- vm->num_mem_segs = 0;
- vm->vmspace = vmspace;
- mtx_init(&vm->rendezvous_mtx, "vm rendezvous lock", 0, MTX_DEF);
+ vm->cookie = VMINIT(vm);
- vm_init(vm, true);
+ for (i = 0; i < VM_MAXCPU; i++) {
+ vcpu_init(vm, i);
+ }
+
+ maxaddr = vmm_mem_maxaddr();
+ vm_activate_cpu(vm, BSP);
*retvm = vm;
return (0);
}
-
static void
vm_cleanup(struct vm *vm, bool destroy)
{
VMCLEANUP(vm->cookie);
-
- if (destroy) {
- VMSPACE_FREE(vm->vmspace);
- vm->vmspace = NULL;
- }
}
void
@@ -316,25 +252,6 @@
free(vm, M_VM);
}
-int
-vm_reinit(struct vm *vm)
-{
- int error;
-
- /*
- * A virtual machine can be reset only if all vcpus are suspended.
- */
- if (CPU_CMP(&vm->suspended_cpus, &vm->active_cpus) == 0) {
- vm_cleanup(vm, false);
- vm_init(vm, false);
- error = 0;
- } else {
- error = EBUSY;
- }
-
- return (error);
-}
-
const char *
vm_name(struct vm *vm)
{
@@ -348,7 +265,6 @@
struct vcpu *vcpu;
struct vm_exit *vme;
bool retu;
- pmap_t pmap;
void *rptr = NULL, *sptr = NULL;
vcpuid = vmrun->cpuid;
@@ -359,19 +275,12 @@
if (!CPU_ISSET(vcpuid, &vm->active_cpus))
return (EINVAL);
- if (CPU_ISSET(vcpuid, &vm->suspended_cpus))
- return (EINVAL);
-
- pmap = vmspace_pmap(vm->vmspace);
vcpu = &vm->vcpu[vcpuid];
vme = &vcpu->exitinfo;
restart:
critical_enter();
- KASSERT(!CPU_ISSET(curcpu, &pmap->pm_active),
- ("vm_run: absurd pm_active"));
-
- error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, pmap, rptr, sptr);
+ error = VMRUN(vm->cookie, vcpuid, vcpu->nextrip, NULL, rptr, sptr);
critical_exit();
@@ -392,19 +301,19 @@
return (error);
}
-
-cpuset_t
-vm_active_cpus(struct vm *vm)
+void
+vm_activate_cpu(struct vm *vm, int vcpuid)
{
- return (vm->active_cpus);
+ if (vcpuid >= 0 && vcpuid < VM_MAXCPU)
+ CPU_SET(vcpuid, &vm->active_cpus);
}
cpuset_t
-vm_suspended_cpus(struct vm *vm)
+vm_active_cpus(struct vm *vm)
{
- return (vm->suspended_cpus);
+ return (vm->active_cpus);
}
void *
Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.c Thu Jul 2 13:47:14 2015 (r287842)
@@ -0,0 +1,135 @@
+/*-
+ * Copyright (c) 2011 NetApp, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/sys/amd64/vmm/vmm_mem.c 245678 2013-01-20 03:42:49Z neel $
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD: head/sys/amd64/vmm/vmm_mem.c 245678 2013-01-20 03:42:49Z neel $");
+
+#include <sys/param.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/linker.h>
+#include <sys/systm.h>
+#include <sys/malloc.h>
+#include <sys/kernel.h>
+#include <sys/sysctl.h>
+#include <sys/vmmeter.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pageout.h>
+
+#include <machine/md_var.h>
+#include <machine/metadata.h>
+#include <machine/vmparam.h>
+#include <machine/pmap.h>
+
+#include "vmm_mem.h"
+
+SYSCTL_DECL(_hw_vmm);
+
+static u_long pages_allocated;
+SYSCTL_ULONG(_hw_vmm, OID_AUTO, pages_allocated, CTLFLAG_RD,
+ &pages_allocated, 0, "4KB pages allocated");
+
+static void
+update_pages_allocated(int howmany)
+{
+ pages_allocated += howmany; /* XXX locking? */
+}
+
+int
+vmm_mem_init(void)
+{
+
+ return (0);
+}
+
+vm_paddr_t
+vmm_mem_alloc(size_t size)
+{
+
+ int flags;
+ vm_page_t m;
+ vm_paddr_t pa;
+
+ if (size != PAGE_SIZE)
+ panic("vmm_mem_alloc: invalid allocation size %zu", size);
+
+ flags = VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED |
+ VM_ALLOC_ZERO;
+
+ while (1) {
+ /*
+ * XXX need policy to determine when to back off the allocation
+ */
+ m = vm_page_alloc(NULL, 0, flags);
+ if (m == NULL)
+ VM_WAIT;
+ else
+ break;
+ }
+
+ pa = VM_PAGE_TO_PHYS(m);
+
+// if ((m->flags & PG_ZERO) == 0)
+// pagezero((void *)PHYS_TO_DMAP(pa));
+
+ m->valid = VM_PAGE_BITS_ALL;
+ update_pages_allocated(1);
+
+ return (pa);
+}
+
+void
+vmm_mem_free(vm_paddr_t base, size_t length)
+{
+ vm_page_t m;
+
+ if (base & PAGE_MASK) {
+ panic("vmm_mem_free: base 0x%0x must be aligned on a "
+ "0x%0x boundary\n", base, PAGE_SIZE);
+ }
+
+ if (length != PAGE_SIZE)
+ panic("vmm_mem_free: invalid length %zu", length);
+
+ m = PHYS_TO_VM_PAGE(base);
+ m->wire_count--;
+ vm_page_free(m);
+ atomic_subtract_int(&vm_cnt.v_wire_count, 1);
+
+ update_pages_allocated(-1);
+}
+
+vm_paddr_t
+vmm_mem_maxaddr(void)
+{
+
+ return (ptoa(Maxmem));
+}
Added: soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.h
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ soc2015/mihai/bhyve-on-arm-head/sys/arm/vmm/vmm_mem.h Thu Jul 2 13:47:14 2015 (r287842)
@@ -0,0 +1,37 @@
+/*-
+ * Copyright (c) 2011 NetApp, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY NETAPP, INC ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL NETAPP, INC OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/sys/amd64/vmm/vmm_mem.h 245678 2013-01-20 03:42:49Z neel $
+ */
+
+#ifndef _VMM_MEM_H_
+#define _VMM_MEM_H_
+
+int vmm_mem_init(void);
+vm_paddr_t vmm_mem_alloc(size_t size);
+void vmm_mem_free(vm_paddr_t start, size_t size);
+vm_paddr_t vmm_mem_maxaddr(void);
+
+#endif
Modified: soc2015/mihai/bhyve-on-arm-head/sys/modules/vmm-arm/Makefile
==============================================================================
--- soc2015/mihai/bhyve-on-arm-head/sys/modules/vmm-arm/Makefile Thu Jul 2 12:53:22 2015 (r287841)
+++ soc2015/mihai/bhyve-on-arm-head/sys/modules/vmm-arm/Makefile Thu Jul 2 13:47:14 2015 (r287842)
@@ -11,6 +11,7 @@
.PATH: ${.CURDIR}/../../arm/vmm
SRCS+= vmm.c \
vmm_dev.c \
+ vmm_mem.c \
mmu.c \
vmm_stat.c \
arm.c \
More information about the svn-soc-all
mailing list