Skip to content

Commit dd430ca

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86
* git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86: (890 commits) x86: fix nodemap_size according to nodeid bits x86: fix overlap between pagetable with bss section x86: add PCI IDs to k8topology_64.c x86: fix early_ioremap pagetable ops x86: use the same pgd_list for PAE and 64-bit x86: defer cr3 reload when doing pud_clear() x86: early boot debugging via FireWire (ohci1394_dma=early) x86: don't special-case pmd allocations as much x86: shrink some ifdefs in fault.c x86: ignore spurious faults x86: remove nx_enabled from fault.c x86: unify fault_32|64.c x86: unify fault_32|64.c with ifdefs x86: unify fault_32|64.c by ifdef'd function bodies x86: arch/x86/mm/init_32.c printk fixes x86: arch/x86/mm/init_32.c cleanup x86: arch/x86/mm/init_64.c printk fixes x86: unify ioremap x86: fixes some bugs about EFI memory map handling x86: use reboot_type on EFI 32 ...
2 parents 60e2331 + afadcd7 commit dd430ca

File tree

635 files changed

+36226
-36994
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

635 files changed

+36226
-36994
lines changed
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
2+
Using physical DMA provided by OHCI-1394 FireWire controllers for debugging
3+
---------------------------------------------------------------------------
4+
5+
Introduction
6+
------------
7+
8+
Basically all FireWire controllers which are in use today are compliant
9+
to the OHCI-1394 specification which defines the controller to be a PCI
10+
bus master which uses DMA to offload data transfers from the CPU and has
11+
a "Physical Response Unit" which executes specific requests by employing
12+
PCI-Bus master DMA after applying filters defined by the OHCI-1394 driver.
13+
14+
Once properly configured, remote machines can send these requests to
15+
ask the OHCI-1394 controller to perform read and write requests on
16+
physical system memory and, for read requests, send the result of
17+
the physical memory read back to the requester.
18+
19+
With that, it is possible to debug issues by reading interesting memory
20+
locations such as buffers like the printk buffer or the process table.
21+
22+
Retrieving a full system memory dump is also possible over the FireWire,
23+
using data transfer rates in the order of 10MB/s or more.
24+
25+
Memory access is currently limited to the low 4G of physical address
26+
space which can be a problem on IA64 machines where memory is located
27+
mostly above that limit, but it is rarely a problem on more common
28+
hardware such as hardware based on x86, x86-64 and PowerPC.
29+
30+
Together with a early initialization of the OHCI-1394 controller for debugging,
31+
this facility proved most useful for examining long debugs logs in the printk
32+
buffer on to debug early boot problems in areas like ACPI where the system
33+
fails to boot and other means for debugging (serial port) are either not
34+
available (notebooks) or too slow for extensive debug information (like ACPI).
35+
36+
Drivers
37+
-------
38+
39+
The OHCI-1394 drivers in drivers/firewire and drivers/ieee1394 initialize
40+
the OHCI-1394 controllers to a working state and can be used to enable
41+
physical DMA. By default you only have to load the driver, and physical
42+
DMA access will be granted to all remote nodes, but it can be turned off
43+
when using the ohci1394 driver.
44+
45+
Because these drivers depend on the PCI enumeration to be completed, an
46+
initialization routine which can runs pretty early (long before console_init(),
47+
which makes the printk buffer appear on the console can be called) was written.
48+
49+
To activate it, enable CONFIG_PROVIDE_OHCI1394_DMA_INIT (Kernel hacking menu:
50+
Provide code for enabling DMA over FireWire early on boot) and pass the
51+
parameter "ohci1394_dma=early" to the recompiled kernel on boot.
52+
53+
Tools
54+
-----
55+
56+
firescope - Originally developed by Benjamin Herrenschmidt, Andi Kleen ported
57+
it from PowerPC to x86 and x86_64 and added functionality, firescope can now
58+
be used to view the printk buffer of a remote machine, even with live update.
59+
60+
Bernhard Kaindl enhanced firescope to support accessing 64-bit machines
61+
from 32-bit firescope and vice versa:
62+
- ftp://ftp.suse.de/private/bk/firewire/tools/firescope-0.2.2.tar.bz2
63+
64+
and he implemented fast system dump (alpha version - read README.txt):
65+
- ftp://ftp.suse.de/private/bk/firewire/tools/firedump-0.1.tar.bz2
66+
67+
There is also a gdb proxy for firewire which allows to use gdb to access
68+
data which can be referenced from symbols found by gdb in vmlinux:
69+
- ftp://ftp.suse.de/private/bk/firewire/tools/fireproxy-0.33.tar.bz2
70+
71+
The latest version of this gdb proxy (fireproxy-0.34) can communicate (not
72+
yet stable) with kgdb over an memory-based communication module (kgdbom).
73+
74+
Getting Started
75+
---------------
76+
77+
The OHCI-1394 specification regulates that the OHCI-1394 controller must
78+
disable all physical DMA on each bus reset.
79+
80+
This means that if you want to debug an issue in a system state where
81+
interrupts are disabled and where no polling of the OHCI-1394 controller
82+
for bus resets takes place, you have to establish any FireWire cable
83+
connections and fully initialize all FireWire hardware __before__ the
84+
system enters such state.
85+
86+
Step-by-step instructions for using firescope with early OHCI initialization:
87+
88+
1) Verify that your hardware is supported:
89+
90+
Load the ohci1394 or the fw-ohci module and check your kernel logs.
91+
You should see a line similar to
92+
93+
ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[18] MMIO=[fe9ff800-fe9fffff]
94+
... Max Packet=[2048] IR/IT contexts=[4/8]
95+
96+
when loading the driver. If you have no supported controller, many PCI,
97+
CardBus and even some Express cards which are fully compliant to OHCI-1394
98+
specification are available. If it requires no driver for Windows operating
99+
systems, it most likely is. Only specialized shops have cards which are not
100+
compliant, they are based on TI PCILynx chips and require drivers for Win-
101+
dows operating systems.
102+
103+
2) Establish a working FireWire cable connection:
104+
105+
Any FireWire cable, as long at it provides electrically and mechanically
106+
stable connection and has matching connectors (there are small 4-pin and
107+
large 6-pin FireWire ports) will do.
108+
109+
If an driver is running on both machines you should see a line like
110+
111+
ieee1394: Node added: ID:BUS[0-01:1023] GUID[0090270001b84bba]
112+
113+
on both machines in the kernel log when the cable is plugged in
114+
and connects the two machines.
115+
116+
3) Test physical DMA using firescope:
117+
118+
On the debug host,
119+
- load the raw1394 module,
120+
- make sure that /dev/raw1394 is accessible,
121+
then start firescope:
122+
123+
$ firescope
124+
Port 0 (ohci1394) opened, 2 nodes detected
125+
126+
FireScope
127+
---------
128+
Target : <unspecified>
129+
Gen : 1
130+
[Ctrl-T] choose target
131+
[Ctrl-H] this menu
132+
[Ctrl-Q] quit
133+
134+
------> Press Ctrl-T now, the output should be similar to:
135+
136+
2 nodes available, local node is: 0
137+
0: ffc0, uuid: 00000000 00000000 [LOCAL]
138+
1: ffc1, uuid: 00279000 ba4bb801
139+
140+
Besides the [LOCAL] node, it must show another node without error message.
141+
142+
4) Prepare for debugging with early OHCI-1394 initialization:
143+
144+
4.1) Kernel compilation and installation on debug target
145+
146+
Compile the kernel to be debugged with CONFIG_PROVIDE_OHCI1394_DMA_INIT
147+
(Kernel hacking: Provide code for enabling DMA over FireWire early on boot)
148+
enabled and install it on the machine to be debugged (debug target).
149+
150+
4.2) Transfer the System.map of the debugged kernel to the debug host
151+
152+
Copy the System.map of the kernel be debugged to the debug host (the host
153+
which is connected to the debugged machine over the FireWire cable).
154+
155+
5) Retrieving the printk buffer contents:
156+
157+
With the FireWire cable connected, the OHCI-1394 driver on the debugging
158+
host loaded, reboot the debugged machine, booting the kernel which has
159+
CONFIG_PROVIDE_OHCI1394_DMA_INIT enabled, with the option ohci1394_dma=early.
160+
161+
Then, on the debugging host, run firescope, for example by using -A:
162+
163+
firescope -A System.map-of-debug-target-kernel
164+
165+
Note: -A automatically attaches to the first non-local node. It only works
166+
reliably if only connected two machines are connected using FireWire.
167+
168+
After having attached to the debug target, press Ctrl-D to view the
169+
complete printk buffer or Ctrl-U to enter auto update mode and get an
170+
updated live view of recent kernel messages logged on the debug target.
171+
172+
Call "firescope -h" to get more information on firescope's options.
173+
174+
Notes
175+
-----
176+
Documentation and specifications: ftp://ftp.suse.de/private/bk/firewire/docs
177+
178+
FireWire is a trademark of Apple Inc. - for more information please refer to:
179+
http://en.wikipedia.org/wiki/FireWire

