sparc: fix MSI build failure on Sparc32
Commit ebd97be635 ('PCI: remove ARCH_SUPPORTS_MSI kconfig option')
removes the ARCH_SUPPORTS_MSI Kconfig option that allowed
architectures to indicate whether they support PCI MSI or not. Now,
PCI MSI support can be compiled in on any architecture thanks to the
use of weak functions thanks to 4287d824f265 ('PCI: use weak functions
for MSI arch-specific functions').
So, architecture specific code is now responsible to ensure that its
PCI MSI code builds in all cases, or be appropriately conditionally
compiled.
On Sparc, the MSI support is only provided for Sparc64, so the
ARCH_SUPPORTS_MSI kconfig option was only selected for SPARC64, and
not for the Sparc architecture as a whole. Therefore, removing
ARCH_SUPPORTS_MSI broke Sparc32 configurations with CONFIG_PCI_MSI=y,
because the Sparc-specific MSI code is not designed to be built on
Sparc32.
To solve this, this commit ensures that the Sparc MSI code is only
built on Sparc64. This is done thanks to a new Kconfig Makefile helper
option SPARC64_PCI_MSI, modeled after the existing SPARC64_PCI. The
SPARC64_PCI_MSI option is an hidden option that is true when both
Sparc64 PCI support is enabled and MSI is enabled. The
arch/sparc/kernel/pci_msi.c file is now only built when
SPARC64_PCI_MSI is true.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-11 18:32:05 +08:00
|
|
|
|
2008-03-04 07:01:05 +08:00
|
|
|
#
|
2005-04-17 06:20:36 +08:00
|
|
|
# Makefile for the linux kernel.
|
|
|
|
#
|
|
|
|
|
2008-12-03 19:08:37 +08:00
|
|
|
asflags-y := -ansi
|
|
|
|
ccflags-y := -Werror
|
|
|
|
|
|
|
|
extra-y := head_$(BITS).o
|
2009-09-20 18:28:22 +08:00
|
|
|
|
|
|
|
# Undefine sparc when processing vmlinux.lds - it is used
|
|
|
|
# And teach CPP we are doing $(BITS) builds (for this case)
|
|
|
|
CPPFLAGS_vmlinux.lds := -Usparc -m$(BITS)
|
|
|
|
extra-y += vmlinux.lds
|
2008-12-03 19:08:37 +08:00
|
|
|
|
2010-04-07 08:34:15 +08:00
|
|
|
ifdef CONFIG_FUNCTION_TRACER
|
|
|
|
# Do not profile debug and lowlevel utilities
|
|
|
|
CFLAGS_REMOVE_ftrace.o := -pg
|
|
|
|
CFLAGS_REMOVE_time_$(BITS).o := -pg
|
|
|
|
CFLAGS_REMOVE_perf_event.o := -pg
|
|
|
|
CFLAGS_REMOVE_pcr.o := -pg
|
|
|
|
endif
|
|
|
|
|
sparc64: Fix return from trap window fill crashes.
We must handle data access exception as well as memory address unaligned
exceptions from return from trap window fill faults, not just normal
TLB misses.
Otherwise we can get an OOPS that looks like this:
ld-linux.so.2(36808): Kernel bad sw trap 5 [#1]
CPU: 1 PID: 36808 Comm: ld-linux.so.2 Not tainted 4.6.0 #34
task: fff8000303be5c60 ti: fff8000301344000 task.ti: fff8000301344000
TSTATE: 0000004410001601 TPC: 0000000000a1a784 TNPC: 0000000000a1a788 Y: 00000002 Not tainted
TPC: <do_sparc64_fault+0x5c4/0x700>
g0: fff8000024fc8248 g1: 0000000000db04dc g2: 0000000000000000 g3: 0000000000000001
g4: fff8000303be5c60 g5: fff800030e672000 g6: fff8000301344000 g7: 0000000000000001
o0: 0000000000b95ee8 o1: 000000000000012b o2: 0000000000000000 o3: 0000000200b9b358
o4: 0000000000000000 o5: fff8000301344040 sp: fff80003013475c1 ret_pc: 0000000000a1a77c
RPC: <do_sparc64_fault+0x5bc/0x700>
l0: 00000000000007ff l1: 0000000000000000 l2: 000000000000005f l3: 0000000000000000
l4: fff8000301347e98 l5: fff8000024ff3060 l6: 0000000000000000 l7: 0000000000000000
i0: fff8000301347f60 i1: 0000000000102400 i2: 0000000000000000 i3: 0000000000000000
i4: 0000000000000000 i5: 0000000000000000 i6: fff80003013476a1 i7: 0000000000404d4c
I7: <user_rtt_fill_fixup+0x6c/0x7c>
Call Trace:
[0000000000404d4c] user_rtt_fill_fixup+0x6c/0x7c
The window trap handlers are slightly clever, the trap table entries for them are
composed of two pieces of code. First comes the code that actually performs
the window fill or spill trap handling, and then there are three instructions at
the end which are for exception processing.
The userland register window fill handler is:
add %sp, STACK_BIAS + 0x00, %g1; \
ldxa [%g1 + %g0] ASI, %l0; \
mov 0x08, %g2; \
mov 0x10, %g3; \
ldxa [%g1 + %g2] ASI, %l1; \
mov 0x18, %g5; \
ldxa [%g1 + %g3] ASI, %l2; \
ldxa [%g1 + %g5] ASI, %l3; \
add %g1, 0x20, %g1; \
ldxa [%g1 + %g0] ASI, %l4; \
ldxa [%g1 + %g2] ASI, %l5; \
ldxa [%g1 + %g3] ASI, %l6; \
ldxa [%g1 + %g5] ASI, %l7; \
add %g1, 0x20, %g1; \
ldxa [%g1 + %g0] ASI, %i0; \
ldxa [%g1 + %g2] ASI, %i1; \
ldxa [%g1 + %g3] ASI, %i2; \
ldxa [%g1 + %g5] ASI, %i3; \
add %g1, 0x20, %g1; \
ldxa [%g1 + %g0] ASI, %i4; \
ldxa [%g1 + %g2] ASI, %i5; \
ldxa [%g1 + %g3] ASI, %i6; \
ldxa [%g1 + %g5] ASI, %i7; \
restored; \
retry; nop; nop; nop; nop; \
b,a,pt %xcc, fill_fixup_dax; \
b,a,pt %xcc, fill_fixup_mna; \
b,a,pt %xcc, fill_fixup;
And the way this works is that if any of those memory accesses
generate an exception, the exception handler can revector to one of
those final three branch instructions depending upon which kind of
exception the memory access took. In this way, the fault handler
doesn't have to know if it was a spill or a fill that it's handling
the fault for. It just always branches to the last instruction in
the parent trap's handler.
For example, for a regular fault, the code goes:
winfix_trampoline:
rdpr %tpc, %g3
or %g3, 0x7c, %g3
wrpr %g3, %tnpc
done
All window trap handlers are 0x80 aligned, so if we "or" 0x7c into the
trap time program counter, we'll get that final instruction in the
trap handler.
On return from trap, we have to pull the register window in but we do
this by hand instead of just executing a "restore" instruction for
several reasons. The largest being that from Niagara and onward we
simply don't have enough levels in the trap stack to fully resolve all
possible exception cases of a window fault when we are already at
trap level 1 (which we enter to get ready to return from the original
trap).
This is executed inline via the FILL_*_RTRAP handlers. rtrap_64.S's
code branches directly to these to do the window fill by hand if
necessary. Now if you look at them, we'll see at the end:
ba,a,pt %xcc, user_rtt_fill_fixup;
ba,a,pt %xcc, user_rtt_fill_fixup;
ba,a,pt %xcc, user_rtt_fill_fixup;
And oops, all three cases are handled like a fault.
This doesn't work because each of these trap types (data access
exception, memory address unaligned, and faults) store their auxiliary
info in different registers to pass on to the C handler which does the
real work.
So in the case where the stack was unaligned, the unaligned trap
handler sets up the arg registers one way, and then we branched to
the fault handler which expects them setup another way.
So the FAULT_TYPE_* value ends up basically being garbage, and
randomly would generate the backtrace seen above.
Reported-by: Nick Alcock <nix@esperi.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-05-29 11:41:12 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += urtt_fill.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += entry.o wof.o wuf.o
|
|
|
|
obj-$(CONFIG_SPARC32) += etrap_32.o
|
|
|
|
obj-$(CONFIG_SPARC32) += rtrap_32.o
|
|
|
|
obj-y += traps_$(BITS).o
|
|
|
|
|
|
|
|
# IRQ
|
|
|
|
obj-y += irq_$(BITS).o
|
2012-05-11 19:35:04 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += sun4m_irq.o sun4d_irq.o
|
2008-12-03 19:08:37 +08:00
|
|
|
|
|
|
|
obj-y += process_$(BITS).o
|
|
|
|
obj-y += signal_$(BITS).o
|
2011-08-21 08:14:54 +08:00
|
|
|
obj-y += sigutil_$(BITS).o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += ioport.o
|
|
|
|
obj-y += setup_$(BITS).o
|
2008-12-07 16:50:29 +08:00
|
|
|
obj-y += idprom.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-y += sys_sparc_$(BITS).o
|
|
|
|
obj-$(CONFIG_SPARC32) += systbls_32.o
|
|
|
|
obj-y += time_$(BITS).o
|
|
|
|
obj-$(CONFIG_SPARC32) += windows.o
|
2008-12-07 16:04:30 +08:00
|
|
|
obj-y += cpu.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += devices.o
|
|
|
|
obj-y += ptrace_$(BITS).o
|
|
|
|
obj-y += unaligned_$(BITS).o
|
|
|
|
obj-y += una_asm_$(BITS).o
|
2008-12-05 12:28:22 +08:00
|
|
|
obj-y += prom_common.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-y += prom_$(BITS).o
|
2009-06-04 17:00:02 +08:00
|
|
|
obj-y += of_device_common.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-y += of_device_$(BITS).o
|
2008-12-05 16:43:03 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += prom_irqtrans.o
|
2008-12-03 19:08:37 +08:00
|
|
|
|
2012-05-26 05:20:13 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += leon_kernel.o
|
2012-05-26 12:43:27 +08:00
|
|
|
obj-$(CONFIG_SPARC32) += leon_pmc.o
|
2009-08-17 08:13:31 +08:00
|
|
|
|
2008-12-03 19:11:52 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += reboot.o
|
|
|
|
obj-$(CONFIG_SPARC64) += sysfs.o
|
|
|
|
obj-$(CONFIG_SPARC64) += iommu.o
|
|
|
|
obj-$(CONFIG_SPARC64) += central.o
|
|
|
|
obj-$(CONFIG_SPARC64) += starfire.o
|
|
|
|
obj-$(CONFIG_SPARC64) += power.o
|
|
|
|
obj-$(CONFIG_SPARC64) += sbus.o
|
|
|
|
obj-$(CONFIG_SPARC64) += ebus.o
|
|
|
|
obj-$(CONFIG_SPARC64) += visemul.o
|
|
|
|
obj-$(CONFIG_SPARC64) += hvapi.o
|
|
|
|
obj-$(CONFIG_SPARC64) += sstate.o
|
|
|
|
obj-$(CONFIG_SPARC64) += mdesc.o
|
2009-01-22 13:30:23 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += pcr.o
|
2009-01-30 13:22:47 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += nmi.o
|
2009-06-04 17:10:11 +08:00
|
|
|
obj-$(CONFIG_SPARC64_SMP) += cpumap.o
|
2008-12-03 19:11:52 +08:00
|
|
|
|
2009-08-10 10:53:17 +08:00
|
|
|
obj-y += dma.o
|
2008-12-03 19:08:37 +08:00
|
|
|
|
2011-05-24 05:04:46 +08:00
|
|
|
obj-$(CONFIG_PCIC_PCI) += pcic.o
|
2011-05-24 05:04:47 +08:00
|
|
|
obj-$(CONFIG_LEON_PCI) += leon_pci.o
|
2013-03-05 15:04:21 +08:00
|
|
|
obj-$(CONFIG_SPARC_GRPCI2)+= leon_pci_grpci2.o
|
2013-03-05 15:03:30 +08:00
|
|
|
obj-$(CONFIG_SPARC_GRPCI1)+= leon_pci_grpci1.o
|
2008-12-03 19:08:37 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_SMP) += trampoline_$(BITS).o smp_$(BITS).o
|
2009-09-01 06:08:13 +08:00
|
|
|
obj-$(CONFIG_SPARC32_SMP) += sun4m_smp.o sun4d_smp.o leon_smp.o
|
2008-12-03 19:11:52 +08:00
|
|
|
obj-$(CONFIG_SPARC64_SMP) += hvtramp.o
|
2008-12-03 19:08:37 +08:00
|
|
|
|
|
|
|
obj-y += auxio_$(BITS).o
|
|
|
|
obj-$(CONFIG_SUN_PM) += apc.o pmc.o
|
|
|
|
|
2008-12-27 07:38:17 +08:00
|
|
|
obj-$(CONFIG_MODULES) += module.o
|
2008-12-03 19:08:37 +08:00
|
|
|
obj-$(CONFIG_MODULES) += sparc_ksyms_$(BITS).o
|
|
|
|
obj-$(CONFIG_SPARC_LED) += led.o
|
|
|
|
obj-$(CONFIG_KGDB) += kgdb_$(BITS).o
|
2008-12-03 19:11:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
|
2010-04-07 19:41:33 +08:00
|
|
|
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
|
2008-12-03 19:11:52 +08:00
|
|
|
|
2009-11-28 09:33:43 +08:00
|
|
|
obj-$(CONFIG_EARLYFB) += btext.o
|
2008-12-03 19:11:52 +08:00
|
|
|
obj-$(CONFIG_STACKTRACE) += stacktrace.o
|
|
|
|
# sparc64 PCI
|
|
|
|
obj-$(CONFIG_SPARC64_PCI) += pci.o pci_common.o psycho_common.o
|
|
|
|
obj-$(CONFIG_SPARC64_PCI) += pci_psycho.o pci_sabre.o pci_schizo.o
|
|
|
|
obj-$(CONFIG_SPARC64_PCI) += pci_sun4v.o pci_sun4v_asm.o pci_fire.o
|
sparc: fix MSI build failure on Sparc32
Commit ebd97be635 ('PCI: remove ARCH_SUPPORTS_MSI kconfig option')
removes the ARCH_SUPPORTS_MSI Kconfig option that allowed
architectures to indicate whether they support PCI MSI or not. Now,
PCI MSI support can be compiled in on any architecture thanks to the
use of weak functions thanks to 4287d824f265 ('PCI: use weak functions
for MSI arch-specific functions').
So, architecture specific code is now responsible to ensure that its
PCI MSI code builds in all cases, or be appropriately conditionally
compiled.
On Sparc, the MSI support is only provided for Sparc64, so the
ARCH_SUPPORTS_MSI kconfig option was only selected for SPARC64, and
not for the Sparc architecture as a whole. Therefore, removing
ARCH_SUPPORTS_MSI broke Sparc32 configurations with CONFIG_PCI_MSI=y,
because the Sparc-specific MSI code is not designed to be built on
Sparc32.
To solve this, this commit ensures that the Sparc MSI code is only
built on Sparc64. This is done thanks to a new Kconfig Makefile helper
option SPARC64_PCI_MSI, modeled after the existing SPARC64_PCI. The
SPARC64_PCI_MSI option is an hidden option that is true when both
Sparc64 PCI support is enabled and MSI is enabled. The
arch/sparc/kernel/pci_msi.c file is now only built when
SPARC64_PCI_MSI is true.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-09-11 18:32:05 +08:00
|
|
|
obj-$(CONFIG_SPARC64_PCI_MSI) += pci_msi.o
|
2008-12-03 19:11:52 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_COMPAT) += sys32.o sys_sparc32.o signal32.o
|
|
|
|
|
|
|
|
obj-$(CONFIG_US3_MC) += chmc.o
|
|
|
|
|
|
|
|
obj-$(CONFIG_KPROBES) += kprobes.o
|
|
|
|
obj-$(CONFIG_SUN_LDOMS) += ldc.o vio.o viohs.o ds.o
|
|
|
|
|
|
|
|
obj-$(CONFIG_AUDIT) += audit.o
|
|
|
|
audit--$(CONFIG_AUDIT) := compat_audit.o
|
|
|
|
obj-$(CONFIG_COMPAT) += $(audit--y)
|
2009-09-10 21:28:20 +08:00
|
|
|
|
perf: Do the big rename: Performance Counters -> Performance Events
Bye-bye Performance Counters, welcome Performance Events!
In the past few months the perfcounters subsystem has grown out its
initial role of counting hardware events, and has become (and is
becoming) a much broader generic event enumeration, reporting, logging,
monitoring, analysis facility.
Naming its core object 'perf_counter' and naming the subsystem
'perfcounters' has become more and more of a misnomer. With pending
code like hw-breakpoints support the 'counter' name is less and
less appropriate.
All in one, we've decided to rename the subsystem to 'performance
events' and to propagate this rename through all fields, variables
and API names. (in an ABI compatible fashion)
The word 'event' is also a bit shorter than 'counter' - which makes
it slightly more convenient to write/handle as well.
Thanks goes to Stephane Eranian who first observed this misnomer and
suggested a rename.
User-space tooling and ABI compatibility is not affected - this patch
should be function-invariant. (Also, defconfigs were not touched to
keep the size down.)
This patch has been generated via the following script:
FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
sed -i \
-e 's/PERF_EVENT_/PERF_RECORD_/g' \
-e 's/PERF_COUNTER/PERF_EVENT/g' \
-e 's/perf_counter/perf_event/g' \
-e 's/nb_counters/nb_events/g' \
-e 's/swcounter/swevent/g' \
-e 's/tpcounter_event/tp_event/g' \
$FILES
for N in $(find . -name perf_counter.[ch]); do
M=$(echo $N | sed 's/perf_counter/perf_event/g')
mv $N $M
done
FILES=$(find . -name perf_event.*)
sed -i \
-e 's/COUNTER_MASK/REG_MASK/g' \
-e 's/COUNTER/EVENT/g' \
-e 's/\<event\>/event_id/g' \
-e 's/counter/event/g' \
-e 's/Counter/Event/g' \
$FILES
... to keep it as correct as possible. This script can also be
used by anyone who has pending perfcounters patches - it converts
a Linux kernel tree over to the new naming. We tried to time this
change to the point in time where the amount of pending patches
is the smallest: the end of the merge window.
Namespace clashes were fixed up in a preparatory patch - and some
stylistic fallout will be fixed up in a subsequent patch.
( NOTE: 'counters' are still the proper terminology when we deal
with hardware registers - and these sed scripts are a bit
over-eager in renaming them. I've undone some of that, but
in case there's something left where 'counter' would be
better than 'event' we can undo that on an individual basis
instead of touching an otherwise nicely automated patch. )
Suggested-by: Stephane Eranian <eranian@google.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Paul Mackerras <paulus@samba.org>
Reviewed-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <linux-arch@vger.kernel.org>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-21 18:02:48 +08:00
|
|
|
pc--$(CONFIG_PERF_EVENTS) := perf_event.o
|
2009-09-10 21:28:20 +08:00
|
|
|
obj-$(CONFIG_SPARC64) += $(pc--y)
|
2010-09-17 23:09:25 +08:00
|
|
|
|
|
|
|
obj-$(CONFIG_SPARC64) += jump_label.o
|