Skip to content

Commit 4f8cf36

Browse files
committed
powerpc: Remove legacy iSeries bits from assembly files
This removes the various bits of assembly in the kernel entry, exception handling and SLB management code that were specific to running under the legacy iSeries hypervisor which is no longer supported. Signed-off-by: Benjamin Herrenschmidt <[email protected]>
1 parent b078766 commit 4f8cf36

File tree

7 files changed

+15
-203
lines changed

7 files changed

+15
-203
lines changed

arch/powerpc/include/asm/exception-64s.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -272,26 +272,11 @@ label##_hv: \
272272
_MASKABLE_EXCEPTION_PSERIES(vec, label, \
273273
EXC_HV, SOFTEN_TEST_HV)
274274

275-
#ifdef CONFIG_PPC_ISERIES
276-
#define DISABLE_INTS \
277-
li r11,0; \
278-
stb r11,PACASOFTIRQEN(r13); \
279-
BEGIN_FW_FTR_SECTION; \
280-
stb r11,PACAHARDIRQEN(r13); \
281-
END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES); \
282-
TRACE_DISABLE_INTS; \
283-
BEGIN_FW_FTR_SECTION; \
284-
mfmsr r10; \
285-
ori r10,r10,MSR_EE; \
286-
mtmsrd r10,1; \
287-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
288-
#else
289275
#define DISABLE_INTS \
290276
li r11,0; \
291277
stb r11,PACASOFTIRQEN(r13); \
292278
stb r11,PACAHARDIRQEN(r13); \
293279
TRACE_DISABLE_INTS
294-
#endif /* CONFIG_PPC_ISERIES */
295280

296281
#define ENABLE_INTS \
297282
ld r12,_MSR(r1); \

arch/powerpc/kernel/entry_64.S

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
127127
stb r10,PACASOFTIRQEN(r13)
128128
stb r10,PACAHARDIRQEN(r13)
129129
std r10,SOFTE(r1)
130-
#ifdef CONFIG_PPC_ISERIES
131-
BEGIN_FW_FTR_SECTION
132-
/* Hack for handling interrupts when soft-enabling on iSeries */
133-
cmpdi cr1,r0,0x5555 /* syscall 0x5555 */
134-
andi. r10,r12,MSR_PR /* from kernel */
135-
crand 4*cr0+eq,4*cr1+eq,4*cr0+eq
136-
bne 2f
137-
b hardware_interrupt_entry
138-
2:
139-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
140-
#endif /* CONFIG_PPC_ISERIES */
141130

142131
/* Hard enable interrupts */
143132
#ifdef CONFIG_PPC_BOOK3E
@@ -591,15 +580,10 @@ _GLOBAL(ret_from_except_lite)
591580
ld r4,TI_FLAGS(r9)
592581
andi. r0,r4,_TIF_USER_WORK_MASK
593582
bne do_work
594-
#endif
583+
#endif /* !CONFIG_PREEMPT */
595584

596585
restore:
597-
BEGIN_FW_FTR_SECTION
598586
ld r5,SOFTE(r1)
599-
FW_FTR_SECTION_ELSE
600-
b .Liseries_check_pending_irqs
601-
ALT_FW_FTR_SECTION_END_IFCLR(FW_FEATURE_ISERIES)
602-
2:
603587
TRACE_AND_RESTORE_IRQ(r5);
604588

605589
/* extract EE bit and use it to restore paca->hard_enabled */
@@ -669,30 +653,6 @@ ALT_FTR_SECTION_END_IFCLR(CPU_FTR_STCX_CHECKS_ADDRESS)
669653

670654
#endif /* CONFIG_PPC_BOOK3E */
671655

672-
.Liseries_check_pending_irqs:
673-
#ifdef CONFIG_PPC_ISERIES
674-
ld r5,SOFTE(r1)
675-
cmpdi 0,r5,0
676-
beq 2b
677-
/* Check for pending interrupts (iSeries) */
678-
ld r3,PACALPPACAPTR(r13)
679-
ld r3,LPPACAANYINT(r3)
680-
cmpdi r3,0
681-
beq+ 2b /* skip do_IRQ if no interrupts */
682-
683-
li r3,0
684-
stb r3,PACASOFTIRQEN(r13) /* ensure we are soft-disabled */
685-
#ifdef CONFIG_TRACE_IRQFLAGS
686-
bl .trace_hardirqs_off
687-
mfmsr r10
688-
#endif
689-
ori r10,r10,MSR_EE
690-
mtmsrd r10 /* hard-enable again */
691-
addi r3,r1,STACK_FRAME_OVERHEAD
692-
bl .do_IRQ
693-
b .ret_from_except_lite /* loop back and handle more */
694-
#endif
695-
696656
do_work:
697657
#ifdef CONFIG_PREEMPT
698658
andi. r0,r3,MSR_PR /* Returning to user mode? */

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

