1. 06 1月, 2011 6 次提交
  2. 29 12月, 2010 1 次提交
  3. 27 12月, 2010 1 次提交
    • J
      x86/microcode: Fix double vfree() and remove redundant pointer checks before vfree() · 5cdd2de0
      Jesper Juhl 提交于
      In arch/x86/kernel/microcode_intel.c::generic_load_microcode()
      we have  this:
      
      	while (leftover) {
      		...
      		if (get_ucode_data(mc, ucode_ptr, mc_size) ||
      		    microcode_sanity_check(mc) < 0) {
      			vfree(mc);
      			break;
      		}
      		...
      	}
      
      	if (mc)
      		vfree(mc);
      
      This will cause a double free of 'mc'. This patch fixes that by
      just  removing the vfree() call in the loop since 'mc' will be
      freed nicely just  after we break out of the loop.
      
      There's also a second change in the patch. I noticed a lot of
      checks for  pointers being NULL before passing them to vfree().
      That's completely  redundant since vfree() deals gracefully with
      being passed a NULL pointer.  Removing the redundant checks
      yields a nice size decrease for the object  file.
      
      Size before the patch:
         text    data     bss     dec     hex filename
         4578     240    1032    5850    16da arch/x86/kernel/microcode_intel.o
      Size after the patch:
         text    data     bss     dec     hex filename
         4489     240     984    5713    1651 arch/x86/kernel/microcode_intel.o
      Signed-off-by: NJesper Juhl <jj@chaosbits.net>
      Acked-by: NTigran Aivazian <tigran@aivazian.fsnet.co.uk>
      Cc: Shaohua Li <shaohua.li@intel.com>
      LKML-Reference: <alpine.LNX.2.00.1012251946100.10759@swampdragon.chaosbits.net>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5cdd2de0
  4. 24 12月, 2010 4 次提交
    • P
      sh: Fix up SH7201 clkfwk build. · 27f1accc
      Paul Mundt 提交于
      The master clock initialization for SH7201 was wholly bogus. Users of the
      legacy API must initialize the clock rate through the struct clk itself
      rather than returning the clock frequency. Given that the init function
      itself is void, returning the frequency isn't terribly effective.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      27f1accc
    • P
      sh: mach-se: Fix up SE7206 build. · 27434f0a
      Paul Mundt 提交于
      With some recent tidying of duplicate register definitions the se7206 IRQ
      code broke:
      
      arch/sh/boards/mach-se/7206/irq.c: error: 'INTC_ICR' undeclared (first use in this function)
      arch/sh/boards/mach-se/7206/irq.c: error: (Each undeclared identifier is reported only once
      arch/sh/boards/mach-se/7206/irq.c: error: for each function it appears in.)
      
      Fix it up.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      27434f0a
    • P
      sh: Fix up SH4-202 clkfwk build. · 638fa4aa
      Paul Mundt 提交于
      Some of the SH4-202 code was overlooked in the set_rate() API conversion,
      resulting in:
      
      arch/sh/kernel/cpu/sh4/clock-sh4-202.c: error: too many arguments to function 'clk->ops->set_rate'
      
      Fix it up.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      638fa4aa
    • W
      powerpc/mpc5200: include fs.h in mpc52xx_gpt.c · 5e2f55c6
      Wolfram Sang 提交于
      Fix build errors like these (from a randconfig and my defconfig for a custom board):
      
      src/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:549: error: dereferencing pointer to incomplete type: 1 errors in 1 logs
      src/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:636: error: implicit declaration of function 'nonseekable_open': 1 errors in 1 logs
      src/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:657: error: variable 'mpc52xx_wdt_fops' has initializer but incomplete type: 1 errors in 1 logs
      src/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:658: error: excess elements in struct initializer: 1 errors in 1 logs
      src/arch/powerpc/platforms/52xx/mpc52xx_gpt.c:658: error: unknown field 'owner' specified in initializer: 1 errors in 1 logs
      ...
      Reported-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NWolfram Sang <w.sang@pengutronix.de>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      5e2f55c6
  5. 22 12月, 2010 1 次提交
  6. 21 12月, 2010 1 次提交
  7. 18 12月, 2010 9 次提交
    • H
      x86, kexec: Limit the crashkernel address appropriately · 7f8595bf
      H. Peter Anvin 提交于
      Keep the crash kernel address below 512 MiB for 32 bits and 896 MiB
      for 64 bits.  For 32 bits, this retains compatibility with earlier
      kernel releases, and makes it work even if the vmalloc= setting is
      adjusted.
      
      For 64 bits, we should be able to increase this substantially once a
      hard-coded limit in kexec-tools is fixed.
      Signed-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      Cc: Vivek Goyal <vgoyal@redhat.com>
      Cc: Stanislaw Gruszka <sgruszka@redhat.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      LKML-Reference: <20101217195035.GE14502@redhat.com>
      7f8595bf
    • C
      arch/tile: handle rt_sigreturn() more cleanly · 81711cee
      Chris Metcalf 提交于
      The current tile rt_sigreturn() syscall pattern uses the common idiom
      of loading up pt_regs with all the saved registers from the time of
      the signal, then anticipating the fact that we will clobber the ABI
      "return value" register (r0) as we return from the syscall by setting
      the rt_sigreturn return value to whatever random value was in the pt_regs
      for r0.
      
      However, this breaks in our 64-bit kernel when running "compat" tasks,
      since we always sign-extend the "return value" register to properly
      handle returned pointers that are in the upper 2GB of the 32-bit compat
      address space.  Doing this to the sigreturn path then causes occasional
      random corruption of the 64-bit r0 register.
      
      Instead, we stop doing the crazy "load the return-value register"
      hack in sigreturn.  We already have some sigreturn-specific assembly
      code that we use to pass the pt_regs pointer to C code.  We extend that
      code to also set the link register to point to a spot a few instructions
      after the usual syscall return address so we don't clobber the saved r0.
      Now it no longer matters what the rt_sigreturn syscall returns, and the
      pt_regs structure can be cleanly and completely reloaded.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      81711cee
    • C
      arch/tile: handle CLONE_SETTLS in copy_thread(), not user space · bc4cf2bb
      Chris Metcalf 提交于
      Previously we were just setting up the "tp" register in the
      new task as started by clone() in libc.  However, this is not
      quite right, since in principle a signal might be delivered to
      the new task before it had its TLS set up.  (Of course, this race
      window still exists for resetting the libc getpid() cached value
      in the new task, in principle.  But in any case, we are now doing
      this exactly the way all other architectures do it.)
      
      This change is important for 2.6.37 since the tile glibc we will
      be submitting upstream will not set TLS in user space any more,
      so it will only work on a kernel that has this fix.  It should
      also be taken for 2.6.36.x in the stable tree if possible.
      Signed-off-by: NChris Metcalf <cmetcalf@tilera.com>
      Cc: stable <stable@kernel.org>
      bc4cf2bb
    • K
      MIPS: Fix build errors in sc-mips.c · 081d835f
      Kevin Cernekee 提交于
      Seen with malta_defconfig on Linus' tree:
      
        CC      arch/mips/mm/sc-mips.o
      arch/mips/mm/sc-mips.c: In function 'mips_sc_is_activated':
      arch/mips/mm/sc-mips.c:77: error: 'config2' undeclared (first use in this function)
      arch/mips/mm/sc-mips.c:77: error: (Each undeclared identifier is reported only once
      arch/mips/mm/sc-mips.c:77: error: for each function it appears in.)
      arch/mips/mm/sc-mips.c:81: error: 'tmp' undeclared (first use in this function)
      make[2]: *** [arch/mips/mm/sc-mips.o] Error 1
      make[1]: *** [arch/mips/mm] Error 2
      make: *** [arch/mips] Error 2
      
      [Ralf: Cosmetic changes to minimize the number of arguments passed to
      mips_sc_is_activated]
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/1752/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      081d835f
    • B
      x86: avoid high BIOS area when allocating address space · a2c606d5
      Bjorn Helgaas 提交于
      This prevents allocation of the last 2MB before 4GB.
      
      The experiment described here shows Windows 7 ignoring the last 1MB:
      https://bugzilla.kernel.org/show_bug.cgi?id=23542#c27
      
      This patch ignores the top 2MB instead of just 1MB because H. Peter Anvin
      says "There will be ROM at the top of the 32-bit address space; it's a fact
      of the architecture, and on at least older systems it was common to have a
      shadow 1 MiB below."
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      a2c606d5
    • B
      x86: avoid E820 regions when allocating address space · 4dc2287c
      Bjorn Helgaas 提交于
      When we allocate address space, e.g., to assign it to a PCI device, don't
      allocate anything mentioned in the BIOS E820 memory map.
      
      On recent machines (2008 and newer), we assign PCI resources from the
      windows described by the ACPI PCI host bridge _CRS.  On many Dell
      machines, these windows overlap some E820 reserved areas, e.g.,
      
          BIOS-e820: 00000000bfe4dc00 - 00000000c0000000 (reserved)
          pci_root PNP0A03:00: host bridge window [mem 0xbff00000-0xdfffffff]
      
      If we put devices at 0xbff00000, they don't work, probably because
      that's really RAM, not I/O memory.  This patch prevents that by removing
      the 0xbfe4dc00-0xbfffffff area from the "available" resource.
      
      I'm not very happy with this solution because Windows solves the problem
      differently (it seems to ignore E820 reserved areas and it allocates
      top-down instead of bottom-up; details at comment 45 of the bugzilla
      below).  That means we're vulnerable to BIOS defects that Windows would not
      trip over.  For example, if BIOS described a device in ACPI but didn't
      mention it in E820, Windows would work fine but Linux would fail.
      
      Reference: https://bugzilla.kernel.org/show_bug.cgi?id=16228Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      4dc2287c
    • B
      x86: avoid low BIOS area when allocating address space · 30919b0b
      Bjorn Helgaas 提交于
      This implements arch_remove_reservations() so allocate_resource() can
      avoid any arch-specific reserved areas.  This currently just avoids the
      BIOS area (the first 1MB), but could be used for E820 reserved areas if
      that turns out to be necessary.
      
      We previously avoided this area in pcibios_align_resource().  This patch
      moves the test from that PCI-specific path to a generic path, so *all*
      resource allocations will avoid this area.
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      30919b0b
    • B
    • B
      Revert "x86: allocate space within a region top-down" · 5e52f1c5
      Bjorn Helgaas 提交于
      This reverts commit 1af3c2e4.
      Acked-by: NH. Peter Anvin <hpa@zytor.com>
      Signed-off-by: NBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      5e52f1c5
  8. 17 12月, 2010 17 次提交