summaryrefslogtreecommitdiff
path: root/arch/xtensa/kernel/Makefile
AgeCommit message (Collapse)Author
2016-11-16xtensa: move S32C1I self-test to a separate fileMax Filippov
The test is not called from any of the setup functions, so there's no reason keeping it in the setup.c. Move it to s32c1i_selftest.c and drop related #include directives. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2016-03-11xtensa: support hardware breakpoints/watchpointsMax Filippov
Use perf framework to manage hardware instruction and data breakpoints. Add two new ptrace calls: PTRACE_GETHBPREGS and PTRACE_SETHBPREGS to query and set instruction and data breakpoints. Address bit 0 choose instruction (0) or data (1) break register, bits 31..1 are the register number. Both calls transfer two 32-bit words: address (0) and control (1). Instruction breakpoint contorl word is 0 to clear breakpoint, 1 to set. Data breakpoint control word bit 31 is 'trigger on store', bit 30 is 'trigger on load, bits 29..0 are length. Length 0 is used to clear a breakpoint. To set a breakpoint length must be a power of 2 in the range 1..64 and the address must be length-aligned. Introduce new thread_info flag: TIF_DB_DISABLED. Set it if debug exception is raised by the kernel code accessing watched userspace address and disable corresponding data breakpoint. On exit to userspace check that flag and, if set, restore all data breakpoints. Handle debug exceptions raised with PS.EXCM set. This may happen when window overflow/underflow handler or fast exception handler hits data breakpoint, in which case save and disable all data breakpoints, single-step faulting instruction and restore data breakpoints. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2016-03-11xtensa: remove remaining non-functional KGDB bitsMax Filippov
KGDB is not supported on xtensa, but there are bits of related code under arch/xtensa/kernel. Remove these bits. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-11-03xtensa: fix secondary core boot in SMPMax Filippov
There are multiple factors adding to the issue in different configurations: - commit 17290231df16eeee ("xtensa: add fixup for double exception raised in window overflow") added function window_overflow_restore_a0_fixup to double exception vector overlapping reset vector location of secondary processor cores. - on MMUv2 cores RESET_VECTOR1_VADDR may point to uncached kernel memory making code overlapping depend on cache type and size, so that without cache or with WT cache reset vector code overwrites double exception code, making issue even harder to detect. - on MMUv3 cores RESET_VECTOR1_VADDR may point to unmapped area, as MMUv3 cores change virtual address map to match MMUv2 layout, but reset vector virtual address is given for the original MMUv3 mapping. - physical memory region of the secondary reset vector is not reserved in the physical memory map, and thus may be allocated and overwritten at arbitrary moment. Fix it as follows: - move window_overflow_restore_a0_fixup code to .text section. - define RESET_VECTOR1_VADDR so that it points to reset vector in the cacheable MMUv2 map for cores with MMU. - reserve reset vector region in the physical memory map. Drop separate literal section and build mxhead.S with text section literals. Cc: <stable@vger.kernel.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-08-20xtensa: improve vmlinux.lds.S sed post-processingMax Filippov
Current sed script makes assumptions about the structure of rules that group .text sections in the vmlinux linker script. These assumptions get broken occasionally, e.g.: 779c88c94c34 "ARM: 8321/1: asm-generic: introduce.text.fixup input section", or 9bebe9e5b0f3 "kbuild: Fix .text.unlikely placement". Rewrite sed rules so that they don't depend on number/arrangement of text sections in *(...) blocks. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-08-17xtensa: implement counting and sampling perf eventsMax Filippov
Xtensa Performance Monitor Module has up to 8 32 bit wide performance counters. Each counter may be enabled independently and can count any single type of hardware performance events. Event counting may be enabled and disabled globally (per PMM). Each counter has status register with bits indicating if the counter has been overflown and may be programmed to raise profiling IRQ on overflow. This IRQ is used to rewind counters and allow for counting more than 2^32 samples for counting events and to report samples for sampling events. For more details see Tensilica Debug User's Guide, chapter 8 "Performance monitor module". Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-04-10xtensa: Fix fix linker script transformation for .text / .text.fixupGuenter Roeck
Commit 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup input section") introduced a new .text.fixup section which is merged with .text at link time. This causes xtensa builds to fail with lots of error messages similar to the following. lib/lib.a(kobject.o): In function `kobject_create': (.text+0x498): dangerous relocation: l32r: literal placed after use: (.literal+0x150) Linker script transformation needs to be updated to detect and handle the new section. Fixes: 779c88c94c34 ("ARM: 8321/1: asm-generic: introduce .text.fixup input section") Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Chris Zankel <chris@zankel.net>
2014-01-14xtensa: add SMP supportMax Filippov
This is largely based on SMP code from the xtensa-2.6.29-smp tree by Piet Delaney, Marc Gauthier, Joe Taylor, Christian Zankel (and possibly other Tensilica folks). Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2013-07-08xtensa: add static function tracer supportMax Filippov
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2013-05-09xtensa: add stacktrace supportMax Filippov
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2013-05-09xtensa: add MMU v3 supportMax Filippov
MMUv3 comes out of reset with identity vaddr -> paddr mapping in the TLB way 6: Way 6 (512 MB) Vaddr Paddr ASID Attr RWX Cache ---------- ---------- ---- ---- --- ------- 0x00000000 0x00000000 0x01 0x03 RWX Bypass 0x20000000 0x20000000 0x01 0x03 RWX Bypass 0x40000000 0x40000000 0x01 0x03 RWX Bypass 0x60000000 0x60000000 0x01 0x03 RWX Bypass 0x80000000 0x80000000 0x01 0x03 RWX Bypass 0xa0000000 0xa0000000 0x01 0x03 RWX Bypass 0xc0000000 0xc0000000 0x01 0x03 RWX Bypass 0xe0000000 0xe0000000 0x01 0x03 RWX Bypass This patch adds remapping code at the reset vector or at the kernel _start (depending on CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX) that reconfigures MMUv3 as MMUv2: Way 5 (128 MB) Vaddr Paddr ASID Attr RWX Cache ---------- ---------- ---- ---- --- ------- 0xd0000000 0x00000000 0x01 0x07 RWX WB 0xd8000000 0x00000000 0x01 0x03 RWX Bypass Way 6 (256 MB) Vaddr Paddr ASID Attr RWX Cache ---------- ---------- ---- ---- --- ------- 0xe0000000 0xf0000000 0x01 0x07 RWX WB 0xf0000000 0xf0000000 0x01 0x03 RWX Bypass Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2012-12-18xtensa: clean up files to make them code-style compliantChris Zankel
Remove heading and trailing spaces, trim trailing lines, and wrap lines that are longer than 80 characters. Signed-off-by: Chris Zankel <chris@zankel.net>
2012-10-03xtensa: adopt generic io routinesMax Filippov
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2012-10-03xtensa: fix linker script transformation for .text.unlikelyMax Filippov
Now that binutils generate *.unlikely sections which don't follow documented (info as) literal section naming rules, section name transformation script doesn't work well resulting in the following errors at vmlinux link time: main.c:(.text.unlikely+0x3): dangerous relocation: l32r: literal placed after use: .literal.unlikely Fix section name transformation script by adding specific rule for .text.unlikely sections. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2012-05-05xtensa: Use generic init_taskThomas Gleixner
Same code. Use the generic version. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Chris Zankel <chris@zankel.net> Link: http://lkml.kernel.org/r/20120503085035.804059531@linutronix.de
2010-05-01xtensa: Fix linker script patch-upChris Zankel
The Xtensa architecture requires to patch the generated linker script to insert precede certain sections with a .literal section. Ammend the sed script to fix-up only sequences that start with a '*': '*(.init.text)' -> '*(.init.literal .init.text)' Signed-off-by: Chris Zankel <chris@zankel.net>
2009-09-20arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0Sam Ravnborg
Albin Tonnerre <albin.tonnerre@free-electrons.com> reported: Bash 4 filters out variables which contain a dot in them. This happends to be the case of CPPFLAGS_vmlinux.lds. This is rather unfortunate, as it now causes build failures when using SHELL=/bin/bash to compile, or when bash happens to be used by make (eg when it's /bin/sh) Remove the common definition of CPPFLAGS_vmlinux.lds by pushing relevant stuff to either Makefile.build or the arch specific kernel/Makefile where we build the linker script. This is also nice cleanup as we move the information out where it is used. Notes for the different architectures touched: arm - we use an already exported symbol cris - we use a config symbol aleady available [Not build tested] mips - the jiffies complexity has moved to vmlinux.lds.S where we need it. Added a few variables to CPPFLAGS - they are only used by the linker script. [Not build tested] powerpc - removed assignment that is not needed [not build tested] sparc - simplified it using $(BITS) um - introduced a few new exported variables to deal with this xtensa - added options to CPP invocation [not build tested] Cc: Albin Tonnerre <albin.tonnerre@free-electrons.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: Mikael Starvik <starvik@axis.com> Cc: Jesper Nilsson <jesper.nilsson@axis.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Dike <jdike@addtoit.com> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-05-11xtensa: Fix linker script to include .literal sectionsChris Zankel
Fix resembles implementation from Marc Gauthier and Piet Denaly: In the Xtensa architecture, assembly generates literals which must always precede the code (the L32R instruction that loads them only uses negative PC-relative offsets). For any *.text section, literals are placed in a corresponding *.literal section. The linker script (vmlinux.lds) must place these in the correct order. It must also combine them, when the *.text section can be larger than L32R's 256 kB range. For example, this doesn't work: *(.literal) *(.text) because L32R instructions at the end of .text can't reach the literals. The linker can solve this if they are combined in parentheses, like this: *(.literal .text) because it is now allowed mix literals in .text to bring them in range. None of this is done by standard vmlinux.lds.h macros such as TEXT_TEXT and INIT_TEXT. To avoid replicating the logic of that header file, we instead post-process the generated linker script to convert *(xxx.text) to *(xxx.literal xxx.text) for the following text sections: .text .ref.text .*init.text .*exit.text .text.* using a sed script. To do this we must override the default rule for vmlinux.lds (see scripts/Makefile.build and the top-level Makefile) to insert this extra step. Signed-off-by: Marc Gauthier <marc@tensilica.com> Signed-off-by: Pete Delaney <piet@tensilica.com> Signed-off-by: Chris Zankel <chris@zankel.net>
2008-04-17Generic semaphore implementationMatthew Wilcox
Semaphores are no longer performance-critical, so a generic C implementation is better for maintainability, debuggability and extensibility. Thanks to Peter Zijlstra for fixing the lockdep warning. Thanks to Harvey Harrison for pointing out that the unlikely() was unnecessary. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Acked-by: Ingo Molnar <mingo@elte.hu>
2007-08-27[XTENSA] Move string-io functions to io.c from pci.cChris Zankel
The string-io functions (outs{bwl}, ins{bwl}) are independent from the PCI option and should be in a separate file. Signed-off-by: Chris Zankel <chris@zankel.net>
2007-08-27[XTENSA] Move pre-initialized structures to init_task.cChris Zankel
Move all initialization structures for the initial task to it's own file. Signed-off-by: Chris Zankel <chris@zankel.net>
2006-12-13[PATCH] Xtensa: Add ktermios and minor filename fixChris Zankel
The kernel termios (ktermios) changes were somehow missed for Xtensa. This patch adds the ktermios structure and also includes some minor file name fix that was missed in the syscall patch. Signed-off-by: Chris Zankel <chris@zankel.net> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-06-24[PATCH] xtensa: Architecture support for Tensilica Xtensa Part 3Chris Zankel
The attached patches provides part 3 of an architecture implementation for the Tensilica Xtensa CPU series. Signed-off-by: Chris Zankel <chris@zankel.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>