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
cc9085b6
Commit
cc9085b6
authored
Oct 19, 2017
by
Radim Krčmář
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kvm-ppc-fixes' of
git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
Fix potential host oops and hangs.
parents
33d930e5
ad98dd1a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
14 deletions
+25
-14
arch/powerpc/kvm/book3s_64_vio.c
arch/powerpc/kvm/book3s_64_vio.c
+14
-9
arch/powerpc/kvm/book3s_hv_rmhandlers.S
arch/powerpc/kvm/book3s_hv_rmhandlers.S
+10
-3
arch/powerpc/kvm/powerpc.c
arch/powerpc/kvm/powerpc.c
+1
-2
No files found.
arch/powerpc/kvm/book3s_64_vio.c
View file @
cc9085b6
...
@@ -478,28 +478,30 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
...
@@ -478,28 +478,30 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
return
ret
;
return
ret
;
dir
=
iommu_tce_direction
(
tce
);
dir
=
iommu_tce_direction
(
tce
);
idx
=
srcu_read_lock
(
&
vcpu
->
kvm
->
srcu
);
if
((
dir
!=
DMA_NONE
)
&&
kvmppc_gpa_to_ua
(
vcpu
->
kvm
,
if
((
dir
!=
DMA_NONE
)
&&
kvmppc_gpa_to_ua
(
vcpu
->
kvm
,
tce
&
~
(
TCE_PCI_READ
|
TCE_PCI_WRITE
),
&
ua
,
NULL
))
tce
&
~
(
TCE_PCI_READ
|
TCE_PCI_WRITE
),
&
ua
,
NULL
))
{
return
H_PARAMETER
;
ret
=
H_PARAMETER
;
goto
unlock_exit
;
}
entry
=
ioba
>>
stt
->
page_shift
;
entry
=
ioba
>>
stt
->
page_shift
;
list_for_each_entry_lockless
(
stit
,
&
stt
->
iommu_tables
,
next
)
{
list_for_each_entry_lockless
(
stit
,
&
stt
->
iommu_tables
,
next
)
{
if
(
dir
==
DMA_NONE
)
{
if
(
dir
==
DMA_NONE
)
ret
=
kvmppc_tce_iommu_unmap
(
vcpu
->
kvm
,
ret
=
kvmppc_tce_iommu_unmap
(
vcpu
->
kvm
,
stit
->
tbl
,
entry
);
stit
->
tbl
,
entry
);
}
else
{
else
idx
=
srcu_read_lock
(
&
vcpu
->
kvm
->
srcu
);
ret
=
kvmppc_tce_iommu_map
(
vcpu
->
kvm
,
stit
->
tbl
,
ret
=
kvmppc_tce_iommu_map
(
vcpu
->
kvm
,
stit
->
tbl
,
entry
,
ua
,
dir
);
entry
,
ua
,
dir
);
srcu_read_unlock
(
&
vcpu
->
kvm
->
srcu
,
idx
);
}
if
(
ret
==
H_SUCCESS
)
if
(
ret
==
H_SUCCESS
)
continue
;
continue
;
if
(
ret
==
H_TOO_HARD
)
if
(
ret
==
H_TOO_HARD
)
return
re
t
;
goto
unlock_exi
t
;
WARN_ON_ONCE
(
1
);
WARN_ON_ONCE
(
1
);
kvmppc_clear_tce
(
stit
->
tbl
,
entry
);
kvmppc_clear_tce
(
stit
->
tbl
,
entry
);
...
@@ -507,7 +509,10 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
...
@@ -507,7 +509,10 @@ long kvmppc_h_put_tce(struct kvm_vcpu *vcpu, unsigned long liobn,
kvmppc_tce_put
(
stt
,
entry
,
tce
);
kvmppc_tce_put
(
stt
,
entry
,
tce
);
return
H_SUCCESS
;
unlock_exit:
srcu_read_unlock
(
&
vcpu
->
kvm
->
srcu
,
idx
);
return
ret
;
}
}
EXPORT_SYMBOL_GPL
(
kvmppc_h_put_tce
);
EXPORT_SYMBOL_GPL
(
kvmppc_h_put_tce
);
...
...
arch/powerpc/kvm/book3s_hv_rmhandlers.S
View file @
cc9085b6
...
@@ -989,13 +989,14 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_300)
...
@@ -989,13 +989,14 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_ARCH_300)
beq
no_xive
beq
no_xive
ld
r11
,
VCPU_XIVE_SAVED_STATE
(
r4
)
ld
r11
,
VCPU_XIVE_SAVED_STATE
(
r4
)
li
r9
,
TM_QW1_OS
li
r9
,
TM_QW1_OS
stdcix
r11
,
r9
,
r10
eieio
eieio
stdcix
r11
,
r9
,
r10
lwz
r11
,
VCPU_XIVE_CAM_WORD
(
r4
)
lwz
r11
,
VCPU_XIVE_CAM_WORD
(
r4
)
li
r9
,
TM_QW1_OS
+
TM_WORD2
li
r9
,
TM_QW1_OS
+
TM_WORD2
stwcix
r11
,
r9
,
r10
stwcix
r11
,
r9
,
r10
li
r9
,
1
li
r9
,
1
stw
r9
,
VCPU_XIVE_PUSHED
(
r4
)
stw
r9
,
VCPU_XIVE_PUSHED
(
r4
)
eieio
no_xive
:
no_xive
:
#endif /* CONFIG_KVM_XICS */
#endif /* CONFIG_KVM_XICS */
...
@@ -1310,6 +1311,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
...
@@ -1310,6 +1311,7 @@ END_FTR_SECTION_IFSET(CPU_FTR_HAS_PPR)
bne
3
f
bne
3
f
BEGIN_FTR_SECTION
BEGIN_FTR_SECTION
PPC_MSGSYNC
PPC_MSGSYNC
lwsync
END_FTR_SECTION_IFSET
(
CPU_FTR_ARCH_300
)
END_FTR_SECTION_IFSET
(
CPU_FTR_ARCH_300
)
lbz
r0
,
HSTATE_HOST_IPI
(
r13
)
lbz
r0
,
HSTATE_HOST_IPI
(
r13
)
cmpwi
r0
,
0
cmpwi
r0
,
0
...
@@ -1400,8 +1402,8 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
...
@@ -1400,8 +1402,8 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
cmpldi
cr0
,
r10
,
0
cmpldi
cr0
,
r10
,
0
beq
1
f
beq
1
f
/
*
First
load
to
pull
the
context
,
we
ignore
the
value
*/
/
*
First
load
to
pull
the
context
,
we
ignore
the
value
*/
lwzx
r11
,
r7
,
r10
eieio
eieio
lwzx
r11
,
r7
,
r10
/
*
Second
load
to
recover
the
context
state
(
Words
0
and
1
)
*/
/
*
Second
load
to
recover
the
context
state
(
Words
0
and
1
)
*/
ldx
r11
,
r6
,
r10
ldx
r11
,
r6
,
r10
b
3
f
b
3
f
...
@@ -1409,8 +1411,8 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
...
@@ -1409,8 +1411,8 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
cmpldi
cr0
,
r10
,
0
cmpldi
cr0
,
r10
,
0
beq
1
f
beq
1
f
/
*
First
load
to
pull
the
context
,
we
ignore
the
value
*/
/
*
First
load
to
pull
the
context
,
we
ignore
the
value
*/
lwzcix
r11
,
r7
,
r10
eieio
eieio
lwzcix
r11
,
r7
,
r10
/
*
Second
load
to
recover
the
context
state
(
Words
0
and
1
)
*/
/
*
Second
load
to
recover
the
context
state
(
Words
0
and
1
)
*/
ldcix
r11
,
r6
,
r10
ldcix
r11
,
r6
,
r10
3
:
std
r11
,
VCPU_XIVE_SAVED_STATE
(
r9
)
3
:
std
r11
,
VCPU_XIVE_SAVED_STATE
(
r9
)
...
@@ -1420,6 +1422,7 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
...
@@ -1420,6 +1422,7 @@ guest_exit_cont: /* r9 = vcpu, r12 = trap, r13 = paca */
stw
r10
,
VCPU_XIVE_PUSHED
(
r9
)
stw
r10
,
VCPU_XIVE_PUSHED
(
r9
)
stb
r10
,
(
VCPU_XIVE_SAVED_STATE
+
3
)(
r9
)
stb
r10
,
(
VCPU_XIVE_SAVED_STATE
+
3
)(
r9
)
stb
r0
,
(
VCPU_XIVE_SAVED_STATE
+
4
)(
r9
)
stb
r0
,
(
VCPU_XIVE_SAVED_STATE
+
4
)(
r9
)
eieio
1
:
1
:
#endif /* CONFIG_KVM_XICS */
#endif /* CONFIG_KVM_XICS */
/
*
Save
more
register
state
*/
/
*
Save
more
register
state
*/
...
@@ -2788,6 +2791,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
...
@@ -2788,6 +2791,10 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_207S)
PPC_MSGCLR
(6)
PPC_MSGCLR
(6)
/
*
see
if
it
's a host IPI */
/
*
see
if
it
's a host IPI */
li
r3
,
1
li
r3
,
1
BEGIN_FTR_SECTION
PPC_MSGSYNC
lwsync
END_FTR_SECTION_IFSET
(
CPU_FTR_ARCH_300
)
lbz
r0
,
HSTATE_HOST_IPI
(
r13
)
lbz
r0
,
HSTATE_HOST_IPI
(
r13
)
cmpwi
r0
,
0
cmpwi
r0
,
0
bnelr
bnelr
...
...
arch/powerpc/kvm/powerpc.c
View file @
cc9085b6
...
@@ -644,8 +644,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
...
@@ -644,8 +644,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
break
;
break
;
#endif
#endif
case
KVM_CAP_PPC_HTM
:
case
KVM_CAP_PPC_HTM
:
r
=
cpu_has_feature
(
CPU_FTR_TM_COMP
)
&&
r
=
cpu_has_feature
(
CPU_FTR_TM_COMP
)
&&
hv_enabled
;
is_kvmppc_hv_enabled
(
kvm
);
break
;
break
;
default:
default:
r
=
0
;
r
=
0
;
...
...
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