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.
This commit is contained in:
Neel Natu 2012-10-04 03:07:05 +00:00
parent f7d51510f1
commit 4b52a1e497
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/bhyve/; revision=241179
3 changed files with 9 additions and 9 deletions

View file

@ -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;

View file

@ -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'.

View file

@ -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)) {