Skip to content

Commit e7f2f99

Browse files
committed
Merge phase #5 (misc) of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
Merges oprofile, timers/hpet, x86/traps, x86/time, and x86/core misc items. * 'x86-core-v4-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (132 commits) x86: change early_ioremap to use slots instead of nesting x86: adjust dependencies for CONFIG_X86_CMOV dumpstack: x86: various small unification steps, fix x86: remove additional_cpus x86: remove additional_cpus configurability x86: improve UP kernel when CPU-hotplug and SMP is enabled dumpstack: x86: various small unification steps dumpstack: i386: make kstack= an early boot-param and add oops=panic dumpstack: x86: use log_lvl and unify trace formatting dumptrace: x86: consistently include loglevel, print stack switch dumpstack: x86: add "end" parameter to valid_stack_ptr and print_context_stack dumpstack: x86: make printk_address equal dumpstack: x86: move die_nmi to dumpstack_32.c traps: x86: finalize unification of traps.c traps: x86: make traps_32.c and traps_64.c equal traps: x86: various noop-changes preparing for unification of traps_xx.c traps: x86_64: use task_pid_nr(tsk) instead of tsk->pid in do_general_protection traps: i386: expand clear_mem_error and remove from mach_traps.h traps: x86_64: make io_check_error equal to the one on i386 traps: i386: use preempt_conditional_sti/cli in do_int3 ...
2 parents 11a96d1 + c00193f commit e7f2f99

Some content is hidden

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

74 files changed

+2793
-2512
lines changed

Documentation/00-INDEX

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ hayes-esp.txt
159159
- info on using the Hayes ESP serial driver.
160160
highuid.txt
161161
- notes on the change from 16 bit to 32 bit user/group IDs.
162-
hpet.txt
163-
- High Precision Event Timer Driver for Linux.
164162
timers/
165163
- info on the timer related topics
166164
hw_random.txt

Documentation/timers/00-INDEX

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
00-INDEX
2+
- this file
3+
highres.txt
4+
- High resolution timers and dynamic ticks design notes
5+
hpet.txt
6+
- High Precision Event Timer Driver for Linux
7+
hrtimers.txt
8+
- subsystem for high-resolution kernel timers
9+
timer_stats.txt
10+
- timer usage statistics

Documentation/hpet.txt renamed to Documentation/timers/hpet.txt

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,32 @@
11
High Precision Event Timer Driver for Linux
22

3-
The High Precision Event Timer (HPET) hardware is the future replacement
4-
for the 8254 and Real Time Clock (RTC) periodic timer functionality.
5-
Each HPET can have up to 32 timers. It is possible to configure the
6-
first two timers as legacy replacements for 8254 and RTC periodic timers.
7-
A specification done by Intel and Microsoft can be found at
8-
<http://www.intel.com/technology/architecture/hpetspec.htm>.
3+
The High Precision Event Timer (HPET) hardware follows a specification
4+
by Intel and Microsoft which can be found at
5+
6+
http://www.intel.com/technology/architecture/hpetspec.htm
7+
8+
Each HPET has one fixed-rate counter (at 10+ MHz, hence "High Precision")
9+
and up to 32 comparators. Normally three or more comparators are provided,
10+
each of which can generate oneshot interupts and at least one of which has
11+
additional hardware to support periodic interrupts. The comparators are
12+
also called "timers", which can be misleading since usually timers are
13+
independent of each other ... these share a counter, complicating resets.
14+
15+
HPET devices can support two interrupt routing modes. In one mode, the
16+
comparators are additional interrupt sources with no particular system
17+
role. Many x86 BIOS writers don't route HPET interrupts at all, which
18+
prevents use of that mode. They support the other "legacy replacement"
19+
mode where the first two comparators block interrupts from 8254 timers
20+
and from the RTC.
921

