1. 24 9月, 2010 25 次提交
  2. 23 9月, 2010 15 次提交
    • L
      57aebd77
    • A
      KVM: Fix reboot on Intel hosts · ca242ac9
      Avi Kivity 提交于
      When we reboot, we disable vmx extensions or otherwise INIT gets blocked.
      If a task on another cpu hits a vmx instruction, it will fault if vmx is
      disabled.  We trap that to avoid a nasty oops and spin until the reboot
      completes.
      
      Problem is, we sleep with interrupts disabled.  This blocks smp_send_stop()
      from running, and the reboot process halts.
      
      Fix by enabling interrupts before spinning.
      
      KVM-Stable-Tag.
      Signed-off-by: NAvi Kivity <avi@redhat.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      ca242ac9
    • M
      KVM: fix irqfd assign/deassign race · 6bbfb265
      Michael S. Tsirkin 提交于
      I think I see the following (theoretical) race:
      
      During irqfd assign, we drop irqfds lock before we
      schedule inject work. Therefore, deassign running
      on another CPU could cause shutdown and flush to run
      before inject, causing user after free in inject.
      
      A simple fix it to schedule inject under the lock.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NGregory Haskins <ghaskins@novell.com>
      Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
      6bbfb265
    • Y
      ipmi: fix hardcoded ipmi device exit path warning · 561f8182
      Yinghai Lu 提交于
      When modprobe.conf has
      options ipmi_si type="kcs" ports=0xCA2 regspacings="4"
      
      ipmi_si can be loaded properly, but when try to unload it get:
      
      Sep 20 15:00:27 xx abrt: Kerneloops: Reported 1 kernel oopses to Abrt
      Sep 20 15:00:27 xx abrtd: Directory 'kerneloops-1285020027-1' creation detected
      Sep 20 15:00:27 xx abrtd: New crash /var/spool/abrt/kerneloops-1285020027-1, processing
      Sep 20 15:01:09 xx kernel: ------------[ cut here ]------------
      Sep 20 15:01:09 xx kernel: WARNING: at drivers/base/driver.c:262 driver_unregister+0x8a/0xa0()
      Sep 20 15:01:09 xx kernel: Hardware name: Sun Fire x4800
      Sep 20 15:01:09 xx kernel: Unexpected driver unregister!
      Sep 20 15:01:09 xx kernel: Modules linked in: ipmi_si(-) ipmi_msghandler ip6table_filter ip6_tables ebtable_nat ebtables ipt_MASQUERADE iptable_nat nf_nat bridge stp llc autofs4 sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf xt_physdev be2iscsi iscsi_boot_sysfs bnx2i cnic uio cxgb3i iw_cxgb3 cxgb3 mdio ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr ipv6 iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi dm_mirror dm_region_hash dm_log dm_mod vhost_net macvtap macvlan tun kvm_intel kvm uinput sg ses enclosure ahci libahci pcspkr i2c_i801 i2c_core iTCO_wdt iTCO_vendor_support igb dca i7core_edac edac_core ext3 jbd mbcache sd_mod crc_t10dif megaraid_sas [last unloaded: ipmi_devintf]
      Sep 20 15:01:09 xx kernel: Pid: 10625, comm: modprobe Tainted: G        W   2.6.36-rc5-tip+ #6
      Sep 20 15:01:09 xx kernel: Call Trace:
      Sep 20 15:01:09 xx kernel: [<ffffffff810600df>] warn_slowpath_common+0x7f/0xc0
      Sep 20 15:01:09 xx kernel: [<ffffffff810601d6>] warn_slowpath_fmt+0x46/0x50
      Sep 20 15:01:09 xx kernel: [<ffffffff812ff60a>] driver_unregister+0x8a/0xa0
      Sep 20 15:01:09 xx kernel: [<ffffffff812ae112>] pnp_unregister_driver+0x12/0x20
      Sep 20 15:01:09 xx kernel: [<ffffffffa01d0327>] cleanup_ipmi_si+0x3c/0xa7 [ipmi_si]
      Sep 20 15:01:09 xx kernel: [<ffffffff81099a60>] sys_delete_module+0x1a0/0x270
      Sep 20 15:01:09 xx kernel: [<ffffffff814b7070>] ? do_page_fault+0x150/0x320
      Sep 20 15:01:09 xx kernel: [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b
      Sep 20 15:01:09 xx kernel: ---[ end trace 0d1967161adcee0d ]---
      
      We need to check if ipmi_pnp_driver is loaded before we try to unload it.
      Signed-off-by: NYinghai Lu <yinghai@kernel.org>
      Cc: Corey Minyard <minyard@acm.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      561f8182
    • V
      rtc: s3c: balance state changes of wakeup flag · f501ed52
      Vladimir Zapolskiy 提交于
      This change resolves a problem about unbalanced calls of
      enable_irq_wakeup() and disable_irq_wakeup() for alarm interrupt.
      
      Bug reproduction:
      
      root@eb600:~# echo 0 > /sys/class/rtc/rtc0/wakealarm
      
      WARNING: at kernel/irq/manage.c:361 set_irq_wake+0x7c/0xe4()
       Unbalanced IRQ 46 wake disable
      Modules linked in:
      [<c0025708>] (unwind_backtrace+0x0/0xd8) from [<c003358c>] (warn_slowpath_common+0x44/0x5c)
      [<c003358c>] (warn_slowpath_common+0x44/0x5c) from [<c00335dc>] (warn_slowpath_fmt+0x24/0x30)
      [<c00335dc>] (warn_slowpath_fmt+0x24/0x30) from [<c0058c20>] (set_irq_wake+0x7c/0xe4)
      [<c0058c20>] (set_irq_wake+0x7c/0xe4) from [<c01b5e80>] (s3c_rtc_setalarm+0xa8/0xb8)
      [<c01b5e80>] (s3c_rtc_setalarm+0xa8/0xb8) from [<c01b47a0>] (rtc_set_alarm+0x60/0x74)
      [<c01b47a0>] (rtc_set_alarm+0x60/0x74) from [<c01b5a98>] (rtc_sysfs_set_wakealarm+0xc8/0xd8)
      [<c01b5a98>] (rtc_sysfs_set_wakealarm+0xc8/0xd8) from [<c01891ec>] (dev_attr_store+0x20/0x24)
      [<c01891ec>] (dev_attr_store+0x20/0x24) from [<c00be934>] (sysfs_write_file+0x104/0x13c)
      [<c00be934>] (sysfs_write_file+0x104/0x13c) from [<c0080e7c>] (vfs_write+0xb0/0x158)
      [<c0080e7c>] (vfs_write+0xb0/0x158) from [<c0080fcc>] (sys_write+0x3c/0x68)
      [<c0080fcc>] (sys_write+0x3c/0x68) from [<c0020ec0>] (ret_fast_syscall+0x0/0x28)
      Signed-off-by: NVladimir Zapolskiy <vzapolskiy@gmail.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Ben Dooks <ben@fluff.org.uk>
      Cc: Atul Dahiya <atul.dahiya@samsung.com>
      Cc: Taekgyun Ko <taeggyun.ko@samsung.com>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f501ed52
    • A
      mmap: call unlink_anon_vmas() in __split_vma() in case of error · 2aeadc30
      Andrea Arcangeli 提交于
      If __split_vma fails because of an out of memory condition the
      anon_vma_chain isn't teardown and freed potentially leading to rmap walks
      accessing freed vma information plus there's a memleak.
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Acked-by: NJohannes Weiner <jweiner@redhat.com>
      Acked-by: NRik van Riel <riel@redhat.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: Marcelo Tosatti <mtosatti@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2aeadc30
    • A
      rmap: fix walk during fork · a247c3a9
      Andrea Arcangeli 提交于
      The below bug in fork led to the rmap walk finding the parent huge-pmd
      twice instead of just once, because the anon_vma_chain objects of the
      child vma still point to the vma->vm_mm of the parent.
      
      The patch fixes it by making the rmap walk accurate during fork.  It's not
      a big deal normally but it worth being accurate considering the cost is
      the same.
      Signed-off-by: NAndrea Arcangeli <aarcange@redhat.com>
      Acked-by: NJohannes Weiner <jweiner@redhat.com>
      Acked-by: NRik van Riel <riel@redhat.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a247c3a9
    • A
      drivers/pci/intel-iommu.c: fix build with older gcc's · df08cdc7
      Andrew Morton 提交于
      drivers/pci/intel-iommu.c: In function `__iommu_calculate_agaw':
      drivers/pci/intel-iommu.c:437: sorry, unimplemented: inlining failed in call to 'width_to_agaw': function body not available
      drivers/pci/intel-iommu.c:445: sorry, unimplemented: called from here
      
      Move the offending function (and its siblings) to top-of-file, remove the
      forward declaration.
      
      Addresses https://bugzilla.kernel.org/show_bug.cgi?id=17441Reported-by: NMartin Mokrejs <mmokrejs@ribosome.natur.cuni.cz>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      df08cdc7
    • D
      oom: filter unkillable tasks from tasklist dump · e85bfd3a
      David Rientjes 提交于
      /proc/sys/vm/oom_dump_tasks is enabled by default, so it's necessary to
      limit as much information as possible that it should emit.
      
      The tasklist dump should be filtered to only those tasks that are eligible
      for oom kill.  This is already done for memcg ooms, but this patch extends
      it to both cpuset and mempolicy ooms as well as init.
      
      In addition to suppressing irrelevant information, this also reduces
      confusion since users currently don't know which tasks in the tasklist
      aren't eligible for kill (such as those attached to cpusets or bound to
      mempolicies with a disjoint set of mems or nodes, respectively) since that
      information is not shown.
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Reviewed-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e85bfd3a
    • D
      drivers/video/sis/sis_main.c: prevent reading uninitialized stack memory · fd02db9d
      Dan Rosenberg 提交于
      The FBIOGET_VBLANK device ioctl allows unprivileged users to read 16 bytes
      of uninitialized stack memory, because the "reserved" member of the
      fb_vblank struct declared on the stack is not altered or zeroed before
      being copied back to the user.  This patch takes care of it.
      Signed-off-by: NDan Rosenberg <dan.j.rosenberg@gmail.com>
      Cc: Thomas Winischhofer <thomas@winischhofer.net>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd02db9d
    • R
      uml: fix compile warning · cb1dcc0f
      Richard Weinberger 提交于
      This fixes:
      incompatible pointer type:  => 89
             arch/um/kernel/exec.c: warning: passing argument 2 of 'execve1' from
      incompatible pointer type:  => 69, 85
             arch/um/kernel/exec.c: warning: passing argument 3 of 'execve1' from
      incompatible pointer type:  => 69, 85
      
      which was introduced by d7627467 ("Make do_execve() take a const
      filename pointer")
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      cb1dcc0f
    • K
      /proc/pid/smaps: fix dirty pages accounting · 1c2499ae
      KOSAKI Motohiro 提交于
      Currently, /proc/<pid>/smaps has wrong dirty pages accounting.
      Shared_Dirty and Private_Dirty output only pte dirty pages and ignore
      PG_dirty page flag.  It is difference against documentation, but also
      inconsistent against Referenced field.  (Referenced checks both pte and
      page flags)
      
      This patch fixes it.
      
      Test program:
      
       large-array.c
       ---------------------------------------------------
       #include <stdio.h>
       #include <stdlib.h>
       #include <string.h>
       #include <unistd.h>
      
       char array[1*1024*1024*1024L];
      
       int main(void)
       {
               memset(array, 1, sizeof(array));
               pause();
      
               return 0;
       }
       ---------------------------------------------------
      
      Test case:
       1. run ./large-array
       2. cat /proc/`pidof large-array`/smaps
       3. swapoff -a
       4. cat /proc/`pidof large-array`/smaps again
      
      Test result:
       <before patch>
      
      00601000-40601000 rw-p 00000000 00:00 0
      Size:            1048576 kB
      Rss:             1048576 kB
      Pss:             1048576 kB
      Shared_Clean:          0 kB
      Shared_Dirty:          0 kB
      Private_Clean:    218992 kB   <-- showed pages as clean incorrectly
      Private_Dirty:    829584 kB
      Referenced:       388364 kB
      Swap:                  0 kB
      KernelPageSize:        4 kB
      MMUPageSize:           4 kB
      
       <after patch>
      
      00601000-40601000 rw-p 00000000 00:00 0
      Size:            1048576 kB
      Rss:             1048576 kB
      Pss:             1048576 kB
      Shared_Clean:          0 kB
      Shared_Dirty:          0 kB
      Private_Clean:         0 kB
      Private_Dirty:   1048576 kB  <-- fixed
      Referenced:       388480 kB
      Swap:                  0 kB
      KernelPageSize:        4 kB
      MMUPageSize:           4 kB
      Signed-off-by: NKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Acked-by: NHugh Dickins <hughd@google.com>
      Cc: Matt Mackall <mpm@selenic.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1c2499ae
    • J
      fbcon: fix lockdep warning from fbcon_deinit() · 142092e5
      Jarek Poplawski 提交于
      Fix the lockdep warning:
      
      [   13.657164] INFO: trying to register non-static key.
      [   13.657169] the code is fine but needs lockdep annotation.
      [   13.657171] turning off the locking correctness validator.
      [   13.657177] Pid: 622, comm: modprobe Not tainted 2.6.36-rc3c #8
      [   13.657180] Call Trace:
      [   13.657194]  [<c13002c8>] ? printk+0x18/0x20
      [   13.657202]  [<c1056cf6>] register_lock_class+0x336/0x350
      [   13.657208]  [<c1058bf9>] __lock_acquire+0x449/0x1180
      [   13.657215]  [<c1059997>] lock_acquire+0x67/0x80
      [   13.657222]  [<c1042bf1>] ? __cancel_work_timer+0x51/0x230
      [   13.657227]  [<c1042c23>] __cancel_work_timer+0x83/0x230
      [   13.657231]  [<c1042bf1>] ? __cancel_work_timer+0x51/0x230
      [   13.657236]  [<c10582b2>] ? mark_held_locks+0x62/0x80
      [   13.657243]  [<c10b3a2f>] ? kfree+0x7f/0xe0
      [   13.657248]  [<c105853c>] ? trace_hardirqs_on_caller+0x11c/0x160
      [   13.657253]  [<c105858b>] ? trace_hardirqs_on+0xb/0x10
      [   13.657259]  [<c117f4cd>] ? fbcon_deinit+0x16d/0x1e0
      [   13.657263]  [<c117f4cd>] ? fbcon_deinit+0x16d/0x1e0
      [   13.657268]  [<c1042dea>] cancel_work_sync+0xa/0x10
      [   13.657272]  [<c117f444>] fbcon_deinit+0xe4/0x1e0
      ...
      
      The warning is caused by trying to cancel an uninitialized work from
      fbcon_exit().  Fix it by adding a check for queue.func, similarly to other
      places in this code.
      Signed-off-by: NJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      142092e5
    • L
      efifb: support the EFI framebuffer on more Apple hardware · a5757c2a
      Luke Macken 提交于
      Enable the EFI framebuffer on 14 more Macs, including the iMac11,1
      iMac10,1 iMac8,1 Macmini3,1 Macmini4,1 MacBook5,1 MacBook6,1 MacBook7,1
      MacBookPro2,2 MacBookPro5,2 MacBookPro5,3 MacBookPro6,1 MacBookPro6,2 and
      MacBookPro7,1
      
      Information gathered from various user submissions.
      
          https://bugzilla.redhat.com/show_bug.cgi?id=528232
          http://ubuntuforums.org/showthread.php?t=1557326
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NLuke Macken <lmacken@redhat.com>
      Signed-off-by: NPeter Jones <pjones@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a5757c2a
    • P
      efifb: check that the base address is plausible on pci systems · 85a00d9b
      Peter Jones 提交于
      Some Apple machines have identical DMI data but different memory
      configurations for the video.  Given that, check that the address in our
      table is actually within the range of a PCI BAR on a VGA device in the
      machine.
      
      This also fixes up the return value from set_system(), which has always
      been wrong, but never resulted in bad behavior since there's only ever
      been one matching entry in the dmi table.
      
      The patch
      
      1) stops people's machines from crashing when we get their display wrong,
         which seems to be unfortunately inevitable,
      
      2) allows us to support identical dmi data with differing video memory
         configurations
      
      This also adds me as the efifb maintainer, since I've effectively been
      acting as such for quite some time.
      Signed-off-by: NPeter Jones <pjones@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      85a00d9b