11 Feb, 2009

2 commits

  • Stackprotector builds were failing if CROSS_COMPILER was more than
    a single world (such as when distcc was used) - because the check
    scripts used $1 instead of $*.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: fix x86_32 stack protector

    Brian Gerst found out that %gs was being initialized to stack_canary
    instead of stack_canary - 20, which basically gave the same canary
    value for all threads. Fixing this also exposed the following bugs.

    * cpu_idle() didn't call boot_init_stack_canary()

    * stack canary switching in switch_to() was being done too late making
    the initial run of a new thread use the old stack canary value.

    Fix all of them and while at it update comment in cpu_idle() about
    calling boot_init_stack_canary().

    Reported-by: Brian Gerst
    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

10 Feb, 2009

11 commits

  • Impact: stack protector for x86_32

    Implement stack protector for x86_32. GDT entry 28 is used for it.
    It's set to point to stack_canary-20 and have the length of 24 bytes.
    CONFIG_CC_STACKPROTECTOR turns off CONFIG_X86_32_LAZY_GS and sets %gs
    to the stack canary segment on entry. As %gs is otherwise unused by
    the kernel, the canary can be anywhere. It's defined as a percpu
    variable.

    x86_32 exception handlers take register frame on stack directly as
    struct pt_regs. With -fstack-protector turned on, gcc copies the
    whole structure after the stack canary and (of course) doesn't copy
    back on return thus losing all changed. For now, -fno-stack-protector
    is added to all files which contain those functions. We definitely
    need something better.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: pt_regs changed, lazy gs handling made optional, add slight
    overhead to SAVE_ALL, simplifies error_code path a bit

    On x86_32, %gs hasn't been used by kernel and handled lazily. pt_regs
    doesn't have place for it and gs is saved/loaded only when necessary.
    In preparation for stack protector support, this patch makes lazy %gs
    handling optional by doing the followings.

    * Add CONFIG_X86_32_LAZY_GS and place for gs in pt_regs.

    * Save and restore %gs along with other registers in entry_32.S unless
    LAZY_GS. Note that this unfortunately adds "pushl $0" on SAVE_ALL
    even when LAZY_GS. However, it adds no overhead to common exit path
    and simplifies entry path with error code.

    * Define different user_gs accessors depending on LAZY_GS and add
    lazy_save_gs() and lazy_load_gs() which are noop if !LAZY_GS. The
    lazy_*_gs() ops are used to save, load and clear %gs lazily.

    * Define ELF_CORE_COPY_KERNEL_REGS() which always read %gs directly.

    xen and lguest changes need to be verified.

    Signed-off-by: Tejun Heo
    Cc: Jeremy Fitzhardinge
    Cc: Rusty Russell

    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: cleanup

    On x86_32, %gs is handled lazily. It's not saved and restored on
    kernel entry/exit but only when necessary which usually is during task
    switch but there are few other places. Currently, it's done by
    calling savesegment() and loadsegment() explicitly. Define
    get_user_gs(), set_user_gs() and task_user_gs() and use them instead.

    While at it, clean up register access macros in signal.c.

    This cleans up code a bit and will help future changes.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: cleanup

    Use .macro instead of cpp #define where approriate. This cleans up
    code and will ease future changes.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: avoid crash on vsyscall

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: no default -fno-stack-protector if stackp is enabled, cleanup

    Stackprotector make rules had the following problems.

    * cc support test and warning are scattered across makefile and
    kernel/panic.c.

    * -fno-stack-protector was always added regardless of configuration.

    Update such that cc support test and warning are contained in makefile
    and -fno-stack-protector is added iff stackp is turned off. While at
    it, prepare for 32bit support.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: misc udpate

    * wrap content with CONFIG_CC_STACK_PROTECTOR so that other arch files
    can include it directly

    * add missing includes

    This will help future changes.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • ELF core dump is used for both user land core dump and kernel crash
    dump. Depending on architecture, register might need to be accessed
    differently for userland and kernel. Allow architectures to define
    ELF_CORE_COPY_KERNEL_REGS() and use different operation for kernel
    register dump.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Conflicts:
    arch/x86/kernel/acpi/boot.c

    Ingo Molnar
     
  • Ingo Molnar
     
  • do_device_not_available() is the handler for #NM and it declares that
    it takes a unsigned long and calls math_emu(), which takes a long
    argument and surprisingly expects the stack frame starting at the zero
    argument would match struct math_emu_info, which isn't true regardless
    of configuration in the current code.

    This patch makes do_device_not_available() take struct pt_regs like
    other exception handlers and initialize struct math_emu_info with
    pointer to it and pass pointer to the math_emu_info to math_emulate()
    like normal C functions do. This way, unless gcc makes a copy of
    struct pt_regs in do_device_not_available(), the register frame is
    correctly accessed regardless of kernel configuration or compiler
    used.

    This doesn't fix all math_emu problems but it at least gets it
    somewhat working.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