1022
The driver supports detection of HPET driver allocation and initialization
1123
of the HPET before the driver module_init routine is called. This enables
1224
platform code which uses timer 0 or 1 as the main timer to intercept HPET
1325
initialization. An example of this initialization can be found in
14-
arch/i386/kernel/time_hpet.c.
26+
arch/x86/kernel/hpet.c.
1527

16-
The driver provides two APIs which are very similar to the API found in
17-
the rtc.c driver. There is a user space API and a kernel space API.
18-
An example user space program is provided below.
28+
The driver provides a userspace API which resembles the API found in the
29+
RTC driver framework. An example user space program is provided below.
1930

2031
#include <stdio.h>
2132
#include <stdlib.h>
@@ -286,15 +297,3 @@ out:
286297

287298
return;
288299
}
289-
290-
The kernel API has three interfaces exported from the driver:
291-
292-
hpet_register(struct hpet_task *tp, int periodic)
293-
hpet_unregister(struct hpet_task *tp)
294-
hpet_control(struct hpet_task *tp, unsigned int cmd, unsigned long arg)
295-
296-
The kernel module using this interface fills in the ht_func and ht_data
297-
members of the hpet_task structure before calling hpet_register.
298-
hpet_control simply vectors to the hpet_ioctl routine and has the same
299-
commands and respective arguments as the user API. hpet_unregister
300-
is used to terminate usage of the HPET timer reserved by hpet_register.

arch/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ config OPROFILE
1313

1414
If unsure, say N.
1515

16+
config OPROFILE_IBS
17+
bool "OProfile AMD IBS support (EXPERIMENTAL)"
18+
default n
19+
depends on OPROFILE && SMP && X86
20+
help
21+
Instruction-Based Sampling (IBS) is a new profiling
22+
technique that provides rich, precise program performance
23+
information. IBS is introduced by AMD Family10h processors
24+
(AMD Opteron Quad-Core processor “Barcelona”) to overcome
25+
the limitations of conventional performance counter
26+
sampling.
27+
28+
If unsure, say N.
29+
1630
config HAVE_OPROFILE
1731
def_bool n
1832

arch/x86/Kconfig.cpu

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ config M386
3838
- "Crusoe" for the Transmeta Crusoe series.
3939
- "Efficeon" for the Transmeta Efficeon series.
4040
- "Winchip-C6" for original IDT Winchip.
41-
- "Winchip-2" for IDT Winchip 2.
42-
- "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
41+
- "Winchip-2" for IDT Winchips with 3dNow! capabilities.
4342
- "GeodeGX1" for Geode GX1 (Cyrix MediaGX).
4443
- "Geode GX/LX" For AMD Geode GX and LX processors.
4544
- "CyrixIII/VIA C3" for VIA Cyrix III or VIA C3.
@@ -194,19 +193,11 @@ config MWINCHIPC6
194193
treat this chip as a 586TSC with some extended instructions
195194
and alignment requirements.
196195

197-
config MWINCHIP2
198-
bool "Winchip-2"
199-
depends on X86_32
200-
help
201-
Select this for an IDT Winchip-2. Linux and GCC
202-
treat this chip as a 586TSC with some extended instructions
203-
and alignment requirements.
204-
205196
config MWINCHIP3D
206-
bool "Winchip-2A/Winchip-3"
197+
bool "Winchip-2/Winchip-2A/Winchip-3"
207198
depends on X86_32
208199
help
209-
Select this for an IDT Winchip-2A or 3. Linux and GCC
200+
Select this for an IDT Winchip-2, 2A or 3. Linux and GCC
210201
treat this chip as a 586TSC with some extended instructions
211202
and alignment requirements. Also enable out of order memory
212203
stores for this CPU, which can increase performance of some
@@ -318,7 +309,7 @@ config X86_L1_CACHE_SHIFT
318309
int
319310
default "7" if MPENTIUM4 || X86_GENERIC || GENERIC_CPU || MPSC
320311
default "4" if X86_ELAN || M486 || M386 || MGEODEGX1
321-
default "5" if MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
312+
default "5" if MWINCHIP3D || MWINCHIPC6 || MCRUSOE || MEFFICEON || MCYRIXIII || MK6 || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || M586 || MVIAC3_2 || MGEODE_LX
322313
default "6" if MK7 || MK8 || MPENTIUMM || MCORE2 || MVIAC7
323314

