Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102551129
D37390.id113136.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D37390.id113136.diff
View Options
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -31,8 +31,12 @@
#ifndef _VMM_H_
#define _VMM_H_
+#include <sys/param.h>
#include <sys/cpuset.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
#include <sys/sdt.h>
+
#include <x86/segments.h>
struct vm_snapshot_meta;
@@ -159,6 +163,7 @@
struct vm_eventinfo {
void *rptr; /* rendezvous cookie */
+ struct mtx *rmtx; /* rendezvous mtx */
int *sptr; /* suspend cookie */
int *iptr; /* reqidle cookie */
};
@@ -313,10 +318,17 @@
#endif /* _SYS__CPUSET_H_ */
static __inline int
-vcpu_rendezvous_pending(struct vm_eventinfo *info)
+vcpu_rendezvous_pending(struct vm_eventinfo *info, int vcpuid)
{
+ bool pending;
+
+ mtx_lock(info->rmtx);
+
+ pending = CPU_ISSET(vcpuid, (cpuset_t*)info->rptr);
+
+ mtx_unlock(info->rmtx);
- return (*((uintptr_t *)(info->rptr)) != 0);
+ return pending;
}
static __inline int
diff --git a/sys/amd64/vmm/amd/svm.c b/sys/amd64/vmm/amd/svm.c
--- a/sys/amd64/vmm/amd/svm.c
+++ b/sys/amd64/vmm/amd/svm.c
@@ -2066,7 +2066,7 @@
break;
}
- if (vcpu_rendezvous_pending(evinfo)) {
+ if (vcpu_rendezvous_pending(evinfo, vcpu)) {
enable_gintr();
vm_exit_rendezvous(vm, vcpu, state->rip);
break;
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -3065,7 +3065,7 @@
break;
}
- if (vcpu_rendezvous_pending(evinfo)) {
+ if (vcpu_rendezvous_pending(evinfo, vcpu)) {
enable_intr();
vm_exit_rendezvous(vmx->vm, vcpu, rip);
break;
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -1755,7 +1755,8 @@
pmap = vmspace_pmap(vm->vmspace);
vcpu = &vm->vcpu[vcpuid];
vme = &vcpu->exitinfo;
- evinfo.rptr = &vm->rendezvous_func;
+ evinfo.rptr = &vm->rendezvous_req_cpus;
+ evinfo.rmtx = &vm->rendezvous_mtx;
evinfo.sptr = &vm->suspend;
evinfo.iptr = &vcpu->reqidle;
restart:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 10:56 PM (8 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14634833
Default Alt Text
D37390.id113136.diff (1 KB)
Attached To
Mode
D37390: vmm: avoid spurios rendezvous
Attached
Detach File
Event Timeline
Log In to Comment