Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"The main change is we're reverting the initial stack protector support
we merged this cycle. It turns out to not work on toolchains built
with libc support, and fixing it will be need to wait for another
release.

And the rest are all fairly minor:

- Some pasemi machines were not booting due to a missing error check
in prom_find_boot_cpu()

- In EEH we were checking a pointer rather than the bool it pointed
to

- The clang build was broken by a BUILD_BUG_ON() we added.

- The radix (Power9 only) version of map_kernel_page() was broken if
our memory size was a multiple of 2MB, which it generally isn't

Thanks to: Darren Stevens, Gavin Shan, Reza Arbab"

* tag 'powerpc-4.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/mm: Use the correct pointer when setting a 2MB pte
powerpc: Fix build failure with clang due to BUILD_BUG_ON()
powerpc: Revert the initial stack protector support
powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()
powerpc: Add missing error check to prom_find_boot_cpu()

+11 -62
-1
arch/powerpc/Kconfig
··· 164 164 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE 165 165 select HAVE_ARCH_HARDENED_USERCOPY 166 166 select HAVE_KERNEL_GZIP 167 - select HAVE_CC_STACKPROTECTOR 168 167 169 168 config GENERIC_CSUM 170 169 def_bool CPU_LITTLE_ENDIAN
+2
arch/powerpc/include/asm/cpu_has_feature.h
··· 23 23 { 24 24 int i; 25 25 26 + #ifndef __clang__ /* clang can't cope with this */ 26 27 BUILD_BUG_ON(!__builtin_constant_p(feature)); 28 + #endif 27 29 28 30 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 29 31 if (!static_key_initialized) {
+2
arch/powerpc/include/asm/mmu.h
··· 160 160 { 161 161 int i; 162 162 163 + #ifndef __clang__ /* clang can't cope with this */ 163 164 BUILD_BUG_ON(!__builtin_constant_p(feature)); 165 + #endif 164 166 165 167 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 166 168 if (!static_key_initialized) {
-40
arch/powerpc/include/asm/stackprotector.h
··· 1 - /* 2 - * GCC stack protector support. 3 - * 4 - * Stack protector works by putting predefined pattern at the start of 5 - * the stack frame and verifying that it hasn't been overwritten when 6 - * returning from the function. The pattern is called stack canary 7 - * and gcc expects it to be defined by a global variable called 8 - * "__stack_chk_guard" on PPC. This unfortunately means that on SMP 9 - * we cannot have a different canary value per task. 10 - */ 11 - 12 - #ifndef _ASM_STACKPROTECTOR_H 13 - #define _ASM_STACKPROTECTOR_H 14 - 15 - #include <linux/random.h> 16 - #include <linux/version.h> 17 - #include <asm/reg.h> 18 - 19 - extern unsigned long __stack_chk_guard; 20 - 21 - /* 22 - * Initialize the stackprotector canary value. 23 - * 24 - * NOTE: this must only be called from functions that never return, 25 - * and it must always be inlined. 26 - */ 27 - static __always_inline void boot_init_stack_canary(void) 28 - { 29 - unsigned long canary; 30 - 31 - /* Try to get a semi random initial value. */ 32 - get_random_bytes(&canary, sizeof(canary)); 33 - canary ^= mftb(); 34 - canary ^= LINUX_VERSION_CODE; 35 - 36 - current->stack_canary = canary; 37 - __stack_chk_guard = current->stack_canary; 38 - } 39 - 40 - #endif /* _ASM_STACKPROTECTOR_H */
-4
arch/powerpc/kernel/Makefile
··· 19 19 CFLAGS_btext.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) 20 20 CFLAGS_prom.o += $(DISABLE_LATENT_ENTROPY_PLUGIN) 21 21 22 - # -fstack-protector triggers protection checks in this code, 23 - # but it is being used too early to link to meaningful stack_chk logic. 24 - CFLAGS_prom_init.o += $(call cc-option, -fno-stack-protector) 25 - 26 22 ifdef CONFIG_FUNCTION_TRACER 27 23 # Do not trace early boot code 28 24 CFLAGS_REMOVE_cputable.o = -mno-sched-epilog $(CC_FLAGS_FTRACE)
-3
arch/powerpc/kernel/asm-offsets.c
··· 91 91 DEFINE(TI_livepatch_sp, offsetof(struct thread_info, livepatch_sp)); 92 92 #endif 93 93 94 - #ifdef CONFIG_CC_STACKPROTECTOR 95 - DEFINE(TSK_STACK_CANARY, offsetof(struct task_struct, stack_canary)); 96 - #endif 97 94 DEFINE(KSP, offsetof(struct thread_struct, ksp)); 98 95 DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); 99 96 #ifdef CONFIG_BOOKE
+1 -1
arch/powerpc/kernel/eeh_driver.c
··· 545 545 static void *__eeh_clear_pe_frozen_state(void *data, void *flag) 546 546 { 547 547 struct eeh_pe *pe = (struct eeh_pe *)data; 548 - bool *clear_sw_state = flag; 548 + bool clear_sw_state = *(bool *)flag; 549 549 int i, rc = 1; 550 550 551 551 for (i = 0; rc && i < 3; i++)
+1 -5
arch/powerpc/kernel/entry_32.S
··· 674 674 mtspr SPRN_SPEFSCR,r0 /* restore SPEFSCR reg */ 675 675 END_FTR_SECTION_IFSET(CPU_FTR_SPE) 676 676 #endif /* CONFIG_SPE */ 677 - #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP) 678 - lwz r0,TSK_STACK_CANARY(r2) 679 - lis r4,__stack_chk_guard@ha 680 - stw r0,__stack_chk_guard@l(r4) 681 - #endif 677 + 682 678 lwz r0,_CCR(r1) 683 679 mtcrf 0xFF,r0 684 680 /* r3-r12 are destroyed -- Cort */
-6
arch/powerpc/kernel/process.c
··· 64 64 #include <linux/kprobes.h> 65 65 #include <linux/kdebug.h> 66 66 67 - #ifdef CONFIG_CC_STACKPROTECTOR 68 - #include <linux/stackprotector.h> 69 - unsigned long __stack_chk_guard __read_mostly; 70 - EXPORT_SYMBOL(__stack_chk_guard); 71 - #endif 72 - 73 67 /* Transactional Memory debug */ 74 68 #ifdef TM_DEBUG_SW 75 69 #define TM_DEBUG(x...) printk(KERN_INFO x)
+3
arch/powerpc/kernel/prom_init.c
··· 2834 2834 2835 2835 cpu_pkg = call_prom("instance-to-package", 1, 1, prom_cpu); 2836 2836 2837 + if (!PHANDLE_VALID(cpu_pkg)) 2838 + return; 2839 + 2837 2840 prom_getprop(cpu_pkg, "reg", &rval, sizeof(rval)); 2838 2841 prom.cpu = be32_to_cpu(rval); 2839 2842
+2 -2
arch/powerpc/mm/pgtable-radix.c
··· 65 65 if (!pmdp) 66 66 return -ENOMEM; 67 67 if (map_page_size == PMD_SIZE) { 68 - ptep = (pte_t *)pudp; 68 + ptep = pmdp_ptep(pmdp); 69 69 goto set_the_pte; 70 70 } 71 71 ptep = pte_alloc_kernel(pmdp, ea); ··· 90 90 } 91 91 pmdp = pmd_offset(pudp, ea); 92 92 if (map_page_size == PMD_SIZE) { 93 - ptep = (pte_t *)pudp; 93 + ptep = pmdp_ptep(pmdp); 94 94 goto set_the_pte; 95 95 } 96 96 if (!pmd_present(*pmdp)) {