1. 04 5月, 2011 2 次提交
    • D
      [CPUFREQ] use dynamic debug instead of custom infrastructure · 2d06d8c4
      Dominik Brodowski 提交于
      With dynamic debug having gained the capability to report debug messages
      also during the boot process, it offers a far superior interface for
      debug messages than the custom cpufreq infrastructure. As a first step,
      remove the old cpufreq_debug_printk() function and replace it with a call
      to the generic pr_debug() function.
      
      How can dynamic debug be used on cpufreq? You need a kernel which has
      CONFIG_DYNAMIC_DEBUG enabled.
      
      To enabled debugging during runtime, mount debugfs and
      
      $ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control
      
      for debugging the complete "cpufreq" module. To achieve the same goal during
      boot, append
      
      	ddebug_query="module cpufreq +p"
      
      as a boot parameter to the kernel of your choice.
      
      For more detailled instructions, please see
      Documentation/dynamic-debug-howto.txt
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NDave Jones <davej@redhat.com>
      2d06d8c4
    • J
      [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks · 27ecddc2
      Jacob Shin 提交于
      When we discover CPUs that are affected by each other's
      frequency/voltage transitions, the first CPU gets a sysfs directory
      created, and rest of the siblings get symlinks. Currently, when we
      hotplug off only the first CPU, all of the symlinks and the sysfs
      directory gets removed. Even though rest of the siblings are still
      online and functional, they are orphaned, and no longer governed by
      cpufreq.
      
      This patch, given the above scenario, creates a sysfs directory for
      the first sibling and symlinks for the rest of the siblings.
      
      Please note the recursive call, it was rather too ugly to roll it
      out. And the removal of redundant NULL setting (it is already taken
      care of near the top of the function).
      Signed-off-by: NJacob Shin <jacob.shin@amd.com>
      Acked-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Reviewed-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NDave Jones <davej@redhat.com>
      Cc: stable@kernel.org
      27ecddc2
  2. 24 4月, 2011 9 次提交
  3. 22 4月, 2011 2 次提交
  4. 21 4月, 2011 6 次提交
    • A
      virtio: console: Enable call to hvc_remove() on console port remove · afa2689e
      Amit Shah 提交于
      This call was disabled as hot-unplugging one virtconsole port led to
      another virtconsole port freezing.
      
      Upon testing it again, this now works, so enable it.
      
      In addition, a bug was found in qemu wherein removing a port of one type
      caused the guest output from another port to stop working.  I doubt it
      was just this bug that caused it (since disabling the hvc_remove() call
      did allow other ports to continue working), but since it's all solved
      now, we're fine with hot-unplugging of virtconsole ports.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      afa2689e
    • A
      virtio_pci: Prevent double-free of pci regions after device hot-unplug · 31a3ddda
      Amit Shah 提交于
      In the case where a virtio-console port is in use (opened by a program)
      and a virtio-console device is removed, the port is kept around but all
      the virtio-related state is assumed to be gone.
      
      When the port is finally released (close() called), we call
      device_destroy() on the port's device.  This results in the parent
      device's structures to be freed as well.  This includes the PCI regions
      for the virtio-console PCI device.
      
      Once this is done, however, virtio_pci_release_dev() kicks in, as the
      last ref to the virtio device is now gone, and attempts to do
      
           pci_iounmap(pci_dev, vp_dev->ioaddr);
           pci_release_regions(pci_dev);
           pci_disable_device(pci_dev);
      
      which results in a double-free warning.
      
      Move the code that releases regions, etc., to the virtio_pci_remove()
      function, and all that's now left in release_dev is the final freeing of
      the vp_dev.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      31a3ddda
    • A
      virtio: Decrement avail idx on buffer detach · b3258ff1
      Amit Shah 提交于
      When detaching a buffer from a vq, the avail.idx value should be
      decremented as well.
      
      This was noticed by hot-unplugging a virtio console port and then
      plugging in a new one on the same number (re-using the vqs which were
      just 'disowned').  qemu reported
      
         'Guest moved used index from 0 to 256'
      
      when any IO was attempted on the new port.
      
      CC: stable@kernel.org
      Reported-by: Njuzhang <juzhang@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      b3258ff1
    • J
      intel_iommu: disable all VT-d PMRs when TXT launched · 51a63e67
      Joseph Cihula 提交于
      Intel VT-d Protected Memory Regions (PMRs) are supposed to be disabled,
      on each VT-d engine, after DMA remapping is enabled on the engines.
      This is because the behavior of having both enabled is not deterministic
      and because, if TXT has been used to launch the kernel, the PMRs may be
      programmed to cover memory regions that will be used for DMA.
      
      Under some circumstances (certain quirks detected, lack of multiple
      devices, etc.), the current code does not set up DMA remapping on some
      VT-d engines.  In such cases it also skips disabling the PMRs.  This
      causes failures when the kernel is launched with TXT (most often this
      occurs on the graphics engine and results in colored vertical bars on
      the display).
      
      This patch detects when the kernel has been launched with TXT and then
      disables the PMRs on all VT-d engines.  In some cases where the reason
      that remapping is not being enabled is due to possible ACPI DMAR table
      errors, the VT-d engine addresses may not be correct and thus not able
      to be safely programmed even to disable PMRs.  Because part of the TXT
      launch process is the verification of these addresses, it will always be
      safe to disable PMRs if the TXT launch has succeeded and hence only
      doing this in such cases.
      Signed-off-by: NJoseph Cihula <joseph.cihula@intel.com>
      Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
      51a63e67
    • V
      agp: fix arbitrary kernel memory writes · 194b3da8
      Vasiliy Kulikov 提交于
      pg_start is copied from userspace on AGPIOC_BIND and AGPIOC_UNBIND ioctl
      cmds of agp_ioctl() and passed to agpioc_bind_wrap().  As said in the
      comment, (pg_start + mem->page_count) may wrap in case of AGPIOC_BIND,
      and it is not checked at all in case of AGPIOC_UNBIND.  As a result, user
      with sufficient privileges (usually "video" group) may generate either
      local DoS or privilege escalation.
      Signed-off-by: NVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      194b3da8
    • V
      agp: fix OOM and buffer overflow · b522f021
      Vasiliy Kulikov 提交于
      page_count is copied from userspace.  agp_allocate_memory() tries to
      check whether this number is too big, but doesn't take into account the
      wrap case.  Also agp_create_user_memory() doesn't check whether
      alloc_size is calculated from num_agp_pages variable without overflow.
      This may lead to allocation of too small buffer with following buffer
      overflow.
      
      Another problem in agp code is not addressed in the patch - kernel memory
      exhaustion (AGPIOC_RESERVE and AGPIOC_ALLOCATE ioctls).  It is not checked
      whether requested pid is a pid of the caller (no check in agpioc_reserve_wrap()).
      Each allocation is limited to 16KB, though, there is no per-process limit.
      This might lead to OOM situation, which is not even solved in case of the
      caller death by OOM killer - the memory is allocated for another (faked) process.
      Signed-off-by: NVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      b522f021
  5. 20 4月, 2011 16 次提交
  6. 19 4月, 2011 4 次提交
  7. 18 4月, 2011 1 次提交