Documentation/kernel-parameters.txt

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,21 @@ and is between 256 and 4096 characters. It is defined in the file
416416
[SPARC64] tick
417417
[X86-64] hpet,tsc
418418

419-
code_bytes [IA32] How many bytes of object code to print in an
420-
oops report.
419+
clearcpuid=BITNUM [X86]
420+
Disable CPUID feature X for the kernel. See
421+
include/asm-x86/cpufeature.h for the valid bit numbers.
422+
Note the Linux specific bits are not necessarily
423+
stable over kernel options, but the vendor specific
424+
ones should be.
425+
Also note that user programs calling CPUID directly
426+
or using the feature without checking anything
427+
will still see it. This just prevents it from
428+
being used by the kernel or shown in /proc/cpuinfo.
429+
Also note the kernel might malfunction if you disable
430+
some critical bits.
431+
432+
code_bytes [IA32/X86_64] How many bytes of object code to print
433+
in an oops report.
421434
Range: 0 - 8192
422435
Default: 64
423436

@@ -570,6 +583,12 @@ and is between 256 and 4096 characters. It is defined in the file
570583
See drivers/char/README.epca and
571584
Documentation/digiepca.txt.
572585

586+
disable_mtrr_trim [X86, Intel and AMD only]
587+
By default the kernel will trim any uncacheable
588+
memory out of your available memory pool based on
589+
MTRR settings. This parameter disables that behavior,
590+
possibly causing your machine to run very slowly.
591+
573592
dmasound= [HW,OSS] Sound subsystem buffers
574593

