<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/virt, branch v3.2.38</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/virt?h=v3.2.38</id>
<link rel='self' href='https://git.amat.us/linux/atom/virt?h=v3.2.38'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-07-25T03:11:05Z</updated>
<entry>
<title>KVM: Fix buffer overflow in kvm_set_irq()</title>
<updated>2012-07-25T03:11:05Z</updated>
<author>
<name>Avi Kivity</name>
<email>avi@redhat.com</email>
</author>
<published>2012-04-22T14:02:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0f3cbc35d2097d2c655789dd4996e7b87bdb5d34'/>
<id>urn:sha1:0f3cbc35d2097d2c655789dd4996e7b87bdb5d34</id>
<content type='text'>
commit f2ebd422f71cda9c791f76f85d2ca102ae34a1ed upstream.

kvm_set_irq() has an internal buffer of three irq routing entries, allowing
connecting a GSI to three IRQ chips or on MSI.  However setup_routing_entry()
does not properly enforce this, allowing three irqchip routes followed by
an MSI route to overflow the buffer.

Fix by ensuring that an MSI entry is added to an empty list.

Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>KVM: lock slots_lock around device assignment</title>
<updated>2012-05-30T23:43:11Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2012-04-18T03:46:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=50fcec93e8c917b4f6e1a3219207d351e6eae1b2'/>
<id>urn:sha1:50fcec93e8c917b4f6e1a3219207d351e6eae1b2</id>
<content type='text'>
(cherry picked from commit 21a1416a1c945c5aeaeaf791b63c64926018eb77)

As pointed out by Jason Baron, when assigning a device to a guest
we first set the iommu domain pointer, which enables mapping
and unmapping of memory slots to the iommu.  This leaves a window
where this path is enabled, but we haven't synchronized the iommu
mappings to the existing memory slots.  Thus a slot being removed
at that point could send us down unexpected code paths removing
non-existent pinnings and iommu mappings.  Take the slots_lock
around creating the iommu domain and initial mappings as well as
around iommu teardown to avoid this race.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Ensure all vcpus are consistent with in-kernel irqchip settings</title>
<updated>2012-05-30T23:43:10Z</updated>
<author>
<name>Avi Kivity</name>
<email>avi@redhat.com</email>
</author>
<published>2012-03-05T12:23:29Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=645b177cbfce6b695bdbe0b4c131de584821840d'/>
<id>urn:sha1:645b177cbfce6b695bdbe0b4c131de584821840d</id>
<content type='text'>
(cherry picked from commit 3e515705a1f46beb1c942bb8043c16f8ac7b1e9e)

If some vcpus are created before KVM_CREATE_IRQCHIP, then
irqchip_in_kernel() and vcpu-&gt;arch.apic will be inconsistent, leading
to potential NULL pointer dereferences.

Fix by:
- ensuring that no vcpus are installed when KVM_CREATE_IRQCHIP is called
- ensuring that a vcpu has an apic if it is installed after KVM_CREATE_IRQCHIP

This is somewhat long winded because vcpu-&gt;arch.apic is created without
kvm-&gt;lock held.

