07 Jan, 2006

40 commits

  • Make the suspend image size limit tunable via /sys/power/image_size.

    It is necessary for systems on which there is a limited amount of swap
    available for suspend. It can also be useful for optimizing performance of
    swsusp on systems with 1 GB of RAM or more.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Limit the size of the suspend image to approx. 500 MB, which should
    improve the overall performance of swsusp on systems with more than 1 GB of
    RAM.

    It introduces the constant IMAGE_SIZE that can be set to the preferred size
    of the image (in MB) and modifies the memory-shrinking part of swsusp to
    take this constant into account (500 is the default value of IMAGE_SIZE).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • These two prototypes are already present in sched.h, remove duplicate
    version.

    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     
  • This change removes the old, deprecated interface from the opl3sa2 driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This change removes the old, deprecated interface from the nm256 driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    Note that this driver has been obsoleted by an ALSA equivalent.

    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This change removes the old, deprecated interface from the maestro driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    The check_suspend() function and associated logic was not removed, even though
    it is now unnecessary.

    Note that this driver has been obsoleted by an ALSA equivalent.

    Acked-by: Zach Brown
    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This change removes the old, deprecated interface from the cs46xx driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    Note this driver has PCI PM hooks which are set properly. It also has the
    ability to trigger suspend/resume from an ioctl. This functionality was not
    touched, though it could use a serious review if this driver continues to
    persist in the mainline tree..

    Note that this driver has been obsoleted by an ALSA equivalent.

    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This change removes the old, deprecated interface from the cs4281 driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    Note that this driver has been obsoleted by an ALSA equivalent.

    Note that this driver has hooks for PCI power management, but does not
    implement the ->suspend()/->resume() methods.

    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This change removes the old, deprecated interface from the ad1848 driver,
    including the pm_{,un}register() calls, the local storage of the pmdev object
    and the reference to the old header files. This change is done to assist in
    eradicating the users of the legacy interface so as to help facilitate the
    removal of the interface itself.

    Signed-off-by: Patrick Mochel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Patrick Mochel
     
  • This patch fixes a problem with the function enough_free_mem() used by
    swsusp to verify if there is a sufficient number of memory pages available
    to it to create and save the suspend image.

    Namely, enough_free_mem() uses nr_free_pages() to obtain the number of free
    memory pages, which is incorrect, because this function returns the total
    number of free pages, including free highmem pages, and the highmem pages
    cannot be used by swsusp for storing the image data.

    The patch makes enough_free_mem() avoid counting the free highmem
    pages as available to swsusp.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • This patch makes swsusp free only as much memory as needed to complete the
    suspend and not as much as possible.  In the most of cases this should speed
    up the suspend and make the system much more responsive after resume,
    especially if a GUI (eg. X Windows) is used.

    If needed, the old behavior (ie to free as much memory as possible during
    suspend) can be restored by unsetting FAST_FREE in power.h

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • This patch introduces the swap map structure that can be used by swsusp for
    keeping tracks of data pages written to the swap.  The structure itself is
    described in a comment within the patch.

    The overall idea is to reduce the amount of metadata written to the swap and
    to write and read the image pages sequentially, in a file-alike way. This
    makes the swap-handling part of swsusp fairly independent of its
    snapshot-handling part and will hopefully allow us to completely separate
    these two parts in the future.

    This patch is needed to remove the suspend image size limit imposed by the
    limited size of the swsusp_info structure, which is essential for x86-64
    systems with more than 512 MB of RAM.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • This patch removes the image encryption that is only used by swsusp instead of
    zeroing the image after resume in order to prevent someone from reading some
    confidential data from it in the future and it does not protect the image from
    being read by an unauthorized person before resume. The functionality it
    provides should really belong to the user space and will possibly be
    reimplemented after the swap-handling functionality of swsusp is moved to the
    user space.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     
  • Kconfig tweaks and tons of deletions.

    Signed-off-by: Ivan Kokshaysky
    Cc: Christoph Hellwig
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ivan Kokshaysky
     
  • Thanks to Christoph for doing most of the work.

    This allows automatic SMP IRQ affinity assignment other than default "all
    interrupts on all CPUs" which is rather expensive. This might be useful if
    the hardware can be programmed to distribute interrupts among different
    CPUs, like Alpha does.

    Signed-off-by: Ivan Kokshaysky
    Cc: Christoph Hellwig
    Cc: Richard Henderson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ivan Kokshaysky
     
  • With physical CPU hotplug, the CPU is hot removed and it should not receive
    any interrupts. Disabling interrupt is much safer. This basically is what we
    do in ia64 & x86.

    Signed-off-by: Shaohua Li
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Shaohua Li
     
  • Signed-off-by: Ben Collins
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Collins
     
  • o Currently, during kexec reboot, IOAPIC is re-programmed back to virtual
    wire mode if there was an i8259 connected to it. This enables getting
    timer interrupts in second kernel in legacy mode.

    o After putting into virtual wire mode, IOAPIC delivers the i8259 interrupts
    to CPU0. This works well for kexec but not for kdump as we might crash
    on a different CPU and second kernel will not see timer interrupts.

    o This patch modifies the redirection table entry to deliver the timer
    interrupts to the cpu we are rebooting (instead of hardcoding to zero).
    This ensures that second kernel receives timer interrupts even on a
    non-boot cpu.

    Signed-off-by: Vivek Goyal
    Cc: Andi Kleen
    Cc: "Seth, Rohit"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vivek Goyal
     
  • GCC 4.1 gives the following warning: include/asm/mpspec.h:79: warning:
    `packed' attribute ignored for field of type `unsigned char'

    The packed attribute isn't really necessary anyways so just remove it.

    Signed-off-by: Brian Gerst
    Acked-by: Dave Jones
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Brian Gerst
     
  • When we re-calibrate the frequency, it is likely that an interrupt (as for
    example the main system clock) will be triggered by the system. Therefore
    the calibration may not be accurate. This will also provide a fix to bug
    #5266.

    Many thanks to Larry Finger for helping resolving this issue.

    Signed-off-by: Bruno Ducrot
    Cc: john stultz
    Cc: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Larry Finger
     
  • - Fix screen blanking on BIOSes that return APM_NOT_ENGAGED when APM enabled
    screen blanking is not turned on.

    The original code only tried to set the state on device 0x100, and then
    0x1FF, and I added 0x101 to the mix too.

    - Clean up logic in apm_console_blank().

    - Prevent the error message from printing out twice.

    Cc: Jordan Crouse
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jordan Crouse
     
  • Add support to hw_random for the Geode LX HRNG device.

    Signed-off-by: Jordan Crouse
    Cc: Alan Cox
    Cc: Jeff Garzik
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jordan Crouse
     
  • Provide basic support for the AMD Geode GX and LX processors.

    Signed-off-by: Jordan Crouse
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jordan Crouse
     
  • Removed the unused variable "rv".

    Signed-off-by: Daniel Marjamaki
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Marjamaki
     
  • Removed the unused variable "rv".

    Signed-off-by: Daniel Marjamaki
    Signed-off-by: H. Peter Anvin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Daniel Marjamaki
     
  • There is a single instruction on i386 to find largest set bit; so it makes
    sense to use it (like we use bfs for ffs()).

    Signed-off-by: Stephen Hemminger
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Stephen Hemminger
     
  • Missing newline in printk.

    Signed-off-by: Dave Jones
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • The 'make rodata read-only' patch in -mm exposes a latent bug in the 32-bit
    change_page_attr() function, which causes certain CPUs (Those with NX
    basically) to reboot instantly after pages are marked read-only.

    The same bug got fixed a while back on x86-64, but never got propagated to
    i386.

    Stuart Hayes from Dell also picked up on this last June, but it never got
    fixed, as the only thing affected by it aparently was the nvidia driver.

    Blatantly stealing description from his post..

    "It doesn't appear to be fixed (in the i386 arch). The
    change_page_attr()/split_large_page() code will still still set all the
    4K PTEs to PAGE_KERNEL (setting the _PAGE_NX bit) when a large page
    needs to be split.

    This wouldn't be a problem for the bulk of the kernel memory, but there
    are pages in the lower 4MB of memory that's free, and are part of large
    executable pages that also contain kernel code. If change_page_attr()
    is called on these, it will set the _PAGE_NX bit on the whole 2MB region
    that was covered by the large page, causing a large chunk of kernel code
    to be non-executable."

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Dave Jones
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dave Jones
     
  • If we are using hotplug enabled kernel, then make bigsmp the default mode.

    Signed-off-by: Ashok Raj
    Signed-off-by: Venkatesh Pallipadi
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     
  • When we bring up a new CPU via INIT/startup IPI messages, the CPU that's
    coming up sends a xTPR message to the chipset. Intel chipsets (at least)
    don't provide any architectural guarantee on what the chipset will do with
    this message. For example, the E850x chipsets uses this xTPR message to
    interpret the interrupt operating mode of the platform. When the CPU
    coming online sends this message, it always indicates that it is in logical
    flat mode. For the CPU hotplug case, the platform may already be
    functioning in cluster APIC mode at this time, the chipset can get confused
    and mishandle I/O device and IPI interrupt routing.

    The situation eventually gets corrected when the new CPU sends another xTPR
    update when we switch it to cluster mode, but there's a window during which
    the chipset may be in an inconsistent state. This patch avoids this
    problem by using the flat physical interrupt delivery mode instead of
    cluster mode for bigsmp (>8 cpu) support.

    Signed-off-by: Ashok Raj
    Signed-off-by: Venkatesh Pallipadi
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ashok Raj
     
  • On architectures that implement sparsemem but not discontigmem we want to
    be able to hide the flatmem option in some cases. On ppc64 for example,
    when we select NUMA we must not select flatmem.

    Signed-off-by: Anton Blanchard
    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Anton Blanchard
     
  • Allow SPARSEMEM to be enabled on non-numa x86 systems. This is made
    dependant on EXPERIMENTAL also being set. When an in-tree user (such as
    simulated numa) exists it should be made dependant on that.

    The plan is to have no options and no selector as normal when
    !EXPERIMENTAL. When EXPERIMENTAL we enable the FLATMEM and SPARSEMEM
    options for X86_PC whilst maintaining DISCONTIGMEM and SPARSEMEM for NUMA.

    Signed-off-by: Andy Whitcroft
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Whitcroft
     
  • Mark some key kernel datastructures readonly. This patch was previously
    posted on Jun 28th but was back then not merged because nothing was enforcing
    rodata anyway.. well that changed now :)

    Patch by Christoph Lameter and Dave Jones

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • x86-64 specific parts to make the .rodata section read only

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Bug fix required for the .rodata work on x86-64:

    when change_page_attr() and friends need to break up a 2Mb page into 4Kb
    pages, it always set the NX bit on the PMD, which causes the cpu to consider
    the entire 2Mb region to be NX regardless of the actual PTE perms. This is
    fine in general, with one big exception: the 2Mb page that covers the last
    part of the kernel .text! The fix is to not invent a new permission for the
    new PMD entry, but to just inherit the existing one minus the PSE bit.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • x86 specific parts to make the .rodata section read only

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Adrian Bunk
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Generic prep-work for marking the .rodata section readonly:
    * Align the rodata section at 4Kb boundary
    * call the mark_rodata_ro() function when available

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Ingo Molnar
    Signed-off-by: Adrian Bunk
    Cc: Andi Kleen
    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Make i386's find_first_bit() use an unsigned integer as a counter to avoid
    getting warnings when -Wsign-compare is given.

    Signed-Off-By: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     
  • Remove the "temporary debugging check" which has managed to live for quite
    some time, and is clearly unneeded. The mm can never be live at this point,
    so clearly checking the LDT in the mm->context is redundant as well.

    Signed-off-by: Zachary Amsden
    Cc: "Seth, Rohit"
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zachary Amsden
     
  • APM BIOS code has a protective wrapper that runs it only on CPU zero. Thus,
    no need to set APM BIOS segments in the GDT for other CPUs.

    Signed-off-by: Zachary Amsden
    Acked-by: "Seth, Rohit"
    Cc: Stephen Rothwell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Zachary Amsden