575594
dscc4.setup= [NET]
@@ -660,6 +679,10 @@ and is between 256 and 4096 characters. It is defined in the file
660679

661680
gamma= [HW,DRM]
662681

682+
gart_fix_e820= [X86_64] disable the fix e820 for K8 GART
683+
Format: off | on
684+
default: on
685+
663686
gdth= [HW,SCSI]
664687
See header of drivers/scsi/gdth.c.
665688

@@ -794,6 +817,16 @@ and is between 256 and 4096 characters. It is defined in the file
794817
for translation below 32 bit and if not available
795818
then look in the higher range.
796819

820+
io_delay= [X86-32,X86-64] I/O delay method
821+
0x80
822+
Standard port 0x80 based delay
823+
0xed
824+
Alternate port 0xed based delay (needed on some systems)
825+
udelay
826+
Simple two microseconds delay
827+
none
828+
No delay
829+
797830
io7= [HW] IO7 for Marvel based alpha systems
798831
See comment before marvel_specify_io7 in
799832
arch/alpha/kernel/core_marvel.c.
@@ -1059,6 +1092,11 @@ and is between 256 and 4096 characters. It is defined in the file
10591092
Multi-Function General Purpose Timers on AMD Geode
10601093
platforms.
10611094

1095+
mfgptfix [X86-32] Fix MFGPT timers on AMD Geode platforms when
1096+
the BIOS has incorrectly applied a workaround. TinyBIOS
1097+
version 0.98 is known to be affected, 0.99 fixes the
1098+
problem by letting the user disable the workaround.
1099+
10621100
mga= [HW,DRM]
10631101

10641102
mousedev.tap_time=
@@ -1159,6 +1197,8 @@ and is between 256 and 4096 characters. It is defined in the file
11591197

11601198
nodisconnect [HW,SCSI,M68K] Disables SCSI disconnects.
11611199

1200+
noefi [X86-32,X86-64] Disable EFI runtime services support.
1201+
11621202
noexec [IA-64]
11631203

11641204
noexec [X86-32,X86-64]
@@ -1169,6 +1209,8 @@ and is between 256 and 4096 characters. It is defined in the file
11691209
register save and restore. The kernel will only save
11701210
legacy floating-point registers on task switch.
11711211

1212+
noclflush [BUGS=X86] Don't use the CLFLUSH instruction
1213+
11721214
nohlt [BUGS=ARM]
11731215

11741216
no-hlt [BUGS=X86-32] Tells the kernel that the hlt
@@ -1978,6 +2020,11 @@ and is between 256 and 4096 characters. It is defined in the file
19782020
vdso=1: enable VDSO (default)
19792021
vdso=0: disable VDSO mapping
19802022

