1. 24 9月, 2010 28 次提交
  2. 23 9月, 2010 12 次提交
    • 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