Skip to content

Commit 75b9695

Browse files
npigginmpe
authored andcommitted
powerpc/64s: reconcile interrupts in C
There is no need for this to be in asm, use the new intrrupt entry wrapper. Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f821bc9 commit 75b9695

File tree

2 files changed

+11
-30
lines changed

2 files changed

+11
-30
lines changed

arch/powerpc/include/asm/interrupt.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ struct interrupt_state {
1414

1515
static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrupt_state *state)
1616
{
17-
#ifdef CONFIG_PPC_BOOK3E_64
18-
state->ctx_state = exception_enter();
19-
#endif
20-
17+
/*
18+
* Book3E reconciles irq soft mask in asm
19+
*/
2120
#ifdef CONFIG_PPC_BOOK3S_64
21+
if (irq_soft_mask_set_return(IRQS_ALL_DISABLED) == IRQS_ENABLED)
22+
trace_hardirqs_off();
23+
local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
24+
2225
if (user_mode(regs)) {
2326
CT_WARN_ON(ct_state() != CONTEXT_USER);
2427
user_exit_irqoff();
@@ -31,6 +34,10 @@ static inline void interrupt_enter_prepare(struct pt_regs *regs, struct interrup
3134
CT_WARN_ON(ct_state() != CONTEXT_KERNEL);
3235
}
3336
#endif
37+
38+
#ifdef CONFIG_PPC_BOOK3E_64
39+
state->ctx_state = exception_enter();
40+
#endif
3441
}
3542

3643
/*

arch/powerpc/kernel/exceptions-64s.S

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ name:
139139
#define IKVM_VIRT .L_IKVM_VIRT_\name\() /* Virt entry tests KVM */
140140
#define ISTACK .L_ISTACK_\name\() /* Set regular kernel stack */
141141
#define __ISTACK(name) .L_ISTACK_ ## name
142-
#define IRECONCILE .L_IRECONCILE_\name\() /* Do RECONCILE_IRQ_STATE */
143142
#define IKUAP .L_IKUAP_\name\() /* Do KUAP lock */
144143

145144
#define INT_DEFINE_BEGIN(n) \
@@ -203,9 +202,6 @@ do_define_int n
203202
.ifndef ISTACK
204203
ISTACK=1
205204
.endif
206-
.ifndef IRECONCILE
207-
IRECONCILE=1
208-
.endif
209205
.ifndef IKUAP
210206
IKUAP=1
211207
.endif
@@ -653,10 +649,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_CFAR)
653649
.if ISTACK
654650
ACCOUNT_STOLEN_TIME
655651
.endif
656-
657-
.if IRECONCILE
658-
RECONCILE_IRQ_STATE(r10, r11)
659-
.endif
660652
.endm
661653

662654
/*
@@ -935,7 +927,6 @@ INT_DEFINE_BEGIN(system_reset)
935927
*/
936928
ISET_RI=0
937929
ISTACK=0
938-
IRECONCILE=0
939930
IKVM_REAL=1
940931
INT_DEFINE_END(system_reset)
941932

@@ -1123,7 +1114,6 @@ INT_DEFINE_BEGIN(machine_check_early)
11231114
ISTACK=0
11241115
IDAR=1
11251116
IDSISR=1
1126-
IRECONCILE=0
11271117
IKUAP=0 /* We don't touch AMR here, we never go to virtual mode */
11281118
INT_DEFINE_END(machine_check_early)
11291119