Lines changed: 7 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* We layout physical memory as follows:
2020
* 0x0000 - 0x00ff : Secondary processor spin code
2121
* 0x0100 - 0x2fff : pSeries Interrupt prologs
22-
* 0x3000 - 0x5fff : interrupt support, iSeries and common interrupt prologs
22+
* 0x3000 - 0x5fff : interrupt support common interrupt prologs
2323
* 0x6000 - 0x6fff : Initial (CPU0) segment table
2424
* 0x7000 - 0x7fff : FWNMI data area
2525
* 0x8000 - : Early init and support code
@@ -458,6 +458,7 @@ machine_check_common:
458458
bl .machine_check_exception
459459
b .ret_from_except
460460

461+
STD_EXCEPTION_COMMON_LITE(0x500, hardware_interrupt, do_IRQ)
461462
STD_EXCEPTION_COMMON_LITE(0x900, decrementer, .timer_interrupt)
462463
STD_EXCEPTION_COMMON(0xa00, trap_0a, .unknown_exception)
463464
STD_EXCEPTION_COMMON(0xb00, trap_0b, .unknown_exception)
@@ -672,12 +673,6 @@ _GLOBAL(slb_miss_realmode)
672673
ld r10,PACA_EXSLB+EX_LR(r13)
673674
ld r3,PACA_EXSLB+EX_R3(r13)
674675
lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */
675-
#ifdef CONFIG_PPC_ISERIES
676-
BEGIN_FW_FTR_SECTION
677-
ld r11,PACALPPACAPTR(r13)
678-
ld r11,LPPACASRR0(r11) /* get SRR0 value */
679-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
680-
#endif /* CONFIG_PPC_ISERIES */
681676

682677
mtlr r10
683678

@@ -690,12 +685,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
690685
mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */
691686
.machine pop
692687

693-
#ifdef CONFIG_PPC_ISERIES
694-
BEGIN_FW_FTR_SECTION
695-
mtspr SPRN_SRR0,r11
696-
mtspr SPRN_SRR1,r12
697-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
698-
#endif /* CONFIG_PPC_ISERIES */
699688
ld r9,PACA_EXSLB+EX_R9(r13)
700689
ld r10,PACA_EXSLB+EX_R10(r13)
701690
ld r11,PACA_EXSLB+EX_R11(r13)
@@ -704,13 +693,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
704693
rfid
705694
b . /* prevent speculative execution */
706695

707-
2:
708-
#ifdef CONFIG_PPC_ISERIES
709-
BEGIN_FW_FTR_SECTION
710-
b unrecov_slb
711-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
712-
#endif /* CONFIG_PPC_ISERIES */
713-
mfspr r11,SPRN_SRR0
696+
2: mfspr r11,SPRN_SRR0
714697
ld r10,PACAKBASE(r13)
715698
LOAD_HANDLER(r10,unrecov_slb)
716699
mtspr SPRN_SRR0,r10
@@ -727,20 +710,6 @@ unrecov_slb:
727710
bl .unrecoverable_exception
728711
b 1b
729712

730-
.align 7
731-
.globl hardware_interrupt_common
732-
.globl hardware_interrupt_entry
733-
hardware_interrupt_common:
734-
EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
735-
FINISH_NAP
736-
hardware_interrupt_entry:
737-
DISABLE_INTS
738-
BEGIN_FTR_SECTION
739-
bl .ppc64_runlatch_on
740-
END_FTR_SECTION_IFSET(CPU_FTR_CTRL)
741-
addi r3,r1,STACK_FRAME_OVERHEAD
742-
bl .do_IRQ
743-
b .ret_from_except_lite
744713

745714
#ifdef CONFIG_PPC_970_NAP
746715
power4_fixup_nap:
@@ -913,11 +882,7 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB)
913882
andis. r0,r0,NMI_MASK@h /* (i.e. an irq when soft-disabled) */
914883
bne 77f /* then don't call hash_page now */
915884

916-
/*
917-
* On iSeries, we soft-disable interrupts here, then
918-
* hard-enable interrupts so that the hash_page code can spin on
919-
* the hash_table_lock without problems on a shared processor.
920-
*/
885+
/* We run with interrupts both soft and hard disabled */
921886
DISABLE_INTS
922887

