summaryrefslogtreecommitdiffstats
path: root/lib/libvmmapi
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-02-11 20:36:07 +0000
committerneel <neel@FreeBSD.org>2013-02-11 20:36:07 +0000
commit3a9eeaa765cdfd3940dbf4b881957c057c6d6576 (patch)
tree08d417f2f979935bc451028d59ec525a42e021c6 /lib/libvmmapi
parent7bafa2ca4141fce3978c17cea165f86ce0c9ac69 (diff)
downloadFreeBSD-src-3a9eeaa765cdfd3940dbf4b881957c057c6d6576.zip
FreeBSD-src-3a9eeaa765cdfd3940dbf4b881957c057c6d6576.tar.gz
Implement guest vcpu pinning using 'pthread_setaffinity_np(3)'.
Prior to this change pinning was implemented via an ioctl (VM_SET_PINNING) that called 'sched_bind()' on behalf of the user thread. The ULE implementation of 'sched_bind()' bumps up 'td_pinned' which in turn runs afoul of the assertion '(td_pinned == 0)' in userret(). Using the cpuset affinity to implement pinning of the vcpu threads works with both 4BSD and ULE schedulers and has the happy side-effect of getting rid of a bunch of code in vmm.ko. Discussed with: grehan
Diffstat (limited to 'lib/libvmmapi')
-rw-r--r--lib/libvmmapi/vmmapi.c28
-rw-r--r--lib/libvmmapi/vmmapi.h2
2 files changed, 0 insertions, 30 deletions
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index cfb42d0..6a368b3 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -250,34 +250,6 @@ vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *ret_val)
}
int
-vm_get_pinning(struct vmctx *ctx, int vcpu, int *host_cpuid)
-{
- int error;
- struct vm_pin vmpin;
-
- bzero(&vmpin, sizeof(vmpin));
- vmpin.vm_cpuid = vcpu;
-
- error = ioctl(ctx->fd, VM_GET_PINNING, &vmpin);
- *host_cpuid = vmpin.host_cpuid;
- return (error);
-}
-
-int
-vm_set_pinning(struct vmctx *ctx, int vcpu, int host_cpuid)
-{
- int error;
- struct vm_pin vmpin;
-
- bzero(&vmpin, sizeof(vmpin));
- vmpin.vm_cpuid = vcpu;
- vmpin.host_cpuid = host_cpuid;
-
- error = ioctl(ctx->fd, VM_SET_PINNING, &vmpin);
- return (error);
-}
-
-int
vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *vmexit)
{
int error;
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index de04252..e8cc8ba 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -56,8 +56,6 @@ int vm_get_desc(struct vmctx *ctx, int vcpu, int reg,
uint64_t *base, uint32_t *limit, uint32_t *access);
int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val);
int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval);
-int vm_get_pinning(struct vmctx *ctx, int vcpu, int *host_cpuid);
-int vm_set_pinning(struct vmctx *ctx, int vcpu, int host_cpuid);
int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip,
struct vm_exit *ret_vmexit);
int vm_apicid2vcpu(struct vmctx *ctx, int apicid);
OpenPOWER on IntegriCloud