Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 019abbc8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'x86-stage-3-for-linus' of...

Merge branch 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-stage-3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (190 commits)
  Revert "cpuacct: reduce one NULL check in fast-path"
  Revert "x86: don't compile vsmp_64 for 32bit"
  x86: Correct behaviour of irq affinity
  x86: early_ioremap_init(), use __fix_to_virt(), because we are sure it's safe
  x86: use default_cpu_mask_to_apicid for 64bit
  x86: fix set_extra_move_desc calling
  x86, PAT, PCI: Change vma prot in pci_mmap to reflect inherited prot
  x86/dmi: fix dmi_alloc() section mismatches
  x86: e820 fix various signedness issues in setup.c and e820.c
  x86: apic/io_apic.c define msi_ir_chip and ir_ioapic_chip all the time
  x86: irq.c keep CONFIG_X86_LOCAL_APIC interrupts together
  x86: irq.c use same path for show_interrupts
  x86: cpu/cpu.h cleanup
  x86: Fix a couple of sparse warnings in arch/x86/kernel/apic/io_apic.c
  Revert "x86: create a non-zero sized bm_pte only when needed"
  x86: pci-nommu.c cleanup
  x86: io_delay.c cleanup
  x86: rtc.c cleanup
  x86: i8253 cleanup
  x86: kdebugfs.c cleanup
  ...
parents 2d25ee36 5a3c8fe7
Loading
Loading
Loading
Loading
+101 −0
Original line number Diff line number Diff line

Mini-HOWTO for using the earlyprintk=dbgp boot option with a
USB2 Debug port key and a debug cable, on x86 systems.

You need two computers, the 'USB debug key' special gadget and
and two USB cables, connected like this:

  [host/target] <-------> [USB debug key] <-------> [client/console]

1. There are three specific hardware requirements:

 a.) Host/target system needs to have USB debug port capability.

 You can check this capability by looking at a 'Debug port' bit in
 the lspci -vvv output:

 # lspci -vvv
 ...
 00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) (prog-if 20 [EHCI])
         Subsystem: Lenovo ThinkPad T61
         Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
         Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
         Latency: 0
         Interrupt: pin D routed to IRQ 19
         Region 0: Memory at fe227000 (32-bit, non-prefetchable) [size=1K]
         Capabilities: [50] Power Management version 2
                 Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                 Status: D0 PME-Enable- DSel=0 DScale=0 PME+
         Capabilities: [58] Debug port: BAR=1 offset=00a0
                            ^^^^^^^^^^^ <==================== [ HERE ]
	 Kernel driver in use: ehci_hcd
         Kernel modules: ehci-hcd
 ...

( If your system does not list a debug port capability then you probably
  wont be able to use the USB debug key. )

 b.) You also need a Netchip USB debug cable/key:

        http://www.plxtech.com/products/NET2000/NET20DC/default.asp

     This is a small blue plastic connector with two USB connections,
     it draws power from its USB connections.

 c.) Thirdly, you need a second client/console system with a regular USB port.

2. Software requirements:

 a.) On the host/target system:

    You need to enable the following kernel config option:

      CONFIG_EARLY_PRINTK_DBGP=y

    And you need to add the boot command line: "earlyprintk=dbgp".
    (If you are using Grub, append it to the 'kernel' line in
     /etc/grub.conf)

    NOTE: normally earlyprintk console gets turned off once the
    regular console is alive - use "earlyprintk=dbgp,keep" to keep
    this channel open beyond early bootup. This can be useful for
    debugging crashes under Xorg, etc.

 b.) On the client/console system:

    You should enable the following kernel config option:

      CONFIG_USB_SERIAL_DEBUG=y

    On the next bootup with the modified kernel you should
    get a /dev/ttyUSBx device(s).

    Now this channel of kernel messages is ready to be used: start
    your favorite terminal emulator (minicom, etc.) and set
    it up to use /dev/ttyUSB0 - or use a raw 'cat /dev/ttyUSBx' to
    see the raw output.

 c.) On Nvidia Southbridge based systems: the kernel will try to probe
     and find out which port has debug device connected.

3. Testing that it works fine:

   You can test the output by using earlyprintk=dbgp,keep and provoking
   kernel messages on the host/target system. You can provoke a harmless
   kernel message by for example doing:

     echo h > /proc/sysrq-trigger

   On the host/target system you should see this help line in "dmesg" output:

     SysRq : HELP : loglevel(0-9) reBoot Crashdump terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) saK show-backtrace-all-active-cpus(L) show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T) Unmount show-blocked-tasks(W) dump-ftrace-buffer(Z)

   On the client/console system do:

       cat /dev/ttyUSB0

   And you should see the help line above displayed shortly after you've
   provoked it on the host system.