Based on earlier patch by Michael Ellerman.

Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>KVM: mmu_notifier: Flush TLBs before releasing mmu_lock</title>
<updated>2012-05-30T23:43:09Z</updated>
<author>
<name>Takuya Yoshikawa</name>
<email>yoshikawa.takuya@oss.ntt.co.jp</email>
</author>
<published>2012-02-10T06:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51155201f92e585d40d8921893a508e8b99b2d0e'/>
<id>urn:sha1:51155201f92e585d40d8921893a508e8b99b2d0e</id>
<content type='text'>
(cherry picked from commit 565f3be2174611f364405bbea2d86e153c2e7e78

Other threads may process the same page in that small window and skip
TLB flush and then return before these functions do flush.

Signed-off-by: Takuya Yoshikawa &lt;yoshikawa.takuya@oss.ntt.co.jp&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Avi Kivity &lt;avi@redhat.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>KVM: unmap pages from the iommu when slots are removed</title>
<updated>2012-05-11T12:14:07Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2012-04-27T21:54:08Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1e57aab4e6c549804298f07fac0b6fc77f10fab2'/>
<id>urn:sha1:1e57aab4e6c549804298f07fac0b6fc77f10fab2</id>
<content type='text'>
commit 32f6daad4651a748a58a3ab6da0611862175722f upstream.

We've been adding new mappings, but not destroying old mappings.
This can lead to a page leak as pages are pinned using
get_user_pages, but only unpinned with put_page if they still
exist in the memslots list on vm shutdown.  A memslot that is
destroyed while an iommu domain is enabled for the guest will
therefore result in an elevated page reference count that is
never cleared.

Additionally, without this fix, the iommu is only programmed
with the first translation for a gpa.  This can result in
peer-to-peer errors if a mapping is destroyed and replaced by a
new mapping at the same gpa as the iommu will still be pointing
to the original, pinned memory address.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Device assignment permission checks</title>
<updated>2011-12-25T17:03:54Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2011-12-21T04:59:09Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3d27e23b17010c668db311140b17bbbb70c78fb9'/>
<id>urn:sha1:3d27e23b17010c668db311140b17bbbb70c78fb9</id>
<content type='text'>
Only allow KVM device assignment to attach to devices which:

 - Are not bridges
 - Have BAR resources (assume others are special devices)
 - The user has permissions to use

Assigning a bridge is a configuration error, it's not supported, and
typically doesn't result in the behavior the user is expecting anyway.
Devices without BAR resources are typically chipset components that
also don't have host drivers.  We don't want users to hold such devices
captive or cause system problems by fencing them off into an iommu
domain.  We determine "permission to use" by testing whether the user
has access to the PCI sysfs resource files.  By default a normal user
will not have access to these files, so it provides a good indication
that an administration agent has granted the user access to the device.

[Yang Bai: add missing #include]
[avi: fix comment style]

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Yang Bai &lt;hamo.by@gmail.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: Remove ability to assign a device without iommu support</title>
<updated>2011-12-25T15:13:31Z</updated>
<author>
<name>Alex Williamson</name>
<email>alex.williamson@redhat.com</email>
</author>
<published>2011-12-21T04:59:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=423873736b78f549fbfa2f715f2e4de7e6c5e1e9'/>
<id>urn:sha1:423873736b78f549fbfa2f715f2e4de7e6c5e1e9</id>
<content type='text'>
This option has no users and it exposes a security hole that we
can allow devices to be assigned without iommu protection.  Make
KVM_DEV_ASSIGN_ENABLE_IOMMU a mandatory option.

Signed-off-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Marcelo Tosatti &lt;mtosatti@redhat.com&gt;
</content>
</entry>
<entry>
<title>kvm: iommu.c file requires the full module.h present.</title>
<updated>2011-10-31T23:32:13Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-28T01:25:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=51441d434f621c5c74470b36579ae7c9fb5b7139'/>
<id>urn:sha1:51441d434f621c5c74470b36579ae7c9fb5b7139</id>
<content type='text'>
This file has things like module_param_named() and MODULE_PARM_DESC()
so it needs the full module.h header present.  Without it, you'll get:

  CC      arch/x86/kvm/../../../virt/kvm/iommu.o
virt/kvm/iommu.c:37: error: expected ‘)’ before ‘bool’
virt/kvm/iommu.c:39: error: expected ‘)’ before string constant
make[3]: *** [arch/x86/kvm/../../../virt/kvm/iommu.o] Error 1
make[2]: *** [arch/x86/kvm] Error 2

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>kvm: fix implicit use of stat.h header file</title>
<updated>2011-10-31T23:32:12Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-28T01:17:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=799fd8b23961f73fb7e7eeaee79f7ef0850e6c31'/>
<id>urn:sha1:799fd8b23961f73fb7e7eeaee79f7ef0850e6c31</id>
<content type='text'>
This was coming in via an implicit module.h (and its sub-includes)
before, but we'll be cleaning that up shortly.  Call out the stat.h
include requirement in advance.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu</title>
<updated>2011-10-30T22:46:19Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2011-10-30T22:46:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0cfdc724390fb9370f27bb9a133eadf69114dd21'/>
<id>urn:sha1:0cfdc724390fb9370f27bb9a133eadf69114dd21</id>
<content type='text'>
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (33 commits)
  iommu/core: Remove global iommu_ops and register_iommu
  iommu/msm: Use bus_set_iommu instead of register_iommu
  iommu/omap: Use bus_set_iommu instead of register_iommu
  iommu/vt-d: Use bus_set_iommu instead of register_iommu
  iommu/amd: Use bus_set_iommu instead of register_iommu
  iommu/core: Use bus-&gt;iommu_ops in the iommu-api
  iommu/core: Convert iommu_found to iommu_present
  iommu/core: Add bus_type parameter to iommu_domain_alloc
  Driver core: Add iommu_ops to bus_type
  iommu/core: Define iommu_ops and register_iommu only with CONFIG_IOMMU_API
  iommu/amd: Fix wrong shift direction
  iommu/omap: always provide iommu debug code
  iommu/core: let drivers know if an iommu fault handler isn't installed
  iommu/core: export iommu_set_fault_handler()
  iommu/omap: Fix build error with !IOMMU_SUPPORT
  iommu/omap: Migrate to the generic fault report mechanism
  iommu/core: Add fault reporting mechanism
  iommu/core: Use PAGE_SIZE instead of hard-coded value
  iommu/core: use the existing IS_ALIGNED macro
  iommu/msm: -&gt;unmap() should return order of unmapped page
  ...

Fixup trivial conflicts in drivers/iommu/Makefile: "move omap iommu to
dedicated iommu folder" vs "Rename the DMAR and INTR_REMAP config
options" just happened to touch lines next to each other.
</content>
</entry>
</feed>