09 Feb, 2009

19 commits

  • Conflicts:
    arch/x86/mach-voyager/voyager_smp.c
    arch/x86/mm/fault.c

    Ingo Molnar
     
  • Impact: cleanup

    * Come on, struct info? s/struct info/struct math_emu_info/

    * Use struct pt_regs and kernel_vm86_regs instead of defining its own
    register frame structure.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Impact: dump the correct %gs into a.out core dump

    aout_dump_thread() read %gs but didn't include it in core dump. Fix
    it.

    Signed-off-by: Tejun Heo
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Commit 6194ba6ff6ccf8d5c54c857600843c67aa82c407 ("x86: don't special-case
    pmd allocations as much") made changes to the way we handle pmd allocations,
    and while doing that it dropped a call to paravirt_release_pd on the
    pgd page from the pgd_dtor code path.

    As a result of this missing release, the hypervisor is now unaware of the
    pgd page being freed, and as a result it ends up tracking this page as a
    page table page.

    After this the guest may start using the same page for other purposes, and
    depending on what use the page is put to, it may result in various performance
    and/or functional issues ( hangs, reboots).

    Since this release is only required for VMI, I now release the pgd page from
    the (vmi)_pgd_free hook.

    Signed-off-by: Alok N Kataria
    Acked-by: Jeremy Fitzhardinge
    Signed-off-by: Ingo Molnar
    Cc:

    Alok Kataria
     
  • Impact: find right nr_irqs_gsi on some systems.

    One test-system has gap between gsi's:

    [ 0.000000] ACPI: IOAPIC (id[0x04] address[0xfec00000] gsi_base[0])
    [ 0.000000] IOAPIC[0]: apic_id 4, version 0, address 0xfec00000, GSI 0-23
    [ 0.000000] ACPI: IOAPIC (id[0x05] address[0xfeafd000] gsi_base[48])
    [ 0.000000] IOAPIC[1]: apic_id 5, version 0, address 0xfeafd000, GSI 48-54
    [ 0.000000] ACPI: IOAPIC (id[0x06] address[0xfeafc000] gsi_base[56])
    [ 0.000000] IOAPIC[2]: apic_id 6, version 0, address 0xfeafc000, GSI 56-62
    ...
    [ 0.000000] nr_irqs_gsi: 38

    So nr_irqs_gsi is not right. some irq for MSI will overwrite with io_apic.

    need to get that with acpi_probe_gsi when acpi io_apic is used

    Signed-off-by: Yinghai Lu
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     
  • For Intel 7400 series CPUs, the recommendation is to use a clflush on the
    monitored address just before monitor and mwait pair [1].

    This clflush makes sure that there are no false wakeups from mwait when the
    monitored address was recently written to.

    [1] "MONITOR/MWAIT Recommendations for Intel Xeon Processor 7400 series"
    section in specification update document of 7400 series
    http://download.intel.com/design/xeon/specupdt/32033601.pdf

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Ingo Molnar

    Pallipadi, Venkatesh
     
  • Impact: bug fix

    Don't use per_cpu_offset() to determine if it valid to access a
    per-cpu variable for a given cpu number. It is not a valid assumption
    on x86-64 anymore. Use cpu_possible() instead.

    Signed-off-by: Brian Gerst
    Signed-off-by: Ingo Molnar

    Brian Gerst
     
  • Impact: cleanup and bug fix

    Use the linker to create symbols for certain per-cpu variables
    that are offset by __per_cpu_load. This allows the removal of
    the runtime fixup of the GDT pointer, which fixes a bug with
    resume reported by Jiri Slaby.

    Reported-by: Jiri Slaby
    Signed-off-by: Brian Gerst
    Acked-by: Jiri Slaby
    Signed-off-by: Ingo Molnar

    Brian Gerst
     
  • Impact: bug fix

    IA-64 needs to put percpu data in the seperate section even on UP.
    Fixes regression caused by "percpu: refactor percpu.h"

    Signed-off-by: Brian Gerst
    Acked-by: Tony Luck
    Signed-off-by: Ingo Molnar

    Brian Gerst
     
  • Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/arjan/linux-2.6-async-update:
    async: use list_move_tail
    async: Rename _special -> _domain for clarity.
    async: Add some documentation.
    async: Handle kthread_run() return codes.
    async: Fix running list handling.

    Linus Torvalds
     
  • For historical reason, this driver used its own saving/restoring
    of the PCI config space, and used the state of it on resume as
    an indication as to whether it needed to re-POST the chip or not.

    This methods breaks with the later core changes since the core will
    have restored things for us.

    This patch fixes it by removing that custom code, using standard
    core methods to save/restore state, and testing for the need to
    re-POST by comparing the content of a few key PLL registers.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • This fixes aty128fb to properly save the PCI config space -before- it
    potentially switches the PM state of the chip. This avoids a
    warning with the new PM core and is the right thing to do anyway.

    I also replaced the hand-coded switch to D2 with a call to the
    genericc pci_set_power_state() and removed the code that switches it
    back to D0 since the generic code is doing that for us nowadays.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • This fixes atyfb to properly save the PCI config space -before- it
    potentially switches the PM state of the chip. This avoids a
    warning with the new PM core and is the right thing to do anyway.

    I also slightly cleaned up the code that checks whether we are
    running on a PowerMac to do a runtime check instead of a compile
    check only, and replaced a deprecated number with the proper
    symbolic constant.

    Finally, I removed the useless switch to D0 from resume since
    the core does it for us.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     
  • list.h provides a dedicated primitive for
    "list_del followed by list_add_tail"... list_move_tail.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • Rename the async_*_special() functions to async_*_domain(), which
    describes the purpose of these functions much better.
    [Broke up long lines to silence checkpatch]

    Signed-off-by: Cornelia Huck
    Signed-off-by: Arjan van de Ven

    Cornelia Huck
     
  • Add some kerneldoc to the async interface.

    Signed-off-by: Cornelia Huck
    Signed-off-by: Arjan van de Ven

    Cornelia Huck
     
  • If we fail to create the manager thread, fall back to non-fastboot.
    If we fail to create an async thread, try again after waiting for
    a bit.

    Signed-off-by: Cornelia Huck
    Signed-off-by: Arjan van de Ven

    Cornelia Huck
     
  • async_schedule() should pass in async_running as the running
    list, and run_one_entry() should put the entry to be run on
    the provided running list instead of always on the generic one.

    Reported-by: Jonathan Corbet
    Signed-off-by: Cornelia Huck
    Signed-off-by: Arjan van de Ven

    Cornelia Huck
     

08 Feb, 2009

3 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI PM: make the PM core more careful with drivers using the new PM framework
    PCI PM: Read power state from device after trying to change it on resume
    PCI PM: Do not disable and enable bridges during suspend-resume
    PCI: PCIe portdrv: Simplify suspend and resume
    PCI PM: Fix saving of device state in pci_legacy_suspend
    PCI PM: Check if the state has been saved before trying to restore it
    PCI PM: Fix handling of devices without drivers
    PCI: return error on failure to read PCI ROMs
    PCI: properly clean up ASPM link state on device remove

    Linus Torvalds
     
  • Impact: fix spurious BUG_ON() triggered under load

    module_refcount() isn't reliable outside stop_machine(), as demonstrated
    by Karsten Keil , networking can trigger it under load
    (an inc on one cpu and dec on another while module_refcount() is tallying
    can give false results, for example).

    Almost noone should be using __module_get, but that's another issue.

    Cc: Karsten Keil
    Signed-off-by: Rusty Russell
    Signed-off-by: Linus Torvalds

    Rusty Russell
     
  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (30 commits)
    ACPI: Kconfig text - Fix the ACPI_CONTAINER module name according to the real module name.
    eeepc-laptop: fix oops when changing backlight brightness during eeepc-laptop init
    ACPICA: Fix table entry truncation calculation
    ACPI: Enable bit 11 in _PDC to advertise hw coord
    ACPI: struct device - replace bus_id with dev_name(), dev_set_name()
    ACPI: add missing KERN_* constants to printks
    ACPI: dock: Don't eval _STA on every show_docked sysfs read
    ACPI: disable ACPI cleanly when bad RSDP found
    ACPI: delete CPU_IDLE=n code
    ACPI: cpufreq: Remove deprecated /proc/acpi/processor/../performance proc entries
    ACPI: make some IO ports off-limits to AML
    ACPICA: add debug dump of BIOS _OSI strings
    ACPI: proc_dir_entry 'video/VGA' already registered
    ACPI: Skip the first two elements in the _BCL package
    ACPI: remove BM_RLD access from idle entry path
    ACPI: remove locking from PM1x_STS register reads
    eeepc-laptop: use netlink interface
    eeepc-laptop: Implement rfkill hotplugging in eeepc-laptop
    eeepc-laptop: Check return values from rfkill_register
    eeepc-laptop: Add support for extended hotkeys
    ...

    Linus Torvalds
     

07 Feb, 2009

5 commits

  • …isc', 'printk' and 'processor' into release

    Len Brown
     
  • Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown

    Thierry Vignaud
     
  • I got the following oops while changing the backlight brightness during
    startup. When it happens, it prevents use of the hotkeys, Fn-Fx, and the
    lid button.

    It's a clear use-before-init, as I verified by testing with an
    appropriately-placed "else printk".

    BUG: unable to handle kernel NULL pointer dereference at 00000000
    *pde = 00000000
    Oops: 0002 [#1] PREEMPT SMP
    Pid: 160, comm: kacpi_notify Not tainted (2.6.28.1-eee901 #4) 901
    EIP: 0060:[] [] eeepc_hotk_notify+26/da
    EFLAGS: 00010246 CPU: 1
    Using defaults from ksymoops -t elf32-i386 -a i386
    EAX: 00000009 EBX: 00000000 ECX: 00000009 EDX: f70dbf64
    ESI: 00000029 EDI: f7335188 EBP: c02112c9 ESP: f70dbf80
    DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
    f70731e0 f73acd50 c02164ac f7335180 f70aa040 c02112e6 f733518c c012b62f
    f70aa044 f70aa040 c012bdba f70aa04c 00000000 c012be6e 00000000 f70bdf80
    c012e198 f70dbfc4 f70dbfc4 f70aa040 c012bdba 00000000 c012e0c9 c012e091
    Call Trace:
    [] ? acpi_ev_notify_dispatch+4c/55
    [] ? acpi_os_execute_deferred+1d/25
    [] ? run_workqueue+71/f1
    [] ? worker_thread+0/bf
    [] ? worker_thread+b4/bf
    [] ? autoremove_wake_function+0/2b
    [] ? worker_thread+0/bf
    [] ? kthread+38/5f
    [] ? kthread+0/5f
    [] ? kernel_thread_helper+7/10
    Code: 00 00 00 00 c3 83 3d 60 5c 50 c0 00 56 89 d6 53 0f 84 c4 00 00 00 8d 42
    e0 83 f8 0f 77 0f 8b 1d 68 5c 50 c0 89 d8 e8 a9 fa ff ff 03 8b 1d 60 5c
    50 c0 89 f2 83 e2 7f 0f b7 4c 53 10 8d 41 01

    Signed-off-by: Darren Salt
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown

    Darren Salt
     
  • During early boot, ACPI RSDT/XSDT table entries are gathered into the
    'initial_tables[]' array. This array is currently statically defined (see
    ./drivers/acpi/tables.c). When there are more table entries than can be
    held in the 'initial_tables[]' array, the message "Truncating N table
    entries!" is output. As currently implemented, this message will always
    erroneously calculate N as 0.

    This patch fixes the calculation that determines how many table entries
    will be missing (truncated).

    This modification may be used under either the GPL or the BSD-style
    license used for Intel ACPI CA code.

    Signed-off-by: Myron Stowe
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown

    Myron Stowe
     
  • Bit 11 in intel PDC definitions is meant for OS capability to handle
    hardware coordination of P-states. In Linux we have always supported
    hwardware coordination of P-states. Just let the BIOSes know that we
    support it, by setting this bit.

    Some BIOSes use this bit to choose between hardware or software coordination
    and without this change below, BIOSes switch to software coordination, which
    is not very optimal in terms of power consumption and extra wakeups from idle.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Pallipadi, Venkatesh