If it does not work then please ask about it on the linux-kernel@vger.kernel.org
mailing list or contact the x86 maintainers.
+13 −2
Original line number Diff line number Diff line
@@ -786,6 +786,11 @@ config X86_MCE_AMD
	   Additional support for AMD specific MCE features such as
	   the DRAM Error Threshold.

config X86_MCE_THRESHOLD
	depends on X86_MCE_AMD || X86_MCE_INTEL
	bool
	default y

config X86_MCE_NONFATAL
	tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
	depends on X86_32 && X86_MCE
@@ -929,6 +934,12 @@ config X86_CPUID
	  with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to
	  /dev/cpu/31/cpuid.

config X86_CPU_DEBUG
	tristate "/sys/kernel/debug/x86/cpu/* - CPU Debug support"
	---help---
	  If you select this option, this will provide various x86 CPUs
	  information through debugfs.

choice
	prompt "High Memory Support"
	default HIGHMEM4G if !X86_NUMAQ
@@ -1121,7 +1132,7 @@ config NUMA_EMU

config NODES_SHIFT
	int "Maximum NUMA Nodes (as a power of 2)" if !MAXSMP
	range 1 9   if X86_64
	range 1 9
	default "9" if MAXSMP
	default "6" if X86_64
	default "4" if X86_NUMAQ
@@ -1429,7 +1440,7 @@ config CRASH_DUMP
config KEXEC_JUMP
	bool "kexec jump (EXPERIMENTAL)"
	depends on EXPERIMENTAL
	depends on KEXEC && HIBERNATION && X86_32
	depends on KEXEC && HIBERNATION
	---help---
	  Jump between original kernel and kexeced kernel and invoke
	  code in physical address mode via KEXEC
+1 −16
Original line number Diff line number Diff line
@@ -456,24 +456,9 @@ config CPU_SUP_AMD

	  If unsure, say N.

config CPU_SUP_CENTAUR_32
config CPU_SUP_CENTAUR
	default y
	bool "Support Centaur processors" if PROCESSOR_SELECT
	depends on !64BIT
	---help---
	  This enables detection, tunings and quirks for Centaur processors

	  You need this enabled if you want your kernel to run on a
	  Centaur CPU. Disabling this option on other types of CPUs
	  makes the kernel a tiny bit smaller. Disabling it on a Centaur
	  CPU might render the kernel unbootable.

	  If unsure, say N.

config CPU_SUP_CENTAUR_64
	default y
	bool "Support Centaur processors" if PROCESSOR_SELECT
	depends on 64BIT
	---help---
	  This enables detection, tunings and quirks for Centaur processors

+7 −22
Original line number Diff line number Diff line
@@ -153,34 +153,23 @@ endif

boot := arch/x86/boot

PHONY += zImage bzImage compressed zlilo bzlilo \
         zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
BOOT_TARGETS = bzlilo bzdisk fdimage fdimage144 fdimage288 isoimage install

PHONY += bzImage $(BOOT_TARGETS)

# Default kernel to build
all: bzImage

# KBUILD_IMAGE specify target image being built
KBUILD_IMAGE := $(boot)/bzImage
zImage zlilo zdisk: KBUILD_IMAGE := $(boot)/zImage

zImage bzImage: vmlinux
bzImage: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
	$(Q)mkdir -p $(objtree)/arch/$(UTS_MACHINE)/boot
	$(Q)ln -fsn ../../x86/boot/bzImage $(objtree)/arch/$(UTS_MACHINE)/boot/$@

compressed: zImage

zlilo bzlilo: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo

zdisk bzdisk: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk

fdimage fdimage144 fdimage288 isoimage: vmlinux
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@

