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
nexedi
linux
Commits
98001d8d
Commit
98001d8d
authored
14 years ago
by
Avi Kivity
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM: PPC: Add missing vcpu_load()/vcpu_put() in vcpu ioctls
Signed-off-by:
Avi Kivity
<
avi@redhat.com
>
parent
3dbe1415
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
arch/powerpc/kvm/book3s.c
arch/powerpc/kvm/book3s.c
+10
-0
arch/powerpc/kvm/booke.c
arch/powerpc/kvm/booke.c
+14
-1
No files found.
arch/powerpc/kvm/book3s.c
View file @
98001d8d
...
@@ -1110,6 +1110,8 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
...
@@ -1110,6 +1110,8 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
struct
kvmppc_vcpu_book3s
*
vcpu3s
=
to_book3s
(
vcpu
);
struct
kvmppc_vcpu_book3s
*
vcpu3s
=
to_book3s
(
vcpu
);
int
i
;
int
i
;
vcpu_load
(
vcpu
);
sregs
->
pvr
=
vcpu
->
arch
.
pvr
;
sregs
->
pvr
=
vcpu
->
arch
.
pvr
;
sregs
->
u
.
s
.
sdr1
=
to_book3s
(
vcpu
)
->
sdr1
;
sregs
->
u
.
s
.
sdr1
=
to_book3s
(
vcpu
)
->
sdr1
;
...
@@ -1128,6 +1130,9 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
...
@@ -1128,6 +1130,9 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
sregs
->
u
.
s
.
ppc32
.
dbat
[
i
]
=
vcpu3s
->
dbat
[
i
].
raw
;
sregs
->
u
.
s
.
ppc32
.
dbat
[
i
]
=
vcpu3s
->
dbat
[
i
].
raw
;
}
}
}
}
vcpu_put
(
vcpu
);
return
0
;
return
0
;
}
}
...
@@ -1137,6 +1142,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
...
@@ -1137,6 +1142,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
struct
kvmppc_vcpu_book3s
*
vcpu3s
=
to_book3s
(
vcpu
);
struct
kvmppc_vcpu_book3s
*
vcpu3s
=
to_book3s
(
vcpu
);
int
i
;
int
i
;
vcpu_load
(
vcpu
);
kvmppc_set_pvr
(
vcpu
,
sregs
->
pvr
);
kvmppc_set_pvr
(
vcpu
,
sregs
->
pvr
);
vcpu3s
->
sdr1
=
sregs
->
u
.
s
.
sdr1
;
vcpu3s
->
sdr1
=
sregs
->
u
.
s
.
sdr1
;
...
@@ -1163,6 +1170,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
...
@@ -1163,6 +1170,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
/* Flush the MMU after messing with the segments */
/* Flush the MMU after messing with the segments */
kvmppc_mmu_pte_flush
(
vcpu
,
0
,
0
);
kvmppc_mmu_pte_flush
(
vcpu
,
0
,
0
);
vcpu_put
(
vcpu
);
return
0
;
return
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
arch/powerpc/kvm/booke.c
View file @
98001d8d
...
@@ -485,6 +485,8 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
...
@@ -485,6 +485,8 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
{
{
int
i
;
int
i
;
vcpu_load
(
vcpu
);
regs
->
pc
=
vcpu
->
arch
.
pc
;
regs
->
pc
=
vcpu
->
arch
.
pc
;
regs
->
cr
=
kvmppc_get_cr
(
vcpu
);
regs
->
cr
=
kvmppc_get_cr
(
vcpu
);
regs
->
ctr
=
vcpu
->
arch
.
ctr
;
regs
->
ctr
=
vcpu
->
arch
.
ctr
;
...
@@ -505,6 +507,8 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
...
@@ -505,6 +507,8 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
regs
->
gpr
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
regs
->
gpr
);
i
++
)
regs
->
gpr
[
i
]
=
kvmppc_get_gpr
(
vcpu
,
i
);
regs
->
gpr
[
i
]
=
kvmppc_get_gpr
(
vcpu
,
i
);
vcpu_put
(
vcpu
);
return
0
;
return
0
;
}
}
...
@@ -512,6 +516,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
...
@@ -512,6 +516,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
{
{
int
i
;
int
i
;
vcpu_load
(
vcpu
);
vcpu
->
arch
.
pc
=
regs
->
pc
;
vcpu
->
arch
.
pc
=
regs
->
pc
;
kvmppc_set_cr
(
vcpu
,
regs
->
cr
);
kvmppc_set_cr
(
vcpu
,
regs
->
cr
);
vcpu
->
arch
.
ctr
=
regs
->
ctr
;
vcpu
->
arch
.
ctr
=
regs
->
ctr
;
...
@@ -531,6 +537,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
...
@@ -531,6 +537,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
regs
->
gpr
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
regs
->
gpr
);
i
++
)
kvmppc_set_gpr
(
vcpu
,
i
,
regs
->
gpr
[
i
]);
kvmppc_set_gpr
(
vcpu
,
i
,
regs
->
gpr
[
i
]);
vcpu_put
(
vcpu
);
return
0
;
return
0
;
}
}
...
@@ -559,7 +567,12 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
...
@@ -559,7 +567,12 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
int
kvm_arch_vcpu_ioctl_translate
(
struct
kvm_vcpu
*
vcpu
,
int
kvm_arch_vcpu_ioctl_translate
(
struct
kvm_vcpu
*
vcpu
,
struct
kvm_translation
*
tr
)
struct
kvm_translation
*
tr
)
{
{
return
kvmppc_core_vcpu_translate
(
vcpu
,
tr
);
int
r
;
vcpu_load
(
vcpu
);
r
=
kvmppc_core_vcpu_translate
(
vcpu
,
tr
);
vcpu_put
(
vcpu
);
return
r
;
}
}
int
kvm_vm_ioctl_get_dirty_log
(
struct
kvm
*
kvm
,
struct
kvm_dirty_log
*
log
)
int
kvm_vm_ioctl_get_dirty_log
(
struct
kvm
*
kvm
,
struct
kvm_dirty_log
*
log
)
...
...
This diff is collapsed.
Click to expand it.
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