aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/interrupts_head.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kvm/interrupts_head.S')
-rw-r--r--arch/arm/kvm/interrupts_head.S21
1 files changed, 13 insertions, 8 deletions
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
index 6f18695a09cb..76af93025574 100644
--- a/arch/arm/kvm/interrupts_head.S
+++ b/arch/arm/kvm/interrupts_head.S
@@ -303,13 +303,17 @@ vcpu .req r0 @ vcpu pointer always in r0
303 303
304 mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL 304 mrc p15, 0, r2, c14, c1, 0 @ CNTKCTL
305 mrrc p15, 0, r4, r5, c7 @ PAR 305 mrrc p15, 0, r4, r5, c7 @ PAR
306 mrc p15, 0, r6, c10, c3, 0 @ AMAIR0
307 mrc p15, 0, r7, c10, c3, 1 @ AMAIR1
306 308
307 .if \store_to_vcpu == 0 309 .if \store_to_vcpu == 0
308 push {r2,r4-r5} 310 push {r2,r4-r7}
309 .else 311 .else
310 str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] 312 str r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
311 add r12, vcpu, #CP15_OFFSET(c7_PAR) 313 add r12, vcpu, #CP15_OFFSET(c7_PAR)
312 strd r4, r5, [r12] 314 strd r4, r5, [r12]
315 str r6, [vcpu, #CP15_OFFSET(c10_AMAIR0)]
316 str r7, [vcpu, #CP15_OFFSET(c10_AMAIR1)]
313 .endif 317 .endif
314.endm 318.endm
315 319
@@ -322,15 +326,19 @@ vcpu .req r0 @ vcpu pointer always in r0
322 */ 326 */
323.macro write_cp15_state read_from_vcpu 327.macro write_cp15_state read_from_vcpu
324 .if \read_from_vcpu == 0 328 .if \read_from_vcpu == 0
325 pop {r2,r4-r5} 329 pop {r2,r4-r7}
326 .else 330 .else
327 ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)] 331 ldr r2, [vcpu, #CP15_OFFSET(c14_CNTKCTL)]
328 add r12, vcpu, #CP15_OFFSET(c7_PAR) 332 add r12, vcpu, #CP15_OFFSET(c7_PAR)
329 ldrd r4, r5, [r12] 333 ldrd r4, r5, [r12]
334 ldr r6, [vcpu, #CP15_OFFSET(c10_AMAIR0)]
335 ldr r7, [vcpu, #CP15_OFFSET(c10_AMAIR1)]
330 .endif 336 .endif
331 337
332 mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL 338 mcr p15, 0, r2, c14, c1, 0 @ CNTKCTL
333 mcrr p15, 0, r4, r5, c7 @ PAR 339 mcrr p15, 0, r4, r5, c7 @ PAR
340 mcr p15, 0, r6, c10, c3, 0 @ AMAIR0
341 mcr p15, 0, r7, c10, c3, 1 @ AMAIR1
334 342
335 .if \read_from_vcpu == 0 343 .if \read_from_vcpu == 0
336 pop {r2-r12} 344 pop {r2-r12}
@@ -597,17 +605,14 @@ vcpu .req r0 @ vcpu pointer always in r0
597 605
598/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */ 606/* Enable/Disable: stage-2 trans., trap interrupts, trap wfi, trap smc */
599.macro configure_hyp_role operation 607.macro configure_hyp_role operation
600 mrc p15, 4, r2, c1, c1, 0 @ HCR
601 bic r2, r2, #HCR_VIRT_EXCP_MASK
602 ldr r3, =HCR_GUEST_MASK
603 .if \operation == vmentry 608 .if \operation == vmentry
604 orr r2, r2, r3 609 ldr r2, [vcpu, #VCPU_HCR]
605 ldr r3, [vcpu, #VCPU_IRQ_LINES] 610 ldr r3, [vcpu, #VCPU_IRQ_LINES]
606 orr r2, r2, r3 611 orr r2, r2, r3
607 .else 612 .else
608 bic r2, r2, r3 613 mov r2, #0
609 .endif 614 .endif
610 mcr p15, 4, r2, c1, c1, 0 615 mcr p15, 4, r2, c1, c1, 0 @ HCR
611.endm 616.endm
612 617
613.macro load_vcpu 618.macro load_vcpu