summaryrefslogtreecommitdiffstats
path: root/lib/libvmmapi
diff options
context:
space:
mode:
authortychon <tychon@FreeBSD.org>2015-04-01 00:15:31 +0000
committertychon <tychon@FreeBSD.org>2015-04-01 00:15:31 +0000
commitb3c521e85228b0e74f7983ca41489dfafd7a424d (patch)
treedb6cabf68a19dd36f98777d6764af82f1969b8c0 /lib/libvmmapi
parentcbabb678cae1bc20311261fcd38ceb4a0cc319a9 (diff)
downloadFreeBSD-src-b3c521e85228b0e74f7983ca41489dfafd7a424d.zip
FreeBSD-src-b3c521e85228b0e74f7983ca41489dfafd7a424d.tar.gz
Fix "MOVS" instruction memory to MMIO emulation. Currently updates to
%rdi, %rsi, etc are inadvertently bypassed along with the check to see if the instruction needs to be repeated per the 'rep' prefix. Add "MOVS" instruction support for the 'MMIO to MMIO' case. Reviewed by: neel
Diffstat (limited to 'lib/libvmmapi')
-rw-r--r--lib/libvmmapi/vmmapi.c12
-rw-r--r--lib/libvmmapi/vmmapi.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index 9828876..0c15845 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -979,6 +979,18 @@ gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
return (error);
}
+int
+vm_gla2gpa(struct vmctx *ctx, int vcpu, struct vm_guest_paging *paging,
+ uint64_t gla, int prot, uint64_t *gpa)
+{
+ int error, fault;
+
+ error = gla2gpa(ctx, vcpu, paging, gla, prot, &fault, gpa);
+ if (fault)
+ error = fault;
+ return (error);
+}
+
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index 06b2930..d001cd8 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -63,6 +63,8 @@ int vm_get_memory_seg(struct vmctx *ctx, vm_paddr_t gpa, size_t *ret_len,
int vm_setup_memory(struct vmctx *ctx, size_t len, enum vm_mmap_style s);
void *vm_map_gpa(struct vmctx *ctx, vm_paddr_t gaddr, size_t len);
int vm_get_gpa_pmap(struct vmctx *, uint64_t gpa, uint64_t *pte, int *num);
+int vm_gla2gpa(struct vmctx *, int vcpuid, struct vm_guest_paging *paging,
+ uint64_t gla, int prot, uint64_t *gpa);
uint32_t vm_get_lowmem_limit(struct vmctx *ctx);
void vm_set_lowmem_limit(struct vmctx *ctx, uint32_t limit);
void vm_set_memflags(struct vmctx *ctx, int flags);
OpenPOWER on IntegriCloud