324315
config X86_XADD
@@ -360,23 +351,23 @@ config X86_POPAD_OK
360351

361352
config X86_ALIGNMENT_16
362353
def_bool y
363-
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
354+
depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || X86_ELAN || MK6 || M586MMX || M586TSC || M586 || M486 || MVIAC3_2 || MGEODEGX1
364355

365356
config X86_INTEL_USERCOPY
366357
def_bool y
367358
depends on MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M586MMX || X86_GENERIC || MK8 || MK7 || MEFFICEON || MCORE2
368359

369360
config X86_USE_PPRO_CHECKSUM
370361
def_bool y
371-
depends on MWINCHIP3D || MWINCHIP2 || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON || MGEODE_LX || MCORE2
362+
depends on MWINCHIP3D || MWINCHIPC6 || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MK8 || MVIAC3_2 || MEFFICEON || MGEODE_LX || MCORE2
372363

373364
config X86_USE_3DNOW
374365
def_bool y
375366
depends on (MCYRIXIII || MK7 || MGEODE_LX) && !UML
376367

377368
config X86_OOSTORE
378369
def_bool y
379-
depends on (MWINCHIP3D || MWINCHIP2 || MWINCHIPC6) && MTRR
370+
depends on (MWINCHIP3D || MWINCHIPC6) && MTRR
380371

381372
#
382373
# P6_NOPs are a relatively minor optimization that require a family >=
@@ -396,7 +387,7 @@ config X86_P6_NOP
396387

397388
config X86_TSC
398389
def_bool y
399-
depends on ((MWINCHIP3D || MWINCHIP2 || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64
390+
depends on ((MWINCHIP3D || MCRUSOE || MEFFICEON || MCYRIXIII || MK7 || MK6 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || M586MMX || M586TSC || MK8 || MVIAC3_2 || MVIAC7 || MGEODEGX1 || MGEODE_LX || MCORE2) && !X86_NUMAQ) || X86_64
400391

401392
config X86_CMPXCHG64
402393
def_bool y
@@ -406,7 +397,7 @@ config X86_CMPXCHG64
406397
# generates cmov.
407398
config X86_CMOV
408399
def_bool y
409-
depends on (MK7 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || X86_64)
400+
depends on (MK8 || MK7 || MCORE2 || MPENTIUM4 || MPENTIUMM || MPENTIUMIII || MPENTIUMII || M686 || MVIAC3_2 || MVIAC7 || MCRUSOE || MEFFICEON || X86_64)
410401

411402
config X86_MINIMUM_CPU_FAMILY
412403
int
@@ -417,7 +408,7 @@ config X86_MINIMUM_CPU_FAMILY
417408

418409
config X86_DEBUGCTLMSR
419410
def_bool y
420-
depends on !(MK6 || MWINCHIPC6 || MWINCHIP2 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386)
411+
depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386)
421412

422413
menuconfig PROCESSOR_SELECT
423414
bool "Supported processor vendors" if EMBEDDED

arch/x86/Makefile_32.cpu

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon)
2828
cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
2929
cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
3030
cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
31-
cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586)
3231
cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
3332
cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
3433
cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)

arch/x86/configs/i386_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ CONFIG_M686=y
213213
# CONFIG_MCRUSOE is not set
214214
# CONFIG_MEFFICEON is not set
215215
# CONFIG_MWINCHIPC6 is not set
216-
# CONFIG_MWINCHIP2 is not set
217216
# CONFIG_MWINCHIP3D is not set
218217
# CONFIG_MGEODEGX1 is not set
219218
# CONFIG_MGEODE_LX is not set

