License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.
By default all files without license information are under the default
license of the kernel, which is GPL version 2.
Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.
This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.
How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,
Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.
The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.
The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.
Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).
All documentation files were explicitly excluded.
The following heuristics were used to determine which SPDX license
identifiers to apply.
- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.
For non */uapi/* files that summary was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139
and resulted in the first patch in this series.
If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:
SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930
and resulted in the second patch in this series.
- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:
SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1
and that resulted in the third patch in this series.
- when the two scanners agreed on the detected license(s), that became
the concluded license(s).
- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.
- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).
- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.
- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.
In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.
Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.
Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.
In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.
Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct
This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.
These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-01 22:07:57 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-04-17 06:20:36 +08:00
|
|
|
#
|
|
|
|
# Makefile for the Linux/MIPS kernel.
|
|
|
|
#
|
|
|
|
|
2012-05-03 17:02:55 +08:00
|
|
|
extra-y := head.o vmlinux.lds
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2017-06-10 08:26:39 +08:00
|
|
|
obj-y += cmpxchg.o cpu-probe.o branch.o elf.o entry.o genex.o idle.o irq.o \
|
2014-09-11 15:30:22 +08:00
|
|
|
process.o prom.o ptrace.o reset.o setup.o signal.o \
|
|
|
|
syscall.o time.o topology.o traps.o unaligned.o watch.o \
|
2016-12-08 09:16:26 +08:00
|
|
|
vdso.o cacheinfo.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2009-11-20 20:34:29 +08:00
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
MIPS: Tracing: Add dynamic function tracer support
With dynamic function tracer, by default, _mcount is defined as an
"empty" function, it returns directly without any more action . When
enabling it in user-space, it will jump to a real tracing
function(ftrace_caller), and do the real job for us.
Differ from the static function tracer, dynamic function tracer provides
two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
tracing of some indicated kernel functions(set_ftrace_filter).
In the -v4 version, the implementation of this support is basically the same as
X86 version does: _mcount is implemented as an empty function and ftrace_caller
is implemented as a real tracing function respectively.
But in this version, to support module tracing with the help of
-mlong-calls in arch/mips/Makefile:
MODFLAGS += -mlong-calls.
The stuff becomes a little more complex. We need to cope with two
different type of calling to _mcount.
For the kernel part, the calling to _mcount(result of "objdump -hdr
vmlinux"). is like this:
108: 03e0082d move at,ra
10c: 0c000000 jal 0 <fpcsr_pending>
10c: R_MIPS_26 _mcount
10c: R_MIPS_NONE *ABS*
10c: R_MIPS_NONE *ABS*
110: 00020021 nop
For the module with -mlong-calls, it looks like this:
c: 3c030000 lui v1,0x0
c: R_MIPS_HI16 _mcount
c: R_MIPS_NONE *ABS*
c: R_MIPS_NONE *ABS*
10: 64630000 daddiu v1,v1,0
10: R_MIPS_LO16 _mcount
10: R_MIPS_NONE *ABS*
10: R_MIPS_NONE *ABS*
14: 03e0082d move at,ra
18: 0060f809 jalr v1
In the kernel version, there is only one "_mcount" string for every
kernel function, so, we just need to match this one in mcount_regex of
scripts/recordmcount.pl, but in the module version, we need to choose
one of the two to match. Herein, I choose the first one with
"R_MIPS_HI16 _mcount".
and In the kernel verion, without module tracing support, we just need
to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
filter the tracing of some kernel functions via replacing it by a nop
instruction.
but as we have described before, the instruction "jal ftrace_caller" only left
32bit length for the address of ftrace_caller, it will fail when calling from
the module space. so, herein, we must replace something else.
the basic idea is loading the address of ftrace_caller to v1 via changing these
two instructions:
lui v1,0x0
addiu v1,v1,0
If we want to enable the tracing, we need to replace the above instructions to:
lui v1, HI_16BIT_ftrace_caller
addiu v1, v1, LOW_16BIT_ftrace_caller
If we want to stop the tracing of the indicated kernel functions, we
just need to replace the "jalr v1" to a nop instruction. but we need to
replace two instructions and encode the above two instructions
oursevles.
Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
and ftrace_caller together, which means the address of _mcount and
ftrace_caller is the same:
_mcount:
ftrace_caller:
j ftrace_stub
nop
...(do real tracing here)...
ftrace_stub:
jr ra
move ra, at
By default, the kernel functions call _mcount, and then jump to ftrace_stub and
return. and when we want to do real tracing, we just need to remove that "j
ftrace_stub", and it will run through the two "nop" instructions and then do
the real tracing job.
what about filtering job? we just need to do this:
lui v1, hi_16bit_of_mcount <--> b 1f (0x10000004)
addiu v1, v1, low_16bit_of_mcount
move at, ra
jalr v1
nop
1f: (rec->ip + 12)
In linux-mips64, there will be some local symbols, whose name are
prefixed by $L, which need to be filtered. thanks goes to Steven for
writing the mips64-specific function_regex.
In a conclusion, with RISC, things becomes easier with such a "stupid"
trick, RISC is something like K.I.S.S, and also, there are lots of
"simple" tricks in the whole ftrace support, thanks goes to Steven and
the other folks for providing such a wonderful tracing framework!
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/675/
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-11-20 20:34:32 +08:00
|
|
|
CFLAGS_REMOVE_ftrace.o = -pg
|
2009-11-20 20:34:29 +08:00
|
|
|
CFLAGS_REMOVE_early_printk.o = -pg
|
2011-09-24 08:29:55 +08:00
|
|
|
CFLAGS_REMOVE_perf_event.o = -pg
|
|
|
|
CFLAGS_REMOVE_perf_event_mipsxx.o = -pg
|
2009-11-20 20:34:29 +08:00
|
|
|
endif
|
|
|
|
|
2007-11-01 09:57:55 +08:00
|
|
|
obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o
|
2012-12-01 00:27:27 +08:00
|
|
|
obj-$(CONFIG_CEVT_R4K) += cevt-r4k.o
|
2008-04-25 11:11:44 +08:00
|
|
|
obj-$(CONFIG_CEVT_DS1287) += cevt-ds1287.o
|
2007-10-22 18:43:15 +08:00
|
|
|
obj-$(CONFIG_CEVT_GT641XX) += cevt-gt641xx.o
|
2007-11-01 09:57:55 +08:00
|
|
|
obj-$(CONFIG_CEVT_SB1250) += cevt-sb1250.o
|
2007-10-25 00:34:09 +08:00
|
|
|
obj-$(CONFIG_CEVT_TXX9) += cevt-txx9.o
|
2007-11-01 09:57:55 +08:00
|
|
|
obj-$(CONFIG_CSRC_BCM1480) += csrc-bcm1480.o
|
2008-04-24 08:48:40 +08:00
|
|
|
obj-$(CONFIG_CSRC_IOASIC) += csrc-ioasic.o
|
2012-11-15 13:34:17 +08:00
|
|
|
obj-$(CONFIG_CSRC_R4K) += csrc-r4k.o
|
2007-11-01 09:57:55 +08:00
|
|
|
obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o
|
2008-04-29 00:14:26 +08:00
|
|
|
obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
|
2007-10-19 00:48:11 +08:00
|
|
|
|
2013-11-15 00:12:32 +08:00
|
|
|
obj-$(CONFIG_DEBUG_FS) += segment.o
|
2006-09-26 22:44:01 +08:00
|
|
|
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
2016-11-07 19:14:16 +08:00
|
|
|
obj-$(CONFIG_MODULES) += module.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2012-07-14 05:38:17 +08:00
|
|
|
obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
|
MIPS: Tracing: Add dynamic function tracer support
With dynamic function tracer, by default, _mcount is defined as an
"empty" function, it returns directly without any more action . When
enabling it in user-space, it will jump to a real tracing
function(ftrace_caller), and do the real job for us.
Differ from the static function tracer, dynamic function tracer provides
two functions ftrace_make_call()/ftrace_make_nop() to enable/disable the
tracing of some indicated kernel functions(set_ftrace_filter).
In the -v4 version, the implementation of this support is basically the same as
X86 version does: _mcount is implemented as an empty function and ftrace_caller
is implemented as a real tracing function respectively.
But in this version, to support module tracing with the help of
-mlong-calls in arch/mips/Makefile:
MODFLAGS += -mlong-calls.
The stuff becomes a little more complex. We need to cope with two
different type of calling to _mcount.
For the kernel part, the calling to _mcount(result of "objdump -hdr
vmlinux"). is like this:
108: 03e0082d move at,ra
10c: 0c000000 jal 0 <fpcsr_pending>
10c: R_MIPS_26 _mcount
10c: R_MIPS_NONE *ABS*
10c: R_MIPS_NONE *ABS*
110: 00020021 nop
For the module with -mlong-calls, it looks like this:
c: 3c030000 lui v1,0x0
c: R_MIPS_HI16 _mcount
c: R_MIPS_NONE *ABS*
c: R_MIPS_NONE *ABS*
10: 64630000 daddiu v1,v1,0
10: R_MIPS_LO16 _mcount
10: R_MIPS_NONE *ABS*
10: R_MIPS_NONE *ABS*
14: 03e0082d move at,ra
18: 0060f809 jalr v1
In the kernel version, there is only one "_mcount" string for every
kernel function, so, we just need to match this one in mcount_regex of
scripts/recordmcount.pl, but in the module version, we need to choose
one of the two to match. Herein, I choose the first one with
"R_MIPS_HI16 _mcount".
and In the kernel verion, without module tracing support, we just need
to replace "jal _mcount" by "jal ftrace_caller" to do real tracing, and
filter the tracing of some kernel functions via replacing it by a nop
instruction.
but as we have described before, the instruction "jal ftrace_caller" only left
32bit length for the address of ftrace_caller, it will fail when calling from
the module space. so, herein, we must replace something else.
the basic idea is loading the address of ftrace_caller to v1 via changing these
two instructions:
lui v1,0x0
addiu v1,v1,0
If we want to enable the tracing, we need to replace the above instructions to:
lui v1, HI_16BIT_ftrace_caller
addiu v1, v1, LOW_16BIT_ftrace_caller
If we want to stop the tracing of the indicated kernel functions, we
just need to replace the "jalr v1" to a nop instruction. but we need to
replace two instructions and encode the above two instructions
oursevles.
Is there a simpler solution? Yes! Here it is, in this version, we put _mcount
and ftrace_caller together, which means the address of _mcount and
ftrace_caller is the same:
_mcount:
ftrace_caller:
j ftrace_stub
nop
...(do real tracing here)...
ftrace_stub:
jr ra
move ra, at
By default, the kernel functions call _mcount, and then jump to ftrace_stub and
return. and when we want to do real tracing, we just need to remove that "j
ftrace_stub", and it will run through the two "nop" instructions and then do
the real tracing job.
what about filtering job? we just need to do this:
lui v1, hi_16bit_of_mcount <--> b 1f (0x10000004)
addiu v1, v1, low_16bit_of_mcount
move at, ra
jalr v1
nop
1f: (rec->ip + 12)
In linux-mips64, there will be some local symbols, whose name are
prefixed by $L, which need to be filtered. thanks goes to Steven for
writing the mips64-specific function_regex.
In a conclusion, with RISC, things becomes easier with such a "stupid"
trick, RISC is something like K.I.S.S, and also, there are lots of
"simple" tricks in the whole ftrace support, thanks goes to Steven and
the other folks for providing such a wonderful tracing framework!
Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Nicholas Mc Guire <der.herr@hofr.at>
Cc: zhangfx@lemote.com
Cc: Wu Zhangjin <wuzhangjin@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/675/
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2009-11-20 20:34:32 +08:00
|
|
|
obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o
|
2009-11-20 20:34:29 +08:00
|
|
|
|
2017-06-06 02:21:28 +08:00
|
|
|
sw-y := r4k_switch.o
|
|
|
|
sw-$(CONFIG_CPU_R3000) := r2300_switch.o
|
|
|
|
sw-$(CONFIG_CPU_TX39XX) := r2300_switch.o
|
|
|
|
sw-$(CONFIG_CPU_CAVIUM_OCTEON) := octeon_switch.o
|
|
|
|
obj-y += $(sw-y)
|
|
|
|
|
|
|
|
obj-$(CONFIG_CPU_R4K_FPU) += r4k_fpu.o
|
|
|
|
obj-$(CONFIG_CPU_R3000) += r2300_fpu.o
|
|
|
|
obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_SMP) += smp.o
|
2007-11-25 06:33:28 +08:00
|
|
|
obj-$(CONFIG_SMP_UP) += smp-up.o
|
2016-02-04 10:14:50 +08:00
|
|
|
obj-$(CONFIG_CPU_BMIPS) += smp-bmips.o bmips_vec.o bmips_5xxx_init.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-04-05 16:45:45 +08:00
|
|
|
obj-$(CONFIG_MIPS_MT) += mips-mt.o
|
2007-07-03 21:37:43 +08:00
|
|
|
obj-$(CONFIG_MIPS_MT_FPAFF) += mips-mt-fpaff.o
|
2006-04-05 16:45:45 +08:00
|
|
|
obj-$(CONFIG_MIPS_MT_SMP) += smp-mt.o
|
2008-04-29 00:14:26 +08:00
|
|
|
obj-$(CONFIG_MIPS_CMP) += smp-cmp.o
|
2014-01-15 18:31:53 +08:00
|
|
|
obj-$(CONFIG_MIPS_CPS) += smp-cps.o cps-vec.o
|
2015-09-23 02:12:11 +08:00
|
|
|
obj-$(CONFIG_MIPS_CPS_NS16550) += cps-vec-ns16550.o
|
2014-11-13 21:32:03 +08:00
|
|
|
obj-$(CONFIG_MIPS_SPRAM) += spram.o
|
2005-08-18 01:44:08 +08:00
|
|
|
|
2005-07-14 23:57:16 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_LOADER) += vpe.o
|
2013-10-31 04:52:07 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_LOADER_CMP) += vpe-cmp.o
|
2013-10-31 04:52:06 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_LOADER_MT) += vpe-mt.o
|
2013-01-22 19:59:30 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_APSP_API) += rtlx.o
|
2014-01-01 23:29:03 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_APSP_API_CMP) += rtlx-cmp.o
|
2014-01-01 23:26:46 +08:00
|
|
|
obj-$(CONFIG_MIPS_VPE_APSP_API_MT) += rtlx-mt.o
|
2005-07-14 23:57:16 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
obj-$(CONFIG_IRQ_CPU_RM7K) += irq-rm7000.o
|
2008-07-16 01:44:34 +08:00
|
|
|
obj-$(CONFIG_MIPS_MSC) += irq-msc01.o
|
2007-08-02 22:35:53 +08:00
|
|
|
obj-$(CONFIG_IRQ_TXX9) += irq_txx9.o
|
2007-09-13 22:51:26 +08:00
|
|
|
obj-$(CONFIG_IRQ_GT641XX) += irq-gt641xx.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2010-08-04 02:22:20 +08:00
|
|
|
obj-$(CONFIG_KPROBES) += kprobes.o
|
2005-09-04 06:56:16 +08:00
|
|
|
obj-$(CONFIG_32BIT) += scall32-o32.o
|
|
|
|
obj-$(CONFIG_64BIT) += scall64-64.o
|
2007-02-15 09:53:00 +08:00
|
|
|
obj-$(CONFIG_MIPS32_COMPAT) += linux32.o ptrace32.o signal32.o
|
2005-04-17 06:20:36 +08:00
|
|
|
obj-$(CONFIG_MIPS32_N32) += binfmt_elfn32.o scall64-n32.o signal_n32.o
|
2016-06-17 23:03:45 +08:00
|
|
|
obj-$(CONFIG_MIPS32_O32) += binfmt_elfo32.o scall64-o32.o signal_o32.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2008-07-30 04:58:53 +08:00
|
|
|
obj-$(CONFIG_KGDB) += kgdb.o
|
2005-04-17 06:20:36 +08:00
|
|
|
obj-$(CONFIG_PROC_FS) += proc.o
|
2015-05-19 16:50:29 +08:00
|
|
|
obj-$(CONFIG_MAGIC_SYSRQ) += sysrq.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-09-04 06:56:16 +08:00
|
|
|
obj-$(CONFIG_64BIT) += cpu-bugs64.o
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-10-12 06:46:10 +08:00
|
|
|
obj-$(CONFIG_I8253) += i8253.o
|
2006-03-14 13:11:50 +08:00
|
|
|
|
2008-04-04 23:55:41 +08:00
|
|
|
obj-$(CONFIG_GPIO_TXX9) += gpio_txx9.o
|
|
|
|
|
2016-03-31 17:05:36 +08:00
|
|
|
obj-$(CONFIG_RELOCATABLE) += relocate.o
|
|
|
|
|
2012-10-12 00:14:58 +08:00
|
|
|
obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o
|
|
|
|
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
|
2007-03-01 19:56:43 +08:00
|
|
|
obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
|
2010-02-08 19:59:39 +08:00
|
|
|
obj-$(CONFIG_EARLY_PRINTK_8250) += early_printk_8250.o
|
2010-02-17 07:26:35 +08:00
|
|
|
obj-$(CONFIG_SPINLOCK_TEST) += spinlock_test.o
|
2010-11-23 23:06:25 +08:00
|
|
|
obj-$(CONFIG_MIPS_MACHINE) += mips_machine.o
|
2014-12-03 23:47:03 +08:00
|
|
|
obj-$(CONFIG_MIPSR2_TO_R6_EMULATOR) += mips-r2-to-r6-emul.o
|
2006-10-18 21:14:55 +08:00
|
|
|
|
2012-10-02 22:42:36 +08:00
|
|
|
CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
|
2007-07-11 00:33:01 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o
|
2007-07-30 18:48:58 +08:00
|
|
|
|
2011-09-24 08:29:55 +08:00
|
|
|
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
|
|
|
|
obj-$(CONFIG_HW_PERF_EVENTS) += perf_event_mipsxx.o
|
2010-10-12 19:37:22 +08:00
|
|
|
|
2010-12-29 05:26:23 +08:00
|
|
|
obj-$(CONFIG_JUMP_LABEL) += jump_label.o
|
2015-07-30 04:44:53 +08:00
|
|
|
obj-$(CONFIG_UPROBES) += uprobes.o
|
2010-12-29 05:26:23 +08:00
|
|
|
|
2014-01-15 18:31:51 +08:00
|
|
|
obj-$(CONFIG_MIPS_CM) += mips-cm.o
|
2014-01-15 18:31:52 +08:00
|
|
|
obj-$(CONFIG_MIPS_CPC) += mips-cpc.o
|
2014-01-15 18:31:51 +08:00
|
|
|
|
2014-03-04 18:11:39 +08:00
|
|
|
obj-$(CONFIG_CPU_PM) += pm.o
|
2014-04-14 18:00:56 +08:00
|
|
|
obj-$(CONFIG_MIPS_CPS_PM) += pm-cps.o
|
2014-03-04 18:11:39 +08:00
|
|
|
|
2013-01-04 03:01:52 +08:00
|
|
|
#
|
MIPS: Fix code generation for non-DSP capable CPUs
Commit 32a7ede (MIPS: dsp: Add assembler support for DSP ASEs) has
enabled the use of DSP ASE specific instructions such as rddsp and wrdsp
under the idea that all code path that will make use of these two
instructions are properly checking for cpu_has_dsp to ensure that the
particular CPU we are running on *actually* supports DSP ASE.
This commit actually causes the following oops on QEMU Malta emulating a
MIPS 24Kc without the DSP ASE implemented:
[ 7.960000] Reserved instruction in kernel
[ 7.960000] Cpu 0
[ 7.960000] $ 0 : 00000000 00000000 00000014 00000005
[ 7.960000] $ 4 : 8fc2de48 00000001 00000000 8f59ddb0
[ 7.960000] $ 8 : 8f5ceec4 00000018 00000c00 00800000
[ 7.960000] $12 : 00000100 00000200 00000000 00457b84
[ 7.960000] $16 : 00000000 8fc2ba78 8f4ec980 00000001
[ 7.960000] $20 : 80418f90 00000000 00000000 000002dd
[ 7.960000] $24 : 0000009c 7730d7b8
[ 7.960000] $28 : 8f59c000 8f59dd38 00000001 80104248
[ 7.960000] Hi : 0000001d
[ 7.960000] Lo : 0000000b
[ 7.960000] epc : 801041ec thread_saved_pc+0x2c/0x38
[ 7.960000] Not tainted
[ 7.960000] ra : 80104248 get_wchan+0x48/0xac
[ 7.960000] Status: 1000b703 KERNEL EXL IE
[ 7.960000] Cause : 10800028
[ 7.960000] PrId : 00019300 (MIPS 24Kc)
[ 7.960000] Modules linked in:
[ 7.960000] Process killall (pid: 1574, threadinfo=8f59c000,
task=8fd14558, tls=773aa440)
[ 7.960000] Stack : 8fc2ba78 8012b008 0000000c 0000001d 00000000
00000000 8f58a380
8f58a380 8fc2ba78 80202668 8f59de78 8f468600 8f59de28
801b2a3c 8f59df00 8f98ba20 74696e69
8f468600 8f59de28 801b7308 0081c007 00000000 00000000
00000000 00000000 00000000 00000000
00000000 8fc2bbb4 00000001 0000001d 0000000b 77f038cc
7fe80648 ffffffff ffffffff 00000000
00000001 0016e000 00000000 ...
[ 7.960000] Call Trace:
[ 7.960000] [<801041ec>] thread_saved_pc+0x2c/0x38
[ 7.960000] [<80104248>] get_wchan+0x48/0xac
The disassembly of thread_saved_pc points to the following:
000006d0 <thread_saved_pc>:
6d0: 8c820208 lw v0,520(a0)
6d4: 3c030000 lui v1,0x0
6d8: 24630000 addiu v1,v1,0
6dc: 10430008 beq v0,v1,700 <thread_saved_pc+0x30>
6e0: 00000000 nop
6e4: 3c020000 lui v0,0x0
6e8: 8c43000c lw v1,12(v0)
6ec: 04620004 bltzl v1,700 <thread_saved_pc+0x30>
6f0: 00001021 move v0,zero
6f4: 8c840200 lw a0,512(a0)
6f8: 00031080 sll v0,v1,0x2
6fc: 7c44100a lwx v0,a0(v0) <------------
700: 03e00008 jr ra
704: 00000000 nop
If we specifically disable -mdsp/-mdspr2 for arch/mips/kernel/process.o,
we get the following (non-crashing) assembly:
00000708 <thread_saved_pc>:
708: 8c820208 lw v0,520(a0)
70c: 3c030000 lui v1,0x0
710: 24630000 addiu v1,v1,0
714: 10430009 beq v0,v1,73c <thread_saved_pc+0x34>
718: 00000000 nop
71c: 3c020000 lui v0,0x0
720: 8c42000c lw v0,12(v0)
724: 04420005 bltzl v0,73c <thread_saved_pc+0x34>
728: 00001021 move v0,zero
72c: 8c830200 lw v1,512(a0)
730: 00021080 sll v0,v0,0x2
734: 00431021 addu v0,v0,v1
738: 8c420000 lw v0,0(v0)
73c: 03e00008 jr ra
740: 00000000 nop
The specific line that leads a different assembly being produced is:
unsigned long thread_saved_pc(struct task_struct *tsk)
...
return ((unsigned long *)t->reg29)[schedule_mfi.pc_offset]; <---
The problem here is that the compiler was given the right to use DSP
instructions with the -mdsp / -mdspr2 command-line switches and
performed some optimization for us and used DSP ASE instructions where
we are not checking that the running CPU actually supports DSP ASE.
This patch fixes the issue by partially reverting commit 32a7ede for
arch/mips/kernel/Makefile in order to remove the -mdsp / -mdspr2
compiler command-line switches such that we are now guaranteed that the
compiler will not optimize using DSP ASE reserved instructions. We also
need to fixup the rddsp/wrdsp and m{t,h}{hi,lo}{0,1,2,3} macros in
arch/mips/include/asm/mipsregs.h to tell the assembler that we are going
to explicitely use DSP ASE reserved instructions. The comment in
arch/mips/kernel/Makefile is also updated to reflect that.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Acked-by: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: blogic@openwrt.org
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2013-03-18 23:56:10 +08:00
|
|
|
# DSP ASE supported for MIPS32 or MIPS64 Release 2 cores only. It is not
|
|
|
|
# safe to unconditionnaly use the assembler -mdsp / -mdspr2 switches
|
|
|
|
# here because the compiler may use DSP ASE instructions (such as lwx) in
|
|
|
|
# code paths where we cannot check that the CPU we are running on supports it.
|
|
|
|
# Proper abstraction using HAVE_AS_DSP and macros is done in
|
|
|
|
# arch/mips/include/asm/mipsregs.h.
|
2013-01-04 03:01:52 +08:00
|
|
|
#
|
|
|
|
ifeq ($(CONFIG_CPU_MIPSR2), y)
|
|
|
|
CFLAGS_DSP = -DHAVE_AS_DSP
|
|
|
|
|
|
|
|
CFLAGS_signal.o = $(CFLAGS_DSP)
|
|
|
|
CFLAGS_signal32.o = $(CFLAGS_DSP)
|
|
|
|
CFLAGS_process.o = $(CFLAGS_DSP)
|
|
|
|
CFLAGS_branch.o = $(CFLAGS_DSP)
|
|
|
|
CFLAGS_ptrace.o = $(CFLAGS_DSP)
|
|
|
|
endif
|
|
|
|
|
2009-12-17 09:57:36 +08:00
|
|
|
CPPFLAGS_vmlinux.lds := $(KBUILD_CFLAGS)
|