Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -100,7 +100,8 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c decompress.c main.c \
|
||||
ns16550.c serial.c simple_alloc.c div64.S util.S \
|
||||
elf_util.c $(zlib-y) devtree.c stdlib.c \
|
||||
oflib.c ofconsole.c cuboot.c mpsc.c cpm-serial.c \
|
||||
uartlite.c mpc52xx-psc.c opal.c opal-calls.S
|
||||
uartlite.c mpc52xx-psc.c opal.c
|
||||
src-wlib-$(CONFIG_PPC64_BOOT_WRAPPER) += opal-calls.S
|
||||
src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
|
||||
src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
|
||||
src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
|
||||
|
@@ -232,8 +232,12 @@ void start(void)
|
||||
console_ops.close();
|
||||
|
||||
kentry = (kernel_entry_t) vmlinux.addr;
|
||||
if (ft_addr)
|
||||
kentry(ft_addr, 0, NULL);
|
||||
if (ft_addr) {
|
||||
if(platform_ops.kentry)
|
||||
platform_ops.kentry(ft_addr, vmlinux.addr);
|
||||
else
|
||||
kentry(ft_addr, 0, NULL);
|
||||
}
|
||||
else
|
||||
kentry((unsigned long)initrd.addr, initrd.size,
|
||||
loader_info.promptr);
|
||||
|
@@ -12,6 +12,19 @@
|
||||
|
||||
.text
|
||||
|
||||
.globl opal_kentry
|
||||
opal_kentry:
|
||||
/* r3 is the fdt ptr */
|
||||
mtctr r4
|
||||
li r4, 0
|
||||
li r5, 0
|
||||
li r6, 0
|
||||
li r7, 0
|
||||
ld r11,opal@got(r2)
|
||||
ld r8,0(r11)
|
||||
ld r9,8(r11)
|
||||
bctr
|
||||
|
||||
#define OPAL_CALL(name, token) \
|
||||
.globl name; \
|
||||
name: \
|
||||
|
@@ -13,7 +13,7 @@
|
||||
#include <libfdt.h>
|
||||
#include "../include/asm/opal-api.h"
|
||||
|
||||
#ifdef __powerpc64__
|
||||
#ifdef CONFIG_PPC64_BOOT_WRAPPER
|
||||
|
||||
/* Global OPAL struct used by opal-call.S */
|
||||
struct opal {
|
||||
@@ -23,14 +23,25 @@ struct opal {
|
||||
|
||||
static u32 opal_con_id;
|
||||
|
||||
/* see opal-wrappers.S */
|
||||
int64_t opal_console_write(int64_t term_number, u64 *length, const u8 *buffer);
|
||||
int64_t opal_console_read(int64_t term_number, uint64_t *length, u8 *buffer);
|
||||
int64_t opal_console_write_buffer_space(uint64_t term_number, uint64_t *length);
|
||||
int64_t opal_console_flush(uint64_t term_number);
|
||||
int64_t opal_poll_events(uint64_t *outstanding_event_mask);
|
||||
|
||||
void opal_kentry(unsigned long fdt_addr, void *vmlinux_addr);
|
||||
|
||||
static int opal_con_open(void)
|
||||
{
|
||||
/*
|
||||
* When OPAL loads the boot kernel it stashes the OPAL base and entry
|
||||
* address in r8 and r9 so the kernel can use the OPAL console
|
||||
* before unflattening the devicetree. While executing the wrapper will
|
||||
* probably trash r8 and r9 so this kentry hook restores them before
|
||||
* entering the decompressed kernel.
|
||||
*/
|
||||
platform_ops.kentry = opal_kentry;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -30,6 +30,7 @@ struct platform_ops {
|
||||
void * (*realloc)(void *ptr, unsigned long size);
|
||||
void (*exit)(void);
|
||||
void * (*vmlinux_alloc)(unsigned long size);
|
||||
void (*kentry)(unsigned long fdt_addr, void *vmlinux_addr);
|
||||
};
|
||||
extern struct platform_ops platform_ops;
|
||||
|
||||
|
@@ -14,6 +14,10 @@
|
||||
|
||||
#include <linux/threads.h>
|
||||
#include <linux/kprobes.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/checksum.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/epapr_hcalls.h>
|
||||
|
||||
#include <uapi/asm/ucontext.h>
|
||||
|
||||
@@ -109,4 +113,12 @@ void early_setup_secondary(void);
|
||||
/* time */
|
||||
void accumulate_stolen_time(void);
|
||||
|
||||
/* misc runtime */
|
||||
extern u64 __bswapdi2(u64);
|
||||
extern s64 __lshrdi3(s64, int);
|
||||
extern s64 __ashldi3(s64, int);
|
||||
extern s64 __ashrdi3(s64, int);
|
||||
extern int __cmpdi2(s64, s64);
|
||||
extern int __ucmpdi2(u64, u64);
|
||||
|
||||
#endif /* _ASM_POWERPC_ASM_PROTOTYPES_H */
|
||||
|
@@ -28,6 +28,12 @@
|
||||
* Individual features below.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Kernel read only support.
|
||||
* We added the ppp value 0b110 in ISA 2.04.
|
||||
*/
|
||||
#define MMU_FTR_KERNEL_RO ASM_CONST(0x00004000)
|
||||
|
||||
/*
|
||||
* We need to clear top 16bits of va (from the remaining 64 bits )in
|
||||
* tlbie* instructions
|
||||
@@ -103,10 +109,10 @@
|
||||
#define MMU_FTRS_POWER4 MMU_FTRS_DEFAULT_HPTE_ARCH_V2
|
||||
#define MMU_FTRS_PPC970 MMU_FTRS_POWER4 | MMU_FTR_TLBIE_CROP_VA
|
||||
#define MMU_FTRS_POWER5 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
|
||||
#define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
|
||||
#define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
|
||||
#define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
|
||||
#define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE
|
||||
#define MMU_FTRS_POWER6 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO
|
||||
#define MMU_FTRS_POWER7 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO
|
||||
#define MMU_FTRS_POWER8 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO
|
||||
#define MMU_FTRS_POWER9 MMU_FTRS_POWER4 | MMU_FTR_LOCKLESS_TLBIE | MMU_FTR_KERNEL_RO
|
||||
#define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
|
||||
MMU_FTR_CI_LARGE_PAGE
|
||||
#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
|
||||
|
@@ -355,6 +355,7 @@
|
||||
#define LPCR_PECE0 ASM_CONST(0x0000000000004000) /* ext. exceptions can cause exit */
|
||||
#define LPCR_PECE1 ASM_CONST(0x0000000000002000) /* decrementer can cause exit */
|
||||
#define LPCR_PECE2 ASM_CONST(0x0000000000001000) /* machine check etc can cause exit */
|
||||
#define LPCR_PECE_HVEE ASM_CONST(0x0000400000000000) /* P9 Wakeup on HV interrupts */
|
||||
#define LPCR_MER ASM_CONST(0x0000000000000800) /* Mediated External Exception */
|
||||
#define LPCR_MER_SH 11
|
||||
#define LPCR_TC ASM_CONST(0x0000000000000200) /* Translation control */
|
||||
|
@@ -98,8 +98,8 @@ _GLOBAL(__setup_cpu_power9)
|
||||
li r0,0
|
||||
mtspr SPRN_LPID,r0
|
||||
mfspr r3,SPRN_LPCR
|
||||
ori r3, r3, LPCR_PECEDH
|
||||
ori r3, r3, LPCR_HVICE
|
||||
LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)
|
||||
or r3, r3, r4
|
||||
bl __init_LPCR
|
||||
bl __init_HFSCR
|
||||
bl __init_tlb_power9
|
||||
@@ -118,8 +118,8 @@ _GLOBAL(__restore_cpu_power9)
|
||||
li r0,0
|
||||
mtspr SPRN_LPID,r0
|
||||
mfspr r3,SPRN_LPCR
|
||||
ori r3, r3, LPCR_PECEDH
|
||||
ori r3, r3, LPCR_HVICE
|
||||
LOAD_REG_IMMEDIATE(r4, LPCR_PECEDH | LPCR_PECE_HVEE | LPCR_HVICE)
|
||||
or r3, r3, r4
|
||||
bl __init_LPCR
|
||||
bl __init_HFSCR
|
||||
bl __init_tlb_power9
|
||||
|
@@ -671,8 +671,10 @@ static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus,
|
||||
|
||||
/* Clear frozen state */
|
||||
rc = eeh_clear_pe_frozen_state(pe, false);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
pci_unlock_rescan_remove();
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Give the system 5 seconds to finish running the user-space
|
||||
* hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
|
||||
|
@@ -94,8 +94,17 @@ SECTIONS
|
||||
* detected, and will result in a crash at boot due to offsets being
|
||||
* wrong.
|
||||
*/
|
||||
#ifdef CONFIG_PPC64
|
||||
/*
|
||||
* BLOCK(0) overrides the default output section alignment because
|
||||
* this needs to start right after .head.text in order for fixed
|
||||
* section placement to work.
|
||||
*/
|
||||
.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
|
||||
#else
|
||||
.text : AT(ADDR(.text) - LOAD_OFFSET) {
|
||||
ALIGN_FUNCTION();
|
||||
#endif
|
||||
/* careful! __ftr_alt_* sections need to be close to .text */
|
||||
*(.text .fixup __ftr_alt_* .ref.text)
|
||||
SCHED_TEXT
|
||||
|
@@ -55,7 +55,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
|
||||
*/
|
||||
rflags = htab_convert_pte_flags(new_pte);
|
||||
|
||||
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
|
||||
rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);
|
||||
|
||||
|
@@ -87,7 +87,7 @@ int __hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
|
||||
subpg_pte = new_pte & ~subpg_prot;
|
||||
rflags = htab_convert_pte_flags(subpg_pte);
|
||||
|
||||
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) {
|
||||
|
||||
/*
|
||||
@@ -258,7 +258,7 @@ int __hash_page_64K(unsigned long ea, unsigned long access,
|
||||
|
||||
rflags = htab_convert_pte_flags(new_pte);
|
||||
|
||||
if (!cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
if (cpu_has_feature(CPU_FTR_NOEXECUTE) &&
|
||||
!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
|
||||
rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap);
|
||||
|
||||
|
@@ -193,8 +193,12 @@ unsigned long htab_convert_pte_flags(unsigned long pteflags)
|
||||
/*
|
||||
* Kernel read only mapped with ppp bits 0b110
|
||||
*/
|
||||
if (!(pteflags & _PAGE_WRITE))
|
||||
rflags |= (HPTE_R_PP0 | 0x2);
|
||||
if (!(pteflags & _PAGE_WRITE)) {
|
||||
if (mmu_has_feature(MMU_FTR_KERNEL_RO))
|
||||
rflags |= (HPTE_R_PP0 | 0x2);
|
||||
else
|
||||
rflags |= 0x3;
|
||||
}
|
||||
} else {
|
||||
if (pteflags & _PAGE_RWX)
|
||||
rflags |= 0x2;
|
||||
|
Reference in New Issue
Block a user