arch/x86/configs/x86_64_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ CONFIG_X86_PC=y
210210
# CONFIG_MCRUSOE is not set
211211
# CONFIG_MEFFICEON is not set
212212
# CONFIG_MWINCHIPC6 is not set
213-
# CONFIG_MWINCHIP2 is not set
214213
# CONFIG_MWINCHIP3D is not set
215214
# CONFIG_MGEODEGX1 is not set
216215
# CONFIG_MGEODE_LX is not set

arch/x86/ia32/ia32entry.S

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
.endm
4040

4141
/* clobbers %eax */
42-
.macro CLEAR_RREGS
42+
.macro CLEAR_RREGS _r9=rax
4343
xorl %eax,%eax
4444
movq %rax,R11(%rsp)
4545
movq %rax,R10(%rsp)
46-
movq %rax,R9(%rsp)
46+
movq %\_r9,R9(%rsp)
4747
movq %rax,R8(%rsp)
4848
.endm
4949

@@ -52,11 +52,10 @@
5252
* We don't reload %eax because syscall_trace_enter() returned
5353
* the value it wants us to use in the table lookup.
5454
*/
55-
.macro LOAD_ARGS32 offset
56-
movl \offset(%rsp),%r11d
57-
movl \offset+8(%rsp),%r10d
55+
.macro LOAD_ARGS32 offset, _r9=0
56+
.if \_r9
5857
movl \offset+16(%rsp),%r9d
59-
movl \offset+24(%rsp),%r8d
58+
.endif
6059
movl \offset+40(%rsp),%ecx
6160
movl \offset+48(%rsp),%edx
6261
movl \offset+56(%rsp),%esi
@@ -145,7 +144,7 @@ ENTRY(ia32_sysenter_target)
145144
SAVE_ARGS 0,0,1
146145
/* no need to do an access_ok check here because rbp has been
147146
32bit zero extended */
148-
1: movl (%rbp),%r9d
147+
1: movl (%rbp),%ebp
149148
.section __ex_table,"a"
150149
.quad 1b,ia32_badarg
151150
.previous
@@ -157,7 +156,7 @@ ENTRY(ia32_sysenter_target)
157156
cmpl $(IA32_NR_syscalls-1),%eax
158157
ja ia32_badsys
159158
sysenter_do_call:
160-
IA32_ARG_FIXUP 1
159+
IA32_ARG_FIXUP
161160
sysenter_dispatch:
162161
call *ia32_sys_call_table(,%rax,8)
163162
movq %rax,RAX-ARGOFFSET(%rsp)
@@ -234,20 +233,17 @@ sysexit_audit:
234233
#endif
235234

236235
sysenter_tracesys:
237-
xchgl %r9d,%ebp
238236
#ifdef CONFIG_AUDITSYSCALL
239237
testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags(%r10)
240238
jz sysenter_auditsys
241239
#endif
242240
SAVE_REST
243241
CLEAR_RREGS
244-
movq %r9,R9(%rsp)
245242
movq $-ENOSYS,RAX(%rsp)/* ptrace can change this for a bad syscall */
246243
movq %rsp,%rdi /* &pt_regs -> arg1 */
247244
call syscall_trace_enter
248245
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
249246
RESTORE_REST
250-
xchgl %ebp,%r9d
251247
cmpl $(IA32_NR_syscalls-1),%eax
252248
ja int_ret_from_sys_call /* sysenter_tracesys has set RAX(%rsp) */
253249
jmp sysenter_do_call
@@ -314,9 +310,9 @@ ENTRY(ia32_cstar_target)
314310
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags(%r10)
315311
CFI_REMEMBER_STATE
316312
jnz cstar_tracesys
317-
cstar_do_call:
318313
cmpl $IA32_NR_syscalls-1,%eax
319314
ja ia32_badsys
315+
cstar_do_call:
320316
IA32_ARG_FIXUP 1
321317
cstar_dispatch:
322318
call *ia32_sys_call_table(,%rax,8)
@@ -357,15 +353,13 @@ cstar_tracesys:
357353
#endif
358354
xchgl %r9d,%ebp
359355
SAVE_REST
360-
CLEAR_RREGS
361-
movq %r9,R9(%rsp)
356+
CLEAR_RREGS r9
362357
movq $-ENOSYS,RAX(%rsp) /* ptrace can change this for a bad syscall */
363358
movq %rsp,%rdi /* &pt_regs -> arg1 */
364359
call syscall_trace_enter
365-
LOAD_ARGS32 ARGOFFSET /* reload args from stack in case ptrace changed it */
360+
LOAD_ARGS32 ARGOFFSET, 1 /* reload args from stack in case ptrace changed it */
366361
RESTORE_REST
367362
xchgl %ebp,%r9d
368-
movl RSP-ARGOFFSET(%rsp), %r8d
369363
cmpl $(IA32_NR_syscalls-1),%eax
370364
ja int_ret_from_sys_call /* cstar_tracesys has set RAX(%rsp) */
371365
jmp cstar_do_call