@@ -1483,7 +1473,6 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
14831473
INT_DEFINE_BEGIN(data_access_slb)
14841474
IVEC=0x380
14851475
IAREA=PACA_EXSLB
1486-
IRECONCILE=0
14871476
IDAR=1
14881477
IKVM_SKIP=1
14891478
IKVM_REAL=1
@@ -1510,7 +1499,6 @@ MMU_FTR_SECTION_ELSE
15101499
li r3,-EFAULT
15111500
ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
15121501
std r3,RESULT(r1)
1513-
RECONCILE_IRQ_STATE(r10, r11)
15141502
addi r3,r1,STACK_FRAME_OVERHEAD
15151503
bl do_bad_slb_fault
15161504
b interrupt_return
@@ -1568,7 +1556,6 @@ ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
15681556
INT_DEFINE_BEGIN(instruction_access_slb)
15691557
IVEC=0x480
15701558
IAREA=PACA_EXSLB
1571-
IRECONCILE=0
15721559
IISIDE=1
15731560
IDAR=1
15741561
#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
@@ -1597,7 +1584,6 @@ MMU_FTR_SECTION_ELSE
15971584
li r3,-EFAULT
15981585
ALT_MMU_FTR_SECTION_END_IFCLR(MMU_FTR_TYPE_RADIX)
15991586
std r3,RESULT(r1)
1600-
RECONCILE_IRQ_STATE(r10, r11)
16011587
addi r3,r1,STACK_FRAME_OVERHEAD
16021588
bl do_bad_slb_fault
16031589
b interrupt_return
@@ -1757,7 +1743,6 @@ EXC_COMMON_BEGIN(program_check_common)
17571743
*/
17581744
INT_DEFINE_BEGIN(fp_unavailable)
17591745
IVEC=0x800
1760-
IRECONCILE=0
17611746
#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
17621747
IKVM_REAL=1
17631748
#endif
@@ -1772,7 +1757,6 @@ EXC_VIRT_END(fp_unavailable, 0x4800, 0x100)
17721757
EXC_COMMON_BEGIN(fp_unavailable_common)
17731758
GEN_COMMON fp_unavailable
17741759
bne 1f /* if from user, just load it up */
1775-
RECONCILE_IRQ_STATE(r10, r11)
17761760
addi r3,r1,STACK_FRAME_OVERHEAD
17771761
bl kernel_fp_unavailable_exception
17781762
0: trap
@@ -1791,7 +1775,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_TM)
17911775
b fast_interrupt_return
17921776
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
17931777
2: /* User process was in a transaction */
1794-
RECONCILE_IRQ_STATE(r10, r11)
17951778
addi r3,r1,STACK_FRAME_OVERHEAD
17961779
bl fp_unavailable_tm
17971780
b interrupt_return
@@ -1856,7 +1839,6 @@ INT_DEFINE_BEGIN(hdecrementer)
18561839
IVEC=0x980
18571840
IHSRR=1
18581841
ISTACK=0
1859-
IRECONCILE=0
18601842
IKVM_REAL=1
18611843
IKVM_VIRT=1
18621844
INT_DEFINE_END(hdecrementer)
@@ -2230,7 +2212,6 @@ INT_DEFINE_BEGIN(hmi_exception_early)
22302212
IHSRR=1
22312213
IREALMODE_COMMON=1
22322214
ISTACK=0
2233-
IRECONCILE=0
22342215
IKUAP=0 /* We don't touch AMR here, we never go to virtual mode */
22352216
IKVM_REAL=1
22362217
INT_DEFINE_END(hmi_exception_early)
@@ -2404,7 +2385,6 @@ EXC_COMMON_BEGIN(performance_monitor_common)
24042385
*/
24052386
INT_DEFINE_BEGIN(altivec_unavailable)
24062387
IVEC=0xf20
2407-
IRECONCILE=0
24082388
#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
24092389
IKVM_REAL=1
24102390
#endif
@@ -2434,15 +2414,13 @@ BEGIN_FTR_SECTION
24342414
b fast_interrupt_return
24352415
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
24362416
2: /* User process was in a transaction */
2437-
RECONCILE_IRQ_STATE(r10, r11)
24382417
addi r3,r1,STACK_FRAME_OVERHEAD
24392418
bl altivec_unavailable_tm
24402419
b interrupt_return
24412420
#endif
24422421
1:
24432422
END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
24442423
#endif
2445-
RECONCILE_IRQ_STATE(r10, r11)
24462424
addi r3,r1,STACK_FRAME_OVERHEAD
24472425
bl altivec_unavailable_exception
24482426
b interrupt_return
@@ -2458,7 +2436,6 @@ END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)
24582436
*/
24592437
INT_DEFINE_BEGIN(vsx_unavailable)
24602438
IVEC=0xf40
2461-
IRECONCILE=0
24622439
#ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
24632440
IKVM_REAL=1
24642441
#endif
@@ -2487,15 +2464,13 @@ BEGIN_FTR_SECTION
24872464
b load_up_vsx
24882465
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
24892466
2: /* User process was in a transaction */
2490-
RECONCILE_IRQ_STATE(r10, r11)
24912467
addi r3,r1,STACK_FRAME_OVERHEAD
24922468
bl vsx_unavailable_tm
24932469
b interrupt_return
24942470
#endif
24952471
1:
24962472
END_FTR_SECTION_IFSET(CPU_FTR_VSX)
24972473
#endif
2498-
RECONCILE_IRQ_STATE(r10, r11)
24992474
addi r3,r1,STACK_FRAME_OVERHEAD
25002475
bl vsx_unavailable_exception
25012476
b interrupt_return
@@ -2830,7 +2805,6 @@ EXC_VIRT_NONE(0x5800, 0x100)
28302805
INT_DEFINE_BEGIN(soft_nmi)
28312806
IVEC=0x900
28322807
ISTACK=0
2833-
IRECONCILE=0 /* Soft-NMI may fire under local_irq_disable */
28342808
INT_DEFINE_END(soft_nmi)
28352809

28362810
/*

0 commit comments

Comments
 (0)