diff options
author | neel <neel@FreeBSD.org> | 2013-02-11 20:36:07 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-02-11 20:36:07 +0000 |
commit | 3a9eeaa765cdfd3940dbf4b881957c057c6d6576 (patch) | |
tree | 08d417f2f979935bc451028d59ec525a42e021c6 /sys/amd64/include | |
parent | 7bafa2ca4141fce3978c17cea165f86ce0c9ac69 (diff) | |
download | FreeBSD-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 'sys/amd64/include')
-rw-r--r-- | sys/amd64/include/vmm.h | 2 | ||||
-rw-r--r-- | sys/amd64/include/vmm_dev.h | 11 |
2 files changed, 0 insertions, 13 deletions
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h index ec94083..6bd3566 100644 --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -102,8 +102,6 @@ int vm_get_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *ret_desc); int vm_set_seg_desc(struct vm *vm, int vcpu, int reg, struct seg_desc *desc); -int vm_get_pinning(struct vm *vm, int vcpu, int *cpuid); -int vm_set_pinning(struct vm *vm, int vcpu, int cpuid); int vm_run(struct vm *vm, struct vm_run *vmrun); int vm_inject_event(struct vm *vm, int vcpu, int type, int vector, uint32_t error_code, int error_code_valid); diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h index 2311673..0729927 100644 --- a/sys/amd64/include/vmm_dev.h +++ b/sys/amd64/include/vmm_dev.h @@ -51,11 +51,6 @@ struct vm_seg_desc { /* data or code segment */ struct seg_desc desc; }; -struct vm_pin { - int vm_cpuid; - int host_cpuid; /* -1 to unpin */ -}; - struct vm_run { int cpuid; uint64_t rip; /* start running here */ @@ -142,8 +137,6 @@ struct vm_x2apic { enum { IOCNUM_RUN, - IOCNUM_SET_PINNING, - IOCNUM_GET_PINNING, IOCNUM_MAP_MEMORY, IOCNUM_GET_MEMORY_SEG, IOCNUM_SET_REGISTER, @@ -168,10 +161,6 @@ enum { #define VM_RUN \ _IOWR('v', IOCNUM_RUN, struct vm_run) -#define VM_SET_PINNING \ - _IOW('v', IOCNUM_SET_PINNING, struct vm_pin) -#define VM_GET_PINNING \ - _IOWR('v', IOCNUM_GET_PINNING, struct vm_pin) #define VM_MAP_MEMORY \ _IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment) #define VM_GET_MEMORY_SEG \ |