arch/x86/kernel/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CFLAGS_hpet.o := $(nostackp)
2323
CFLAGS_tsc.o := $(nostackp)
2424

2525
obj-y := process_$(BITS).o signal_$(BITS).o entry_$(BITS).o
26-
obj-y += traps_$(BITS).o irq_$(BITS).o
26+
obj-y += traps.o irq_$(BITS).o dumpstack_$(BITS).o
2727
obj-y += time_$(BITS).o ioport.o ldt.o
2828
obj-y += setup.o i8259.o irqinit_$(BITS).o setup_percpu.o
2929
obj-$(CONFIG_X86_VISWS) += visws_quirks.o

arch/x86/kernel/alternative.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ void __init alternative_instructions(void)
444444
_text, _etext);
445445

446446
/* Only switch to UP mode if we don't immediately boot others */
447-
if (num_possible_cpus() == 1 || setup_max_cpus <= 1)
447+
if (num_present_cpus() == 1 || setup_max_cpus <= 1)
448448
alternatives_smp_switch(0);
449449
}
450450
#endif

arch/x86/kernel/apic_32.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
295295
*
296296
* Vector mappings are hard coded. On K8 only offset 0 (APIC500) and
297297
* MCE interrupts are supported. Thus MCE offset must be set to 0.
298+
*
299+
* If mask=1, the LVT entry does not generate interrupts while mask=0
300+
* enables the vector. See also the BKDGs.
298301
*/
299302

300303
#define APIC_EILVT_LVTOFF_MCE 0
@@ -319,6 +322,7 @@ u8 setup_APIC_eilvt_ibs(u8 vector, u8 msg_type, u8 mask)
319322
setup_APIC_eilvt(APIC_EILVT_LVTOFF_IBS, vector, msg_type, mask);
320323
return APIC_EILVT_LVTOFF_IBS;
321324
}
325+
EXPORT_SYMBOL_GPL(setup_APIC_eilvt_ibs);
322326

323327
/*
324328
* Program the next event, relative to now

arch/x86/kernel/apic_64.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen)
307307
*
308308
* Vector mappings are hard coded. On K8 only offset 0 (APIC500) and
309309
* MCE interrupts are supported. Thus MCE offset must be set to 0.
310+
*
311+
* If mask=1, the LVT entry does not generate interrupts while mask=0
312+
* enables the vector. See also the BKDGs.
310313
*/
311314

312315
#define APIC_EILVT_LVTOFF_MCE 0
@@ -331,6 +334,7 @@ u8 setup_APIC_eilvt_ibs(u8 vector, u8 msg_type, u8 mask)
331334
setup_APIC_eilvt(APIC_EILVT_LVTOFF_IBS, vector, msg_type, mask);
332335
return APIC_EILVT_LVTOFF_IBS;
333336
}
337+
EXPORT_SYMBOL_GPL(setup_APIC_eilvt_ibs);
334338

335339
/*
336340
* Program the next event, relative to now

0 commit comments

Comments
 (0)