]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - arch/arm/kvm/interrupts_head.S
Merge tag 'v4.0.8' into xlnx_4.0.8-rt6
[zynq/linux.git] / arch / arm / kvm / interrupts_head.S
index 14d488388480ea50a80d24b18bbed9636c8d1c25..f6f14812d106b7b57deea84728e8c961f977ec8d 100644 (file)
@@ -599,8 +599,13 @@ ARM_BE8(rev        r6, r6  )
 .endm
 
 /* Configures the HCPTR (Hyp Coprocessor Trap Register) on entry/return
- * (hardware reset value is 0). Keep previous value in r2. */
-.macro set_hcptr operation, mask
+ * (hardware reset value is 0). Keep previous value in r2.
+ * An ISB is emited on vmexit/vmtrap, but executed on vmexit only if
+ * VFP wasn't already enabled (always executed on vmtrap).
+ * If a label is specified with vmexit, it is branched to if VFP wasn't
+ * enabled.
+ */
+.macro set_hcptr operation, mask, label = none
        mrc     p15, 4, r2, c1, c1, 2
        ldr     r3, =\mask
        .if \operation == vmentry
@@ -609,6 +614,17 @@ ARM_BE8(rev        r6, r6  )
        bic     r3, r2, r3              @ Don't trap defined coproc-accesses
        .endif
        mcr     p15, 4, r3, c1, c1, 2
+       .if \operation != vmentry
+       .if \operation == vmexit
+       tst     r2, #(HCPTR_TCP(10) | HCPTR_TCP(11))
+       beq     1f
+       .endif
+       isb
+       .if \label != none
+       b       \label
+       .endif
+1:
+       .endif
 .endm
 
 /* Configures the HDCR (Hyp Debug Configuration Register) on entry/return