923888
/*
@@ -956,25 +921,11 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB)
956921
bl .hash_page /* build HPTE if possible */
957922
cmpdi r3,0 /* see if hash_page succeeded */
958923

959-
BEGIN_FW_FTR_SECTION
960-
/*
961-
* If we had interrupts soft-enabled at the point where the
962-
* DSI/ISI occurred, and an interrupt came in during hash_page,
963-
* handle it now.
964-
* We jump to ret_from_except_lite rather than fast_exception_return
965-
* because ret_from_except_lite will check for and handle pending
966-
* interrupts if necessary.
967-
*/
968-
beq 13f
969-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
970-
971-
BEGIN_FW_FTR_SECTION
972924
/*
973925
* Here we have interrupts hard-disabled, so it is sufficient
974926
* to restore paca->{soft,hard}_enable and get out.
975927
*/
976928
beq fast_exc_return_irq /* Return from exception on success */
977-
END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
978929

979930
/* For a hash failure, we don't bother re-enabling interrupts */
980931
ble- 12f
@@ -1141,51 +1092,19 @@ _GLOBAL(do_stab_bolted)
11411092
.= 0x7000
11421093
.globl fwnmi_data_area
11431094
fwnmi_data_area:
1144-
#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
1145-
1146-
/* iSeries does not use the FWNMI stuff, so it is safe to put
1147-
* this here, even if we later allow kernels that will boot on
1148-
* both pSeries and iSeries */
1149-
#ifdef CONFIG_PPC_ISERIES
1150-
. = LPARMAP_PHYS
1151-
.globl xLparMap
1152-
xLparMap:
1153-
.quad HvEsidsToMap /* xNumberEsids */
1154-
.quad HvRangesToMap /* xNumberRanges */
1155-
.quad STAB0_PAGE /* xSegmentTableOffs */
1156-
.zero 40 /* xRsvd */
1157-
/* xEsids (HvEsidsToMap entries of 2 quads) */
1158-
.quad PAGE_OFFSET_ESID /* xKernelEsid */
1159-
.quad PAGE_OFFSET_VSID /* xKernelVsid */
1160-
.quad VMALLOC_START_ESID /* xKernelEsid */
1161-
.quad VMALLOC_START_VSID /* xKernelVsid */
1162-
/* xRanges (HvRangesToMap entries of 3 quads) */
1163-
.quad HvPagesToMap /* xPages */
1164-
.quad 0 /* xOffset */
1165-
.quad PAGE_OFFSET_VSID << (SID_SHIFT - HW_PAGE_SHIFT) /* xVPN */
1166-
1167-
#endif /* CONFIG_PPC_ISERIES */
11681095

1169-
#if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV)
11701096
/* pseries and powernv need to keep the whole page from
11711097
* 0x7000 to 0x8000 free for use by the firmware
11721098
*/
11731099
. = 0x8000
11741100
#endif /* defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) */
11751101

1176-
/*
1177-
* Space for CPU0's segment table.
1178-
*
1179-
* On iSeries, the hypervisor must fill in at least one entry before
1180-
* we get control (with relocate on). The address is given to the hv
1181-
* as a page number (see xLparMap above), so this must be at a
1182-
* fixed address (the linker can't compute (u64)&initial_stab >>
1183-
* PAGE_SHIFT).
1184-
*/
1185-
. = STAB0_OFFSET /* 0x8000 */
1102+
/* Space for CPU0's segment table */
1103+
.balign 4096
11861104
.globl initial_stab
11871105
initial_stab:
11881106
.space 4096
1107+
11891108
#ifdef CONFIG_PPC_POWERNV
11901109
_GLOBAL(opal_mc_secondary_handler)
11911110
HMT_MEDIUM

arch/powerpc/kernel/head_64.S

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#include <asm/cputable.h>
3333
#include <asm/setup.h>
3434
#include <asm/hvcall.h>
35-
#include <asm/iseries/lpar_map.h>
3635
#include <asm/thread_info.h>
3736
#include <asm/firmware.h>
3837
#include <asm/page_64.h>
@@ -57,10 +56,6 @@
5756
* entry in r9 for debugging purposes
5857
* 2. Secondary processors enter at 0x60 with PIR in gpr3
5958
*
60-
* For iSeries:
61-
* 1. The MMU is on (as it always is for iSeries)
62-
* 2. The kernel is entered at system_reset_iSeries
63-
*
6459
* For Book3E processors:
6560
* 1. The MMU is on running in AS0 in a state defined in ePAPR
6661
* 2. The kernel is entered at __start
@@ -93,15 +88,6 @@ __secondary_hold_spinloop:
9388
__secondary_hold_acknowledge:
9489
.llong 0x0
9590

