Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
dd489240
Commit
dd489240
authored
Jul 29, 2015
by
Paolo Bonzini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: document memory barriers for kvm->vcpus/kvm->online_vcpus
Signed-off-by:
Paolo Bonzini
<
pbonzini@redhat.com
>
parent
c847fe88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
include/linux/kvm_host.h
include/linux/kvm_host.h
+4
-0
virt/kvm/kvm_main.c
virt/kvm/kvm_main.c
+5
-0
No files found.
include/linux/kvm_host.h
View file @
dd489240
...
...
@@ -427,6 +427,10 @@ struct kvm {
static
inline
struct
kvm_vcpu
*
kvm_get_vcpu
(
struct
kvm
*
kvm
,
int
i
)
{
/* Pairs with smp_wmb() in kvm_vm_ioctl_create_vcpu, in case
* the caller has read kvm->online_vcpus before (as is the case
* for kvm_for_each_vcpu, for example).
*/
smp_rmb
();
return
kvm
->
vcpus
[
i
];
}
...
...
virt/kvm/kvm_main.c
View file @
dd489240
...
...
@@ -2206,6 +2206,11 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, u32 id)
}
kvm
->
vcpus
[
atomic_read
(
&
kvm
->
online_vcpus
)]
=
vcpu
;
/*
* Pairs with smp_rmb() in kvm_get_vcpu. Write kvm->vcpus
* before kvm->online_vcpu's incremented value.
*/
smp_wmb
();
atomic_inc
(
&
kvm
->
online_vcpus
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment