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
8fbf065d
Commit
8fbf065d
authored
May 13, 2010
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: x86: Add missing locking to arch specific vcpu ioctls
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
98001d8d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
arch/x86/kvm/x86.c
arch/x86/kvm/x86.c
+6
-0
No files found.
arch/x86/kvm/x86.c
View file @
8fbf065d
...
...
@@ -1833,6 +1833,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
{
int
r
;
vcpu_load
(
vcpu
);
r
=
-
E2BIG
;
if
(
cpuid
->
nent
<
vcpu
->
arch
.
cpuid_nent
)
goto
out
;
...
...
@@ -1844,6 +1845,7 @@ static int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
out:
cpuid
->
nent
=
vcpu
->
arch
.
cpuid_nent
;
vcpu_put
(
vcpu
);
return
r
;
}
...
...
@@ -2134,6 +2136,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
int
r
;
unsigned
bank_num
=
mcg_cap
&
0xff
,
bank
;
vcpu_load
(
vcpu
);
r
=
-
EINVAL
;
if
(
!
bank_num
||
bank_num
>=
KVM_MAX_MCE_BANKS
)
goto
out
;
...
...
@@ -2148,6 +2151,7 @@ static int kvm_vcpu_ioctl_x86_setup_mce(struct kvm_vcpu *vcpu,
for
(
bank
=
0
;
bank
<
bank_num
;
bank
++
)
vcpu
->
arch
.
mce_banks
[
bank
*
4
]
=
~
(
u64
)
0
;
out:
vcpu_put
(
vcpu
);
return
r
;
}
...
...
@@ -2456,7 +2460,9 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
r
=
-
EFAULT
;
if
(
copy_from_user
(
&
mce
,
argp
,
sizeof
mce
))
goto
out
;
vcpu_load
(
vcpu
);
r
=
kvm_vcpu_ioctl_x86_set_mce
(
vcpu
,
&
mce
);
vcpu_put
(
vcpu
);
break
;
}
case
KVM_GET_VCPU_EVENTS
:
{
...
...
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