2023+
vdso32= [X86-32,X86-64]
2024+
vdso32=2: enable compat VDSO (default with COMPAT_VDSO)
2025+
vdso32=1: enable 32-bit VDSO (default)
2026+
vdso32=0: disable 32-bit VDSO mapping
2027+
19812028
vector= [IA-64,SMP]
19822029
vector=percpu: enable percpu vector domain
19832030

Documentation/x86_64/boot-options.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,18 @@ Idle loop
110110

111111
Rebooting
112112

113-
reboot=b[ios] | t[riple] | k[bd] [, [w]arm | [c]old]
113+
reboot=b[ios] | t[riple] | k[bd] | a[cpi] | e[fi] [, [w]arm | [c]old]
114114
bios Use the CPU reboot vector for warm reset
115115
warm Don't set the cold reboot flag
116116
cold Set the cold reboot flag
117117
triple Force a triple fault (init)
118118
kbd Use the keyboard controller. cold reset (default)
119+
acpi Use the ACPI RESET_REG in the FADT. If ACPI is not configured or the
120+
ACPI reset does not work, the reboot path attempts the reset using
121+
the keyboard controller.
122+
efi Use efi reset_system runtime service. If EFI is not configured or the
123+
EFI reset does not work, the reboot path attempts the reset using
124+
the keyboard controller.
119125

120126
Using warm reset will be much faster especially on big memory
121127
systems because the BIOS will not go through the memory check.

Documentation/x86_64/uefi.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ Mechanics:
1919
- Build the kernel with the following configuration.
2020
CONFIG_FB_EFI=y
2121
CONFIG_FRAMEBUFFER_CONSOLE=y
22+
If EFI runtime services are expected, the following configuration should
23+
be selected.
24+
CONFIG_EFI=y
25+
CONFIG_EFI_VARS=y or m # optional
2226
- Create a VFAT partition on the disk
2327
- Copy the following to the VFAT partition:
2428
elilo bootloader with x86_64 support, elilo configuration file,
@@ -27,3 +31,8 @@ Mechanics:
2731
can be found in the elilo sourceforge project.
2832
- Boot to EFI shell and invoke elilo choosing the kernel image built
2933
in first step.
34+
- If some or all EFI runtime services don't work, you can try following
35+
kernel command line parameters to turn off some or all EFI runtime
36+
services.
37+
noefi turn off all EFI runtime services
38+
reboot_type=k turn off EFI reboot runtime service

arch/arm/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ config GENERIC_IRQ_PROBE
9191
bool
9292
default y
9393

94+
config GENERIC_LOCKBREAK
95+
bool
96+
default y
97+
depends on SMP && PREEMPT
98+
9499
config RWSEM_GENERIC_SPINLOCK
95100
bool
96101
default y

arch/ia64/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ config MMU
4242
config SWIOTLB
4343
bool
4444

45+
config GENERIC_LOCKBREAK
46+
bool
47+
default y
48+
depends on SMP && PREEMPT
49+
4550
config RWSEM_XCHGADD_ALGORITHM
4651
bool
4752
default y
@@ -75,6 +80,9 @@ config GENERIC_TIME_VSYSCALL
7580
bool
7681
default y
7782

83+
config ARCH_SETS_UP_PER_CPU_AREA
84+
def_bool y
85+
7886
config DMI
7987
bool
8088
default y

arch/ia64/ia32/binfmt_elf32.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ elf32_set_personality (void)
222222
}
223223

224224
static unsigned long
225-
elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type)
225+
elf32_map(struct file *filep, unsigned long addr, struct elf_phdr *eppnt,
226+
int prot, int type, unsigned long unused)
226227
{
227228
unsigned long pgoff = (eppnt->p_vaddr) & ~IA32_PAGE_MASK;
228229

arch/ia64/kernel/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ percpu_modcopy (void *pcpudst, const void *src, unsigned long size)
947947
{
948948
unsigned int i;
949949
for_each_possible_cpu(i) {
950-
memcpy(pcpudst + __per_cpu_offset[i], src, size);
950+
memcpy(pcpudst + per_cpu_offset(i), src, size);
951951
}
952952
}
953953
#endif /* CONFIG_SMP */

arch/m32r/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,11 @@ config IRAM_SIZE
235235
# Define implied options from the CPU selection here
236236
#
237237

238+
config GENERIC_LOCKBREAK
239+
bool
240+
default y
241+
depends on SMP && PREEMPT
242+
238243
config RWSEM_GENERIC_SPINLOCK
239244
bool
240245
depends on M32R

0 commit comments

Comments
 (0)