1. 05 9月, 2015 8 次提交
  2. 10 8月, 2015 1 次提交
  3. 09 7月, 2015 1 次提交
  4. 17 6月, 2015 1 次提交
    • P
      cris: don't use module_init for non-modular core intmem.c code · 73de14e8
      Paul Gortmaker 提交于
      The intmem.c code is always built in.  It will never be modular,
      so using module_init as an alias for __initcall is rather
      misleading.
      
      Fix this up now, so that we can relocate module_init from
      init.h into module.h in the future.  If we don't do this, we'd
      have to add module.h to obviously non-modular code, and that
      would be a worse thing.
      
      Direct use of __initcall is discouraged, vs prioritized ones.
      Use of device_initcall is consistent with what __initcall
      maps onto, and hence does not change the init order, making the
      impact of this change zero.   Should someone with real hardware
      for boot testing want to change it later to arch_initcall or
      something different, they can do that at a later date.
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Cc: linux-cris-kernel@axis.com
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      73de14e8
  5. 16 4月, 2015 2 次提交
  6. 13 4月, 2015 1 次提交
  7. 25 3月, 2015 8 次提交
    • R
      CRISv32: use GENERIC_SCHED_CLOCK · d3dad475
      Rabin Vincent 提交于
      Provide a fast sched clock using the free-running timer and the generic
      sched_clock infrastructure.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      d3dad475
    • R
      CRISv32: use MMIO clocksource · edfb6d5f
      Rabin Vincent 提交于
      Use a generic MMIO clocksource and get rid of some lines of code.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      edfb6d5f
    • R
      CRISv32: use generic clockevents · ed9fd3ff
      Rabin Vincent 提交于
      Implement a oneshot-capable clockevents device so we get support for
      things like hrtimers and NOHZ.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      ed9fd3ff
    • R
      CRIS: remove SMP code · 47a8f6fb
      Rabin Vincent 提交于
      The CRIS SMP code cannot be built since there is no (and appears to
      never have been) a CONFIG_SMP Kconfig option in arch/cris/.  Remove it.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      47a8f6fb
    • R
      CRISv32: handle multiple signals · 9a7449d3
      Rabin Vincent 提交于
      Al Viro noted that CRIS fails to handle multiple signals.
      
      This fixes the problem for CRISv32 by making it use a C work_pending
      handling loop similar to the ARM implementation in 0a267fa6
      ("ARM: 7472/1: pull all work_pending logics into C function").
      
      This also happens to fixes the warnings which currently trigger on
      CRISv32 due to do_signal() being called with interrupts disabled.
      
      Test case (should die of the SIGSEGV which gets raised when setting up
      the stack for SIGALRM, but instead reaches and executes the _exit(1)):
      
        #include <unistd.h>
        #include <signal.h>
        #include <sys/time.h>
        #include <err.h>
      
        static void handler(int sig) { }
      
        int main(int argc, char *argv[])
        {
        	int ret;
        	struct itimerval t1 = { .it_value = {1} };
        	stack_t ss = {
        		.ss_sp = NULL,
        		.ss_size = SIGSTKSZ,
        	};
        	struct sigaction action = {
        		.sa_handler = handler,
        		.sa_flags = SA_ONSTACK,
        	};
      
        	ret = sigaltstack(&ss, NULL);
        	if (ret < 0)
        		err(1, "sigaltstack");
      
        	sigaction(SIGALRM, &action, NULL);
         	setitimer(ITIMER_REAL, &t1, NULL);
      
        	pause();
      
        	_exit(1);
      
        	return 0;
        }
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Link: http://lkml.kernel.org/r/20121208074429.GC4939@ZenIV.linux.org.ukSigned-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      9a7449d3
    • R
      CRISv32: prevent bogus restarts on sigreturn · 0f72e5c0
      Rabin Vincent 提交于
      Al Viro noted that CRIS is vulnerable to bogus restarts on sigreturn.
      
      The fixes CRISv32 by using regs->exs as an additional indicator to
      whether we should attempt to restart the syscall or not.  EXS is only
      used in the sigtrap handling, and in that path we already have r9 (the
      other indicator, which indicates if we're in a syscall or not) cleared.
      
      Test case, a port of Al's ARM version from 653d48b2 ("arm: fix
      really nasty sigreturn bug"):
      
        #include <unistd.h>
        #include <signal.h>
        #include <stdlib.h>
        #include <sys/time.h>
        #include <errno.h>
      
        void f(int n)
        {
        	register int r10 asm ("r10") = n;
      
                __asm__ __volatile__(
        		"ba	1f	\n"
        		"nop		\n"
        		"break	8	\n"
        		"1: ba	.	\n"
        		"nop		\n"
        		:
        		: "r" (r10)
        		: "memory");
        }
      
        void handler1(int sig) { }
        void handler2(int sig) { raise(1); }
        void handler3(int sig) { exit(0); }
      
        int main(int argc, char *argv[])
        {
                struct sigaction s = {.sa_handler = handler2};
                struct itimerval t1 = { .it_value = {1} };
                struct itimerval t2 = { .it_value = {2} };
      
                signal(1, handler1);
      
                sigemptyset(&s.sa_mask);
                sigaddset(&s.sa_mask, 1);
                sigaction(SIGALRM, &s, NULL);
      
                signal(SIGVTALRM, handler3);
      
                setitimer(ITIMER_REAL, &t1, NULL);
                setitimer(ITIMER_VIRTUAL, &t2, NULL);
      
                f(-513); /* -ERESTARTNOINTR */
      
                return 0;
        }
      Reported-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Link: http://lkml.kernel.org/r/20121208074429.GC4939@ZenIV.linux.org.ukSigned-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      0f72e5c0
    • R
      CRISv32: don't attempt syscall restart on irq exit · db4a35c6
      Rabin Vincent 提交于
      r9 is used to determine whether syscall restarting must be performed or
      not.  Unfortunately, r9 is never set to zero in the non-syscall path,
      and r9 is on top of that a callee-saved register which can be set to
      non-zero by the C functions that are called during IRQ handling.
      
      This means that if r10 (used for the syscall return value) is one of the
      -ERESTART* values when a hardware interrupt occurs which leads to a
      signal being delivered to the process, the kernel will "restart" a
      syscall which never occurred.  This will lead to the PC being moved back
      by 2 on return to user space.
      
      Fix the problem by setting r9 to zero in the interrupt path.
      
      Test case (should loop forever but ends up executing the break 8 trap
      instruction):
      
        #include <signal.h>
        #include <stdlib.h>
        #include <sys/time.h>
      
        void f(int n)
        {
        	register int r9 asm ("r9") = 1;
        	register int r10 asm ("r10") = n;
      
                __asm__ __volatile__(
        		"ba	1f	\n"
        		"nop		\n"
        		"break	8	\n"
        		"1: ba	.	\n"
        		"nop		\n"
        		:
        		: "r" (r9), "r" (r10)
        		: "memory");
        }
      
        void handler1(int sig) { }
      
        int main(int argc, char *argv[])
        {
                struct itimerval t1 = { .it_value = {1} };
      
                signal(SIGALRM, handler1);
                setitimer(ITIMER_REAL, &t1, NULL);
      
                f(-513); /* -ERESTARTNOINTR */
      
                return 0;
        }
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jespern@axis.com>
      db4a35c6
    • R
      CRISv32: add irq domains support · 43f7071e
      Rabin Vincent 提交于
      Add support for IRQ domains to the CRISv32 interrupt controller.
      Signed-off-by: NRabin Vincent <rabin@rab.in>
      Signed-off-by: NJesper Nilsson <jesper.nilsson@axis.com>
      43f7071e
  8. 15 2月, 2015 1 次提交
  9. 13 2月, 2015 1 次提交
    • A
      all arches, signal: move restart_block to struct task_struct · f56141e3
      Andy Lutomirski 提交于
      If an attacker can cause a controlled kernel stack overflow, overwriting
      the restart block is a very juicy exploit target.  This is because the
      restart_block is held in the same memory allocation as the kernel stack.
      
      Moving the restart block to struct task_struct prevents this exploit by
      making the restart_block harder to locate.
      
      Note that there are other fields in thread_info that are also easy
      targets, at least on some architectures.
      
      It's also a decent simplification, since the restart code is more or less
      identical on all architectures.
      
      [james.hogan@imgtec.com: metag: align thread_info::supervisor_stack]
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: David Miller <davem@davemloft.net>
      Acked-by: NRichard Weinberger <richard@nod.at>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Steven Miao <realmz6@gmail.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: "Luck, Tony" <tony.luck@intel.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Tested-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Chen Liqin <liqin.linux@gmail.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Chris Metcalf <cmetcalf@ezchip.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f56141e3
  10. 29 1月, 2015 1 次提交
  11. 20 1月, 2015 1 次提交
  12. 20 12月, 2014 10 次提交
  13. 19 9月, 2014 1 次提交
    • K
      sched, cleanup, treewide: Remove set_current_state(TASK_RUNNING) after schedule() · f139caf2
      Kirill Tkhai 提交于
      schedule(), io_schedule() and schedule_timeout() always return
      with TASK_RUNNING state set, so one more setting is unnecessary.
      
      (All places in patch are visible good, only exception is
       kiblnd_scheduler() from:
      
            drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
      
       Its schedule() is one line above standard 3 lines of unified diff)
      
      No places where set_current_state() is used for mb().
      Signed-off-by: NKirill Tkhai <ktkhai@parallels.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1410529254.3569.23.camel@tkhai
      Cc: Alasdair Kergon <agk@redhat.com>
      Cc: Anil Belur <askb23@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dave Kleikamp <shaggy@kernel.org>
      Cc: David Airlie <airlied@linux.ie>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Dmitry Eremin <dmitry.eremin@intel.com>
      Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Isaac Huang <he.huang@intel.com>
      Cc: James E.J. Bottomley <JBottomley@parallels.com>
      Cc: James E.J. Bottomley <jejb@parisc-linux.org>
      Cc: J. Bruce Fields <bfields@fieldses.org>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Laura Abbott <lauraa@codeaurora.org>
      Cc: Liang Zhen <liang.zhen@intel.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Masaru Nomura <massa.nomura@gmail.com>
      Cc: Michael Opdenacker <michael.opdenacker@free-electrons.com>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Mike Snitzer <snitzer@redhat.com>
      Cc: Neil Brown <neilb@suse.de>
      Cc: Oleg Drokin <green@linuxhacker.ru>
      Cc: Peng Tao <bergwolf@gmail.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Robert Love <robert.w.love@intel.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Cc: Ursula Braun <ursula.braun@de.ibm.com>
      Cc: Zi Shen Lim <zlim.lnx@gmail.com>
      Cc: devel@driverdev.osuosl.org
      Cc: dm-devel@redhat.com
      Cc: dri-devel@lists.freedesktop.org
      Cc: fcoe-devel@open-fcoe.org
      Cc: jfs-discussion@lists.sourceforge.net
      Cc: linux390@de.ibm.com
      Cc: linux-afs@lists.infradead.org
      Cc: linux-cris-kernel@axis.com
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-nfs@vger.kernel.org
      Cc: linux-parisc@vger.kernel.org
      Cc: linux-raid@vger.kernel.org
      Cc: linux-s390@vger.kernel.org
      Cc: linux-scsi@vger.kernel.org
      Cc: qla2xxx-upstream@qlogic.com
      Cc: user-mode-linux-devel@lists.sourceforge.net
      Cc: user-mode-linux-user@lists.sourceforge.net
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      f139caf2
  14. 06 8月, 2014 2 次提交
  15. 07 6月, 2014 1 次提交