install:
	$(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
$(BOOT_TARGETS): vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $@

PHONY += vdso_install
vdso_install:
@@ -205,7 +194,3 @@ define archhelp
  echo  '                  FDARGS="..."  arguments for the booted kernel'
  echo  '                  FDINITRD=file initrd for the booted kernel'
endef

CLEAN_FILES += arch/x86/boot/fdimage \
	       arch/x86/boot/image.iso \
	       arch/x86/boot/mtools.conf
+25 −28
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
# Changed by many, many contributors over the years.
#

# ROOT_DEV specifies the default root-device when making the image.
@@ -21,11 +22,8 @@ ROOT_DEV := CURRENT

SVGA_MODE	:= -DSVGA_MODE=NORMAL_VGA

# If you want the RAM disk device, define this to be the size in blocks.

#RAMDISK := -DRAMDISK=512

targets		:= vmlinux.bin setup.bin setup.elf zImage bzImage
targets		:= vmlinux.bin setup.bin setup.elf bzImage
targets		+= fdimage fdimage144 fdimage288 image.iso mtools.conf
subdir-		:= compressed

setup-y		+= a20.o cmdline.o copy.o cpu.o cpucheck.o edd.o
@@ -71,17 +69,13 @@ KBUILD_CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \
KBUILD_CFLAGS +=   $(call cc-option,-m32)
KBUILD_AFLAGS	:= $(KBUILD_CFLAGS) -D__ASSEMBLY__

$(obj)/zImage:  asflags-y := $(SVGA_MODE) $(RAMDISK)
$(obj)/bzImage: ccflags-y := -D__BIG_KERNEL__
$(obj)/bzImage: asflags-y := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__
$(obj)/bzImage: BUILDFLAGS   := -b
$(obj)/bzImage: asflags-y  := $(SVGA_MODE)

quiet_cmd_image = BUILD   $@
cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \
	    $(obj)/vmlinux.bin $(ROOT_DEV) > $@
cmd_image = $(obj)/tools/build $(obj)/setup.bin $(obj)/vmlinux.bin \
	$(ROOT_DEV) > $@

$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \
			      $(obj)/vmlinux.bin $(obj)/tools/build FORCE
$(obj)/bzImage: $(obj)/setup.bin $(obj)/vmlinux.bin $(obj)/tools/build FORCE
	$(call if_changed,image)
	@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'

@@ -116,9 +110,11 @@ $(obj)/setup.bin: $(obj)/setup.elf FORCE
$(obj)/compressed/vmlinux: FORCE
	$(Q)$(MAKE) $(build)=$(obj)/compressed $@

# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel
# Set this if you want to pass append arguments to the
# bzdisk/fdimage/isoimage kernel
FDARGS =
# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel
# Set this if you want an initrd included with the
# bzdisk/fdimage/isoimage kernel
FDINITRD =

image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,)
@@ -127,7 +123,7 @@ $(obj)/mtools.conf: $(src)/mtools.conf.in
	sed -e 's|@OBJ@|$(obj)|g' < $< > $@

# This requires write access to /dev/fd0
zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
bzdisk: $(obj)/bzImage $(obj)/mtools.conf
	MTOOLSRC=$(obj)/mtools.conf mformat a:			; sync
	syslinux /dev/fd0					; sync
	echo '$(image_cmdline)' | \
@@ -135,10 +131,10 @@ zdisk: $(BOOTIMAGE) $(obj)/mtools.conf
	if [ -f '$(FDINITRD)' ] ; then \
		MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \
	fi
	MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux	; sync
	MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage a:linux	; sync

# These require being root or having syslinux 2.02 or higher installed
fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
fdimage fdimage144: $(obj)/bzImage $(obj)/mtools.conf
	dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440
	MTOOLSRC=$(obj)/mtools.conf mformat v:			; sync
	syslinux $(obj)/fdimage					; sync
@@ -147,9 +143,9 @@ fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf
	if [ -f '$(FDINITRD)' ] ; then \
		MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \
	fi
	MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux	; sync
	MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage v:linux	; sync

fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
fdimage288: $(obj)/bzImage $(obj)/mtools.conf
	dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880
	MTOOLSRC=$(obj)/mtools.conf mformat w:			; sync
	syslinux $(obj)/fdimage					; sync
@@ -158,9 +154,9 @@ fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf
	if [ -f '$(FDINITRD)' ] ; then \
		MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \
	fi
	MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux	; sync
	MTOOLSRC=$(obj)/mtools.conf mcopy $(obj)/bzImage w:linux	; sync

isoimage: $(BOOTIMAGE)
isoimage: $(obj)/bzImage
	-rm -rf $(obj)/isoimage
	mkdir $(obj)/isoimage
	for i in lib lib64 share end ; do \
@@ -170,7 +166,7 @@ isoimage: $(BOOTIMAGE)
		fi ; \
		if [ $$i = end ] ; then exit 1 ; fi ; \
	done
	cp $(BOOTIMAGE) $(obj)/isoimage/linux
	cp $(obj)/bzImage $(obj)/isoimage/linux
	echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg
	if [ -f '$(FDINITRD)' ] ; then \
		cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \
@@ -181,12 +177,13 @@ isoimage: $(BOOTIMAGE)
	isohybrid $(obj)/image.iso 2>/dev/null || true
	rm -rf $(obj)/isoimage

zlilo: $(BOOTIMAGE)
bzlilo: $(obj)/bzImage
	if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
	if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
	cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz
	cat $(obj)/bzImage > $(INSTALL_PATH)/vmlinuz
	cp System.map $(INSTALL_PATH)/
	if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi

install:
	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
	sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
		System.map "$(INSTALL_PATH)"
Loading