From 07de4a501f9f17c434c7533a76e782273772fd92 Mon Sep 17 00:00:00 2001 From: torrorosso Date: Tue, 18 Feb 2014 20:58:18 +0300 Subject: [PATCH 1/4] GCC4.8 fix --- arch/arm/boot/compressed/Makefile | 64 ++++++++++++++++--------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index bb267562e7ed..454cc6a494a2 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -5,27 +5,34 @@ # OBJS = +plus_sec := $(call as-instr,.arch_extension sec,+sec) # Ensure that MMCIF loader code appears early in the image # to minimise that number of bocks that have to be read in # order to load it. ifeq ($(CONFIG_ZBOOT_ROM_MMCIF),y) +ifeq ($(CONFIG_ARCH_SH7372),y) OBJS += mmcif-sh7372.o endif - -# Ensure that SDHI loader code appears early in the image -# to minimise that number of bocks that have to be read in -# order to load it. -ifeq ($(CONFIG_ZBOOT_ROM_SH_MOBILE_SDHI),y) -OBJS += sdhi-shmobile.o -OBJS += sdhi-sh7372.o endif -AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) -HEAD = head.o -OBJS += misc.o decompress.o +AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET) +AFLAGS_head.o += -Wa,-march=armv7-a$(plus_sec) +HEAD = head.o + +AFLAGS_misc.o +=-Wa,-march=armv7-a$(plus_sec) +MISC = misc.o + +AFLAGS_decompress.o += -Wa,-march=armv7-a$(plus_sec) +DECOMPRESS = decompress.o + FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c +#AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET) +#HEAD = head.o +#OBJS += misc.o decompress.o +#FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c + # string library code (-Os is enforced to keep it much smaller) OBJS += string.o CFLAGS_string.o := -Os @@ -113,12 +120,10 @@ endif targets := vmlinux vmlinux.lds \ piggy.$(suffix_y) piggy.$(suffix_y).o \ - lib1funcs.o lib1funcs.S ashldi3.o ashldi3.S \ - font.o font.c head.o misc.o $(OBJS) + lib1funcs.o lib1funcs.S font.o font.c head.o misc.o decompress.o $(OBJS) # Make sure files are removed during clean -extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern \ - lib1funcs.S ashldi3.S $(libfdt) $(libfdt_hdrs) +extra-y += piggy.gzip piggy.lzo piggy.lzma piggy.xzkern lib1funcs.S $(libfdt) $(libfdt_hdrs) ifeq ($(CONFIG_FUNCTION_TRACER),y) ORIG_CFLAGS := $(KBUILD_CFLAGS) @@ -129,8 +134,8 @@ ccflags-y := -fpic -fno-builtin -I$(obj) asflags-y := -Wa,-march=all # Supply kernel BSS size to the decompressor via a linker symbol. -KBSS_SZ = $(shell $(CROSS_COMPILE)size $(obj)/../../../../vmlinux | \ - awk 'END{print $$3}') +SIZEBIN := $(if $(shell which $(CROSS_COMPILE)size),$(CROSS_COMPILE)size,size) +KBSS_SZ = $(shell $(SIZEBIN) $(obj)/../../../../vmlinux | awk 'END{print $$3}') LDFLAGS_vmlinux = --defsym _kernel_bss_size=$(KBSS_SZ) # Supply ZRELADDR to the decompressor via a linker symbol. ifneq ($(CONFIG_AUTO_ZRELADDR),y) @@ -139,6 +144,9 @@ endif ifeq ($(CONFIG_CPU_ENDIAN_BE8),y) LDFLAGS_vmlinux += --be8 endif +ifneq ($(PARAMS_PHYS),) +LDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS) +endif # ? LDFLAGS_vmlinux += -p # Report unresolved symbol references @@ -149,17 +157,12 @@ LDFLAGS_vmlinux += -X LDFLAGS_vmlinux += -T # For __aeabi_uidivmod +AFLAGS_lib1funcs.o +=-Wa,-march=armv7-a$(plus_sec) lib1funcs = $(obj)/lib1funcs.o $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S $(call cmd,shipped) -# For __aeabi_llsl -ashldi3 = $(obj)/ashldi3.o - -$(obj)/ashldi3.S: $(srctree)/arch/$(SRCARCH)/lib/ashldi3.S - $(call cmd,shipped) - # We need to prevent any GOTOFF relocs being used with references # to symbols in the .bss section since we cannot relocate them # independently from the rest at run time. This can be achieved by @@ -172,20 +175,19 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ [ -z "$$bad_syms" ] || \ ( echo "following symbols must have non local/private scope:" >&2; \ echo "$$bad_syms" >&2; rm -f $@; false ) +# For __aeabi_llsl +AFLAGS_ashldi3.o +=-Wa,-march=armv7-a$(plus_sec) +ashldi3 = $(obj)/ashldi3.o -check_for_multiple_zreladdr = \ -if [ $(words $(ZRELADDR)) -gt 1 -a "$(CONFIG_AUTO_ZRELADDR)" = "" ]; then \ - echo 'multiple zreladdrs: $(ZRELADDR)'; \ - echo 'This needs CONFIG_AUTO_ZRELADDR to be set'; \ - false; \ -fi +$(obj)/ashldi3.S: $(srctree)/arch/$(SRCARCH)/lib/ashldi3.S FORCE + $(call cmd,shipped) -$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ - $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) FORCE - @$(check_for_multiple_zreladdr) +$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/$(MISC) $(obj)/$(DECOMPRESS) $(obj)/piggy.$(suffix_y).o \ + $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) $(ashldi3) FORCE $(call if_changed,ld) @$(check_for_bad_syms) +AFLAGS_piggy.$(suffix_y).o += -Wa,-march=armv7-a$(plus_sec) $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE $(call if_changed,$(suffix_y)) From 1d31395f43bfa4c0856ca374599ea9d1970fe397 Mon Sep 17 00:00:00 2001 From: torrorosso Date: Tue, 18 Feb 2014 21:00:48 +0300 Subject: [PATCH 2/4] GCC4.8 fix --- arch/arm/lib/memset.S | 155 +++++++++++++++++++++--------------------- 1 file changed, 79 insertions(+), 76 deletions(-) diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S index 650d5923ab83..de102efec87a 100644 --- a/arch/arm/lib/memset.S +++ b/arch/arm/lib/memset.S @@ -1,71 +1,74 @@ /* - * linux/arch/arm/lib/memset.S + * linux/arch/arm/lib/memset.S * - * Copyright (C) 1995-2000 Russell King + * Copyright (C) 1995-2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * - * ASM optimised string functions + * ASM optimised string functions */ #include #include - .text - .align 5 - .word 0 +.text +.align 5 +.word 0 -1: subs r2, r2, #4 @ 1 do we have enough - blt 5f @ 1 bytes to align with? - cmp r3, #2 @ 1 - strltb r1, [r0], #1 @ 1 - strleb r1, [r0], #1 @ 1 - strb r1, [r0], #1 @ 1 - add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) +1: subs r2, r2, #4 @ 1 do we have enough +blt 5f @ 1 bytes to align with? +cmp r3, #2 @ 1 +strltb r1, [ip], #1 @ 1 +strleb r1, [ip], #1 @ 1 +strb r1, [ip], #1 @ 1 +add r2, r2, r3 @ 1 (r2 = r2 - (4 - r3)) /* - * The pointer is now aligned and the length is adjusted. Try doing the + * The pointer is now aligned and the length is adjusted. Try doing the * memset again. */ ENTRY(memset) - ands r3, r0, #3 @ 1 unaligned? - bne 1b @ 1 /* - * we know that the pointer in r0 is aligned to a word boundary. + * Preserve the contents of r0 for the return value. */ - orr r1, r1, r1, lsl #8 - orr r1, r1, r1, lsl #16 - mov r3, r1 - cmp r2, #16 - blt 4f +mov ip, r0 +ands r3, ip, #3 @ 1 unaligned? +bne 1b @ 1 +/* + * we know that the pointer in ip is aligned to a word boundary. + */ +orr r1, r1, r1, lsl #8 +orr r1, r1, r1, lsl #16 +mov r3, r1 +cmp r2, #16 +blt 4f #if ! CALGN(1)+0 /* - * We need an extra register for this loop - save the return address and - * use the LR + * We need 2 extra registers for this loop - use r8 and the LR */ - str lr, [sp, #-4]! - mov ip, r1 - mov lr, r1 +stmfd sp!, {r8, lr} +mov r8, r1 +mov lr, r1 2: subs r2, r2, #64 - stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time. - stmgeia r0!, {r1, r3, ip, lr} - stmgeia r0!, {r1, r3, ip, lr} - stmgeia r0!, {r1, r3, ip, lr} - bgt 2b - ldmeqfd sp!, {pc} @ Now <64 bytes to go. +stmgeia ip!, {r1, r3, r8, lr} @ 64 bytes at a time. +stmgeia ip!, {r1, r3, r8, lr} +stmgeia ip!, {r1, r3, r8, lr} +stmgeia ip!, {r1, r3, r8, lr} +bgt 2b +ldmeqfd sp!, {r8, pc} @ Now <64 bytes to go. /* * No need to correct the count; we're only testing bits from now on */ - tst r2, #32 - stmneia r0!, {r1, r3, ip, lr} - stmneia r0!, {r1, r3, ip, lr} - tst r2, #16 - stmneia r0!, {r1, r3, ip, lr} - ldr lr, [sp], #4 +tst r2, #32 +stmneia ip!, {r1, r3, r8, lr} +stmneia ip!, {r1, r3, r8, lr} +tst r2, #16 +stmneia ip!, {r1, r3, r8, lr} +ldmfd sp!, {r8, lr} #else @@ -74,54 +77,54 @@ ENTRY(memset) * whole cache lines at once. */ - stmfd sp!, {r4-r7, lr} - mov r4, r1 - mov r5, r1 - mov r6, r1 - mov r7, r1 - mov ip, r1 - mov lr, r1 +stmfd sp!, {r4-r8, lr} +mov r4, r1 +mov r5, r1 +mov r6, r1 +mov r7, r1 +mov r8, r1 +mov lr, r1 - cmp r2, #96 - tstgt r0, #31 - ble 3f +cmp r2, #96 +tstgt ip, #31 +ble 3f - and ip, r0, #31 - rsb ip, ip, #32 - sub r2, r2, ip - movs ip, ip, lsl #(32 - 4) - stmcsia r0!, {r4, r5, r6, r7} - stmmiia r0!, {r4, r5} - tst ip, #(1 << 30) - mov ip, r1 - strne r1, [r0], #4 +and r8, ip, #31 +rsb r8, r8, #32 +sub r2, r2, r8 +movs r8, r8, lsl #(32 - 4) +stmcsia ip!, {r4, r5, r6, r7} +stmmiia ip!, {r4, r5} +tst r8, #(1 << 30) +mov r8, r1 +strne r1, [ip], #4 3: subs r2, r2, #64 - stmgeia r0!, {r1, r3-r7, ip, lr} - stmgeia r0!, {r1, r3-r7, ip, lr} - bgt 3b - ldmeqfd sp!, {r4-r7, pc} +stmgeia ip!, {r1, r3-r8, lr} +stmgeia ip!, {r1, r3-r8, lr} +bgt 3b +ldmeqfd sp!, {r4-r8, pc} - tst r2, #32 - stmneia r0!, {r1, r3-r7, ip, lr} - tst r2, #16 - stmneia r0!, {r4-r7} - ldmfd sp!, {r4-r7, lr} +tst r2, #32 +stmneia ip!, {r1, r3-r8, lr} +tst r2, #16 +stmneia ip!, {r4-r7} +ldmfd sp!, {r4-r8, lr} #endif 4: tst r2, #8 - stmneia r0!, {r1, r3} - tst r2, #4 - strne r1, [r0], #4 +stmneia ip!, {r1, r3} +tst r2, #4 +strne r1, [ip], #4 /* - * When we get here, we've got less than 4 bytes to zero. We + * When we get here, we've got less than 4 bytes to zero. We * may have an unaligned pointer as well. */ 5: tst r2, #2 - strneb r1, [r0], #1 - strneb r1, [r0], #1 - tst r2, #1 - strneb r1, [r0], #1 - mov pc, lr +strneb r1, [ip], #1 +strneb r1, [ip], #1 +tst r2, #1 +strneb r1, [ip], #1 +mov pc, lr ENDPROC(memset) From e606bb34dbc9e9c7fa01ed1210d86fc65a83d58c Mon Sep 17 00:00:00 2001 From: torrorosso Date: Tue, 18 Feb 2014 21:22:32 +0300 Subject: [PATCH 3/4] 1d31395f43bfa4c0856ca374599ea9d1970fe397 --- kernel/auditsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/auditsc.c b/kernel/auditsc.c index af1de0f34eae..e3fd8e597b86 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c @@ -913,7 +913,7 @@ static int audit_filter_inode_name(struct task_struct *tsk, int h = audit_hash_ino((u32)n->ino); struct list_head *list = &audit_inode_hash[h]; struct audit_entry *e; - enum audit_state state; + enum audit_state state = 0; word = AUDIT_WORD(ctx->major); bit = AUDIT_BIT(ctx->major); From 4868448c05813864b4f27d2578dbd3004be28547 Mon Sep 17 00:00:00 2001 From: torrorosso Date: Tue, 18 Feb 2014 21:26:44 +0300 Subject: [PATCH 4/4] 07de4a5 --- kernel/cgroup.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 2f0d7542c0d2..af5dd5098c58 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c @@ -2880,7 +2880,8 @@ int cgroup_scan_tasks(struct cgroup_scanner *scan) struct ptr_heap tmp_heap; struct ptr_heap *heap; struct timespec latest_time = { 0, 0 }; - + it.task = NULL; + if (scan->heap) { /* The caller supplied our heap and pre-allocated its memory */ heap = scan->heap; @@ -3216,7 +3217,8 @@ int cgroupstats_build(struct cgroupstats *stats, struct dentry *dentry) struct cgroup *cgrp; struct cgroup_iter it; struct task_struct *tsk; - + it.task = NULL; + /* * Validate dentry by checking the superblock operations, * and make sure it's a directory.