svn commit: r241179 - in projects/bhyve: lib/libvmmapi usr.sbin/vmmctl

Neel Natu neel at FreeBSD.org
Thu Oct 4 03:07:06 UTC 2012


Author: neel
Date: Thu Oct  4 03:07:05 2012
New Revision: 241179
URL: http://svn.freebsd.org/changeset/base/241179

Log:
  The ioctl VM_GET_MEMORY_SEG is no longer able to return the host physical
  address associated with the guest memory segment. This is because there is
  no longer a 1:1 mapping between GPA and HPA.
  
  As a result 'vmmctl' can only display the guest physical address and the
  length of the lowmem and highmem segments.

Modified:
  projects/bhyve/lib/libvmmapi/vmmapi.c
  projects/bhyve/lib/libvmmapi/vmmapi.h
  projects/bhyve/usr.sbin/vmmctl/vmmctl.c

Modified: projects/bhyve/lib/libvmmapi/vmmapi.c
==============================================================================
--- projects/bhyve/lib/libvmmapi/vmmapi.c	Thu Oct  4 02:27:14 2012	(r241178)
+++ projects/bhyve/lib/libvmmapi/vmmapi.c	Thu Oct  4 03:07:05 2012	(r241179)
@@ -143,8 +143,7 @@ vmm_get_mem_free(void)
 }
 
 int
-vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa,
-		  vm_paddr_t *ret_hpa, size_t *ret_len)
+vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len)
 {
 	int error;
 	struct vm_memory_segment seg;

Modified: projects/bhyve/lib/libvmmapi/vmmapi.h
==============================================================================
--- projects/bhyve/lib/libvmmapi/vmmapi.h	Thu Oct  4 02:27:14 2012	(r241178)
+++ projects/bhyve/lib/libvmmapi/vmmapi.h	Thu Oct  4 03:07:05 2012	(r241179)
@@ -37,8 +37,7 @@ struct vmctx *vm_open(const char *name);
 void	vm_destroy(struct vmctx *ctx);
 size_t	vmm_get_mem_total(void);
 size_t	vmm_get_mem_free(void);
-int	vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa,
-			  vm_paddr_t *ret_hpa, size_t *ret_len);
+int	vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len);
 /*
  * Create a memory segment of 'len' bytes in the guest physical address space
  * at offset 'gpa'.

Modified: projects/bhyve/usr.sbin/vmmctl/vmmctl.c
==============================================================================
--- projects/bhyve/usr.sbin/vmmctl/vmmctl.c	Thu Oct  4 02:27:14 2012	(r241178)
+++ projects/bhyve/usr.sbin/vmmctl/vmmctl.c	Thu Oct  4 03:07:05 2012	(r241179)
@@ -387,7 +387,7 @@ main(int argc, char *argv[])
 {
 	char *vmname;
 	int error, ch, vcpu;
-	vm_paddr_t hpa;
+	vm_paddr_t gpa;
 	size_t len;
 	struct vm_exit vmexit;
 	uint64_t ctl, eptp, bm, addr, u64;
@@ -829,15 +829,17 @@ main(int argc, char *argv[])
 	}
 
 	if (!error && (get_lowmem || get_all)) {
-		error = vm_get_memory_seg(ctx, 0, &hpa, &len);
+		gpa = 0;
+		error = vm_get_memory_seg(ctx, gpa, &len);
 		if (error == 0)
-			printf("lowmem\t\t0x%016lx/%ld\n", hpa, len);
+			printf("lowmem\t\t0x%016lx/%ld\n", gpa, len);
 	}
 
 	if (!error && (get_highmem || get_all)) {
-		error = vm_get_memory_seg(ctx, 4 * GB, &hpa, &len);
+		gpa = 4 * GB;
+		error = vm_get_memory_seg(ctx, gpa, &len);
 		if (error == 0)
-			printf("highmem\t\t0x%016lx/%ld\n", hpa, len);
+			printf("highmem\t\t0x%016lx/%ld\n", gpa, len);
 	}
 
 	if (!error && (get_efer || get_all)) {


More information about the svn-src-projects mailing list