96-
#ifdef CONFIG_PPC_ISERIES
97-
/*
98-
* At offset 0x20, there is a pointer to iSeries LPAR data.
99-
* This is required by the hypervisor
100-
*/
101-
. = 0x20
102-
.llong hvReleaseData-KERNELBASE
103-
#endif /* CONFIG_PPC_ISERIES */
104-
10591
#ifdef CONFIG_RELOCATABLE
10692
/* This flag is set to 1 by a loader if the kernel should run
10793
* at the loaded address instead of the linked address. This
@@ -582,7 +568,7 @@ _GLOBAL(pmac_secondary_start)
582568
* 1. Processor number
583569
* 2. Segment table pointer (virtual address)
584570
* On entry the following are set:
585-
* r1 = stack pointer. vaddr for iSeries, raddr (temp stack) for pSeries
571+
* r1 = stack pointer (real addr of temp stack)
586572
* r24 = cpu# (in Linux terms)
587573
* r13 = paca virtual address
588574
* SPRG_PACA = paca virtual address
@@ -595,7 +581,7 @@ __secondary_start:
595581
/* Set thread priority to MEDIUM */
596582
HMT_MEDIUM
597583

598-
/* Initialize the kernel stack. Just a repeat for iSeries. */
584+
/* Initialize the kernel stack */
599585
LOAD_REG_ADDR(r3, current_set)
600586
sldi r28,r24,3 /* get current_set[cpu#] */
601587
ldx r14,r3,r28
@@ -615,20 +601,13 @@ __secondary_start:
615601
li r7,0
616602
mtlr r7
617603

604+
/* Mark interrupts both hard and soft disabled */
605+
stb r7,PACAHARDIRQEN(r13)
606+
stb r7,PACASOFTIRQEN(r13)
607+
618608
/* enable MMU and jump to start_secondary */
619609
LOAD_REG_ADDR(r3, .start_secondary_prolog)
620610
LOAD_REG_IMMEDIATE(r4, MSR_KERNEL)
621-
#ifdef CONFIG_PPC_ISERIES
622-
BEGIN_FW_FTR_SECTION
623-
ori r4,r4,MSR_EE
624-
li r8,1
625-
stb r8,PACAHARDIRQEN(r13)
626-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
627-
#endif
628-
BEGIN_FW_FTR_SECTION
629-
stb r7,PACAHARDIRQEN(r13)
630-
END_FW_FTR_SECTION_IFCLR(FW_FEATURE_ISERIES)
631-
stb r7,PACASOFTIRQEN(r13)
632611

633612
mtspr SPRN_SRR0,r3
634613
mtspr SPRN_SRR1,r4
@@ -774,17 +753,8 @@ _INIT_GLOBAL(start_here_common)
774753
bl .setup_system
775754

776755
/* Load up the kernel context */
777-
5:
778-
li r5,0
756+
5: li r5,0
779757
stb r5,PACASOFTIRQEN(r13) /* Soft Disabled */
780-
#ifdef CONFIG_PPC_ISERIES
781-
BEGIN_FW_FTR_SECTION
782-
mfmsr r5
783-
ori r5,r5,MSR_EE /* Hard Enabled on iSeries*/
784-
mtmsrd r5
785-
li r5,1
786-
END_FW_FTR_SECTION_IFSET(FW_FEATURE_ISERIES)
787-
#endif
788758
stb r5,PACAHARDIRQEN(r13) /* Hard Disabled on others */
789759

790760
bl .start_kernel

arch/powerpc/kernel/misc.S

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Largely rewritten by Cort Dougan ([email protected])
66
* and Paul Mackerras.
77
*
8-
* Adapted for iSeries by Mike Corrigan ([email protected])
98
* PPC64 updates by Dave Engebretsen ([email protected])
109
*
1110
* setjmp/longjmp code by Paul Mackerras.

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@ SECTIONS
109109
__ptov_table_begin = .;
110110
*(.ptov_fixup);
111111
__ptov_table_end = .;
112-
#ifdef CONFIG_PPC_ISERIES
113-
__dt_strings_start = .;
114-
*(.dt_strings);
115-
__dt_strings_end = .;
116-
#endif
117112
}
118113

119114
.init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {

0 commit comments

Comments
 (0)