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 branch 'parisc-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc fixes from Helge Deller:

- Unbreak parisc bootloader by avoiding a gcc-7 optimization to convert
multiple byte-accesses into one word-access.

- Add missing HWPOISON page fault handler code. I completely missed
that when I added HWPOISON support during this merge window and it
only showed up now with the madvise07 LTP test case.

- Fix backtrace unwinding to stop when stack start has been reached.

- Issue warning if initrd has been loaded into memory regions with
broken RAM modules.

- Fix HPMC handler (parisc hardware fault handler) to comply with
architecture specification.

- Avoid compiler warnings about too large frame sizes.

- Minor init-section fixes.

* 'parisc-4.14-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
parisc: Unbreak bootloader due to gcc-7 optimizations
parisc: Reintroduce option to gzip-compress the kernel
parisc: Add HWPOISON page fault handler code
parisc: Move init_per_cpu() into init section
parisc: Check if initrd was loaded into broken RAM
parisc: Add PDCE_CHECK instruction to HPMC handler
parisc: Add wrapper for pdc_instr() firmware function
parisc: Move start_parisc() into init section
parisc: Stop unwinding at start of stack
parisc: Fix too large frame size warnings

+108 -14
+12
arch/parisc/Kconfig
··· 257 257 258 258 endchoice 259 259 260 + config PARISC_SELF_EXTRACT 261 + bool "Build kernel as self-extracting executable" 262 + default y 263 + help 264 + Say Y if you want to build the parisc kernel as a kind of 265 + self-extracting executable. 266 + 267 + If you say N here, the kernel will be compressed with gzip 268 + which can be loaded by the palo bootloader directly too. 269 + 270 + If you don't know what to do here, say Y. 271 + 260 272 config SMP 261 273 bool "Symmetric multi-processing support" 262 274 ---help---
+5
arch/parisc/Makefile
··· 129 129 bzImage: vmlinux 130 130 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 131 131 132 + ifdef CONFIG_PARISC_SELF_EXTRACT 132 133 vmlinuz: bzImage 133 134 $(OBJCOPY) $(boot)/bzImage $@ 135 + else 136 + vmlinuz: vmlinux 137 + @gzip -cf -9 $< > $@ 138 + endif 134 139 135 140 install: 136 141 $(CONFIG_SHELL) $(src)/arch/parisc/install.sh \
+1 -1
arch/parisc/boot/compressed/Makefile
··· 15 15 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER 16 16 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING 17 17 KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks 18 - KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs 18 + KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os 19 19 ifndef CONFIG_64BIT 20 20 KBUILD_CFLAGS += -mfast-indirect-calls 21 21 endif
+2 -1
arch/parisc/boot/compressed/misc.c
··· 24 24 /* Symbols defined by linker scripts */ 25 25 extern char input_data[]; 26 26 extern int input_len; 27 - extern __le32 output_len; /* at unaligned address, little-endian */ 27 + /* output_len is inserted by the linker possibly at an unaligned address */ 28 + extern __le32 output_len __aligned(1); 28 29 extern char _text, _end; 29 30 extern char _bss, _ebss; 30 31 extern char _startcode_end;
+1
arch/parisc/include/asm/pdc.h
··· 280 280 /* wrapper-functions from pdc.c */ 281 281 282 282 int pdc_add_valid(unsigned long address); 283 + int pdc_instr(unsigned int *instr); 283 284 int pdc_chassis_info(struct pdc_chassis_info *chassis_info, void *led_info, unsigned long len); 284 285 int pdc_chassis_disp(unsigned long disp); 285 286 int pdc_chassis_warn(unsigned long *warn);
+1
arch/parisc/include/asm/smp.h
··· 1 1 #ifndef __ASM_SMP_H 2 2 #define __ASM_SMP_H 3 3 4 + extern int init_per_cpu(int cpuid); 4 5 5 6 #if defined(CONFIG_SMP) 6 7
+20
arch/parisc/kernel/firmware.c
··· 233 233 EXPORT_SYMBOL(pdc_add_valid); 234 234 235 235 /** 236 + * pdc_instr - Get instruction that invokes PDCE_CHECK in HPMC handler. 237 + * @instr: Pointer to variable which will get instruction opcode. 238 + * 239 + * The return value is PDC_OK (0) in case call succeeded. 240 + */ 241 + int __init pdc_instr(unsigned int *instr) 242 + { 243 + int retval; 244 + unsigned long flags; 245 + 246 + spin_lock_irqsave(&pdc_lock, flags); 247 + retval = mem_pdc_call(PDC_INSTR, 0UL, __pa(pdc_result)); 248 + convert_to_wide(pdc_result); 249 + *instr = pdc_result[0]; 250 + spin_unlock_irqrestore(&pdc_lock, flags); 251 + 252 + return retval; 253 + } 254 + 255 + /** 236 256 * pdc_chassis_info - Return chassis information. 237 257 * @result: The return buffer. 238 258 * @chassis_info: The memory buffer address.
+9
arch/parisc/kernel/pdt.c
··· 15 15 #include <linux/memblock.h> 16 16 #include <linux/seq_file.h> 17 17 #include <linux/kthread.h> 18 + #include <linux/initrd.h> 18 19 19 20 #include <asm/pdc.h> 20 21 #include <asm/pdcpat.h> ··· 217 216 } 218 217 219 218 for (i = 0; i < pdt_status.pdt_entries; i++) { 219 + unsigned long addr; 220 + 220 221 report_mem_err(pdt_entry[i]); 222 + 223 + addr = pdt_entry[i] & PDT_ADDR_PHYS_MASK; 224 + if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && 225 + addr >= initrd_start && addr < initrd_end) 226 + pr_crit("CRITICAL: initrd possibly broken " 227 + "due to bad memory!\n"); 221 228 222 229 /* mark memory page bad */ 223 230 memblock_reserve(pdt_entry[i] & PAGE_MASK, PAGE_SIZE);
+1 -1
arch/parisc/kernel/processor.c
··· 317 317 * 318 318 * o Enable CPU profiling hooks. 319 319 */ 320 - int init_per_cpu(int cpunum) 320 + int __init init_per_cpu(int cpunum) 321 321 { 322 322 int ret; 323 323 struct pdc_coproc_cfg coproc_cfg;
+3 -3
arch/parisc/kernel/setup.c
··· 38 38 #include <linux/export.h> 39 39 #include <linux/sched.h> 40 40 #include <linux/sched/clock.h> 41 + #include <linux/start_kernel.h> 41 42 42 43 #include <asm/processor.h> 43 44 #include <asm/sections.h> ··· 49 48 #include <asm/io.h> 50 49 #include <asm/setup.h> 51 50 #include <asm/unwind.h> 51 + #include <asm/smp.h> 52 52 53 53 static char __initdata command_line[COMMAND_LINE_SIZE]; 54 54 ··· 117 115 } 118 116 #endif 119 117 120 - extern int init_per_cpu(int cpuid); 121 118 extern void collect_boot_cpu_data(void); 122 119 123 120 void __init setup_arch(char **cmdline_p) ··· 399 398 } 400 399 arch_initcall(parisc_init); 401 400 402 - void start_parisc(void) 401 + void __init start_parisc(void) 403 402 { 404 - extern void start_kernel(void); 405 403 extern void early_trap_init(void); 406 404 407 405 int ret, cpunum;
+1 -2
arch/parisc/kernel/smp.c
··· 255 255 static void __init 256 256 smp_cpu_init(int cpunum) 257 257 { 258 - extern int init_per_cpu(int); /* arch/parisc/kernel/processor.c */ 259 258 extern void init_IRQ(void); /* arch/parisc/kernel/irq.c */ 260 259 extern void start_cpu_itimer(void); /* arch/parisc/kernel/time.c */ 261 260 262 261 /* Set modes and Enable floating point coprocessor */ 263 - (void) init_per_cpu(cpunum); 262 + init_per_cpu(cpunum); 264 263 265 264 disable_sr_hashing(); 266 265
+9 -1
arch/parisc/kernel/traps.c
··· 817 817 u32 check = 0; 818 818 u32 *ivap; 819 819 u32 *hpmcp; 820 - u32 length; 820 + u32 length, instr; 821 821 822 822 if (strcmp((const char *)iva, "cows can fly")) 823 823 panic("IVT invalid"); ··· 826 826 827 827 for (i = 0; i < 8; i++) 828 828 *ivap++ = 0; 829 + 830 + /* 831 + * Use PDC_INSTR firmware function to get instruction that invokes 832 + * PDCE_CHECK in HPMC handler. See programming note at page 1-31 of 833 + * the PA 1.1 Firmware Architecture document. 834 + */ 835 + if (pdc_instr(&instr) == PDC_OK) 836 + ivap[0] = instr; 829 837 830 838 /* Compute Checksum for HPMC handler */ 831 839 length = os_hpmc_size;
+12
arch/parisc/kernel/unwind.c
··· 14 14 #include <linux/slab.h> 15 15 #include <linux/kallsyms.h> 16 16 #include <linux/sort.h> 17 + #include <linux/sched.h> 17 18 18 19 #include <linux/uaccess.h> 19 20 #include <asm/assembly.h> ··· 280 279 281 280 info->prev_sp = sp - 64; 282 281 info->prev_ip = 0; 282 + 283 + /* The stack is at the end inside the thread_union 284 + * struct. If we reach data, we have reached the 285 + * beginning of the stack and should stop unwinding. */ 286 + if (info->prev_sp >= (unsigned long) task_thread_info(info->t) && 287 + info->prev_sp < ((unsigned long) task_thread_info(info->t) 288 + + THREAD_SZ_ALGN)) { 289 + info->prev_sp = 0; 290 + break; 291 + } 292 + 283 293 if (get_user(tmp, (unsigned long *)(info->prev_sp - RP_OFFSET))) 284 294 break; 285 295 info->prev_ip = tmp;
+29 -4
arch/parisc/mm/fault.c
··· 17 17 #include <linux/interrupt.h> 18 18 #include <linux/extable.h> 19 19 #include <linux/uaccess.h> 20 + #include <linux/hugetlb.h> 20 21 21 22 #include <asm/traps.h> 22 23 ··· 262 261 struct task_struct *tsk; 263 262 struct mm_struct *mm; 264 263 unsigned long acc_type; 265 - int fault; 264 + int fault = 0; 266 265 unsigned int flags; 267 266 268 267 if (faulthandler_disabled()) ··· 316 315 goto out_of_memory; 317 316 else if (fault & VM_FAULT_SIGSEGV) 318 317 goto bad_area; 319 - else if (fault & VM_FAULT_SIGBUS) 318 + else if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON| 319 + VM_FAULT_HWPOISON_LARGE)) 320 320 goto bad_area; 321 321 BUG(); 322 322 } ··· 354 352 355 353 if (user_mode(regs)) { 356 354 struct siginfo si; 357 - 358 - show_signal_msg(regs, code, address, tsk, vma); 355 + unsigned int lsb = 0; 359 356 360 357 switch (code) { 361 358 case 15: /* Data TLB miss fault/Data page fault */ ··· 387 386 si.si_code = (code == 26) ? SEGV_ACCERR : SEGV_MAPERR; 388 387 break; 389 388 } 389 + 390 + #ifdef CONFIG_MEMORY_FAILURE 391 + if (fault & (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE)) { 392 + printk(KERN_ERR 393 + "MCE: Killing %s:%d due to hardware memory corruption fault at %08lx\n", 394 + tsk->comm, tsk->pid, address); 395 + si.si_signo = SIGBUS; 396 + si.si_code = BUS_MCEERR_AR; 397 + } 398 + #endif 399 + 400 + /* 401 + * Either small page or large page may be poisoned. 402 + * In other words, VM_FAULT_HWPOISON_LARGE and 403 + * VM_FAULT_HWPOISON are mutually exclusive. 404 + */ 405 + if (fault & VM_FAULT_HWPOISON_LARGE) 406 + lsb = hstate_index_to_shift(VM_FAULT_GET_HINDEX(fault)); 407 + else if (fault & VM_FAULT_HWPOISON) 408 + lsb = PAGE_SHIFT; 409 + else 410 + show_signal_msg(regs, code, address, tsk, vma); 411 + si.si_addr_lsb = lsb; 412 + 390 413 si.si_errno = 0; 391 414 si.si_addr = (void __user *) address; 392 415 force_sig_info(si.si_signo, &si, current);
+2 -1
lib/Kconfig.debug
··· 219 219 range 0 8192 220 220 default 0 if KASAN 221 221 default 2048 if GCC_PLUGIN_LATENT_ENTROPY 222 - default 1024 if !64BIT 222 + default 1280 if (!64BIT && PARISC) 223 + default 1024 if (!64BIT && !PARISC) 223 224 default 2048 if 64BIT 224 225 help 225 226 Tell gcc to warn at build time for stack frames larger than this.