]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
powerpc/64s/exception: KVM handler can set the HSRR trap bit
authorNicholas Piggin <npiggin@gmail.com>
Sat, 22 Jun 2019 13:15:18 +0000 (23:15 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 2 Jul 2019 10:24:42 +0000 (20:24 +1000)
Move the KVM trap HSRR bit into the KVM handler, which can be
conditionally applied when hsrr parameter is set.

No generated code change.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/exception-64s.h
arch/powerpc/include/asm/head-64.h

index d2a5bbeb727d7a730a1488235b925c9584b6c74e..a7b514574b80a0f1c13360abd6548958abd18816 100644 (file)
@@ -454,7 +454,12 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
        ld      r10,\area+EX_R10(r13)
        std     r12,HSTATE_SCRATCH0(r13)
        sldi    r12,r9,32
+       /* HSRR variants have the 0x2 bit added to their trap number */
+       .if \hsrr
+       ori     r12,r12,(\n + 0x2)
+       .else
        ori     r12,r12,(\n)
+       .endif
        /* This reloads r9 before branching to kvmppc_interrupt */
        __BRANCH_TO_KVM_EXIT(\area, kvmppc_interrupt)
 
index 518d9758b41e5d6940524a36debdfbd947847a0b..bdd67a26e9593d2a8369a01b7d2ac889791e7b76 100644 (file)
@@ -393,16 +393,13 @@ name:
        TRAMP_KVM_BEGIN(do_kvm_##n);                                    \
        KVM_HANDLER area, EXC_STD, n, 1
 
-/*
- * HV variant exceptions get the 0x2 bit added to their trap number.
- */
 #define TRAMP_KVM_HV(area, n)                                          \
        TRAMP_KVM_BEGIN(do_kvm_H##n);                                   \
-       KVM_HANDLER area, EXC_HV, n + 0x2, 0
+       KVM_HANDLER area, EXC_HV, n, 0
 
 #define TRAMP_KVM_HV_SKIP(area, n)                                     \
        TRAMP_KVM_BEGIN(do_kvm_H##n);                                   \
-       KVM_HANDLER area, EXC_HV, n + 0x2, 1
+       KVM_HANDLER area, EXC_HV, n, 1
 
 #define EXC_COMMON(name, realvec, hdlr)                                        \
        EXC_COMMON_BEGIN(name);                                         \