<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/virt, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-12-01T15:10:50Z</updated>
<entry>
<title>KVM: use after free in kvm_ioctl_create_device()</title>
<updated>2016-12-01T15:10:50Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2016-11-30T19:21:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a0f1d21c1ccb1da66629627a74059dd7f5ac9c61'/>
<id>urn:sha1:a0f1d21c1ccb1da66629627a74059dd7f5ac9c61</id>
<content type='text'>
We should move the ops-&gt;destroy(dev) after the list_del(&amp;dev-&gt;vm_node)
so that we don't use "dev" after freeing it.

Fixes: a28ebea2adc4 ("KVM: Protect device ops-&gt;create and list_add with kvm-&gt;lock")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Signed-off-by: Radim Krčmář &lt;rkrcmar@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-arm-for-4.9-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm</title>
<updated>2016-12-01T13:56:34Z</updated>
<author>
<name>Radim Krčmář</name>
<email>rkrcmar@redhat.com</email>
</author>
<published>2016-12-01T13:56:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0f4828a1da3342be81e812b28fbcf29261146d25'/>
<id>urn:sha1:0f4828a1da3342be81e812b28fbcf29261146d25</id>
<content type='text'>
KVM/ARM updates for v4.9-rc7

- Do not call kvm_notify_acked for PPIs
</content>
</entry>
<entry>
<title>KVM: arm/arm64: vgic: Don't notify EOI for non-SPIs</title>
<updated>2016-11-24T13:12:07Z</updated>
<author>
<name>Marc Zyngier</name>
<email>marc.zyngier@arm.com</email>
</author>
<published>2016-11-23T10:11:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8ca18eec2b2276b449c1dc86b98bf083c5fe4e09'/>
<id>urn:sha1:8ca18eec2b2276b449c1dc86b98bf083c5fe4e09</id>
<content type='text'>
When we inject a level triggerered interrupt (and unless it
is backed by the physical distributor - timer style), we request
a maintenance interrupt. Part of the processing for that interrupt
is to feed to the rest of KVM (and to the eventfd subsystem) the
information that the interrupt has been EOIed.

But that notification only makes sense for SPIs, and not PPIs
(such as the PMU interrupt). Skip over the notification if
the interrupt is not an SPI.

Cc: stable@vger.kernel.org # 4.7+
Fixes: 140b086dd197 ("KVM: arm/arm64: vgic-new: Add GICv2 world switch backend")
Fixes: 59529f69f504 ("KVM: arm/arm64: vgic-new: Add GICv3 world switch backend")
Reported-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Tested-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>KVM: async_pf: avoid recursive flushing of work items</title>
<updated>2016-11-19T18:04:17Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2016-11-17T14:55:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=22583f0d9c85e60c9860bc8a0ebff59fe08be6d7'/>
<id>urn:sha1:22583f0d9c85e60c9860bc8a0ebff59fe08be6d7</id>
<content type='text'>
This was reported by syzkaller:

    [ INFO: possible recursive locking detected ]
    4.9.0-rc4+ #49 Not tainted
    ---------------------------------------------
    kworker/2:1/5658 is trying to acquire lock:
     ([ 1644.769018] (&amp;work-&gt;work)
    [&lt;     inline     &gt;] list_empty include/linux/compiler.h:243
    [&lt;ffffffff8128dd60&gt;] flush_work+0x0/0x660 kernel/workqueue.c:1511

    but task is already holding lock:
     ([ 1644.769018] (&amp;work-&gt;work)
    [&lt;ffffffff812916ab&gt;] process_one_work+0x94b/0x1900 kernel/workqueue.c:2093

    stack backtrace:
    CPU: 2 PID: 5658 Comm: kworker/2:1 Not tainted 4.9.0-rc4+ #49
    Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
    Workqueue: events async_pf_execute
     ffff8800676ff630 ffffffff81c2e46b ffffffff8485b930 ffff88006b1fc480
     0000000000000000 ffffffff8485b930 ffff8800676ff7e0 ffffffff81339b27
     ffff8800676ff7e8 0000000000000046 ffff88006b1fcce8 ffff88006b1fccf0
    Call Trace:
    ...
    [&lt;ffffffff8128ddf3&gt;] flush_work+0x93/0x660 kernel/workqueue.c:2846
    [&lt;ffffffff812954ea&gt;] __cancel_work_timer+0x17a/0x410 kernel/workqueue.c:2916
    [&lt;ffffffff81295797&gt;] cancel_work_sync+0x17/0x20 kernel/workqueue.c:2951
    [&lt;ffffffff81073037&gt;] kvm_clear_async_pf_completion_queue+0xd7/0x400 virt/kvm/async_pf.c:126
    [&lt;     inline     &gt;] kvm_free_vcpus arch/x86/kvm/x86.c:7841
    [&lt;ffffffff810b728d&gt;] kvm_arch_destroy_vm+0x23d/0x620 arch/x86/kvm/x86.c:7946
    [&lt;     inline     &gt;] kvm_destroy_vm virt/kvm/kvm_main.c:731
    [&lt;ffffffff8105914e&gt;] kvm_put_kvm+0x40e/0x790 virt/kvm/kvm_main.c:752
    [&lt;ffffffff81072b3d&gt;] async_pf_execute+0x23d/0x4f0 virt/kvm/async_pf.c:111
    [&lt;ffffffff8129175c&gt;] process_one_work+0x9fc/0x1900 kernel/workqueue.c:2096
    [&lt;ffffffff8129274f&gt;] worker_thread+0xef/0x1480 kernel/workqueue.c:2230
    [&lt;ffffffff812a5a94&gt;] kthread+0x244/0x2d0 kernel/kthread.c:209
    [&lt;ffffffff831f102a&gt;] ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:433

The reason is that kvm_put_kvm is causing the destruction of the VM, but
the page fault is still on the -&gt;queue list.  The -&gt;queue list is owned
by the VCPU, not by the work items, so we cannot just add list_del to
the work item.

Instead, use work-&gt;vcpu to note async page faults that have been resolved
and will be processed through the done list.  There is no need to flush
those.

Cc: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Radim Krčmář &lt;rkrcmar@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-arm-for-4.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm</title>
<updated>2016-11-19T17:02:07Z</updated>
<author>
<name>Radim Krčmář</name>
<email>rkrcmar@redhat.com</email>
</author>
<published>2016-11-19T17:02:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e5dbc4bf0b8c9ab50cc5699214240e84515be6eb'/>
<id>urn:sha1:e5dbc4bf0b8c9ab50cc5699214240e84515be6eb</id>
<content type='text'>
KVM/ARM updates for v4.9-rc6

- Fix handling of the 32bit cycle counter
- Fix cycle counter filtering
</content>
</entry>
<entry>
<title>KVM: arm64: Fix the issues when guest PMCCFILTR is configured</title>
<updated>2016-11-18T09:06:58Z</updated>
<author>
<name>Wei Huang</name>
<email>wei@redhat.com</email>
</author>
<published>2016-11-16T17:09:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b112c84a6ff035271d41d548c10215f18443d6a6'/>
<id>urn:sha1:b112c84a6ff035271d41d548c10215f18443d6a6</id>
<content type='text'>
KVM calls kvm_pmu_set_counter_event_type() when PMCCFILTR is configured.
But this function can't deals with PMCCFILTR correctly because the evtCount
bits of PMCCFILTR, which is reserved 0, conflits with the SW_INCR event
type of other PMXEVTYPER&lt;n&gt; registers. To fix it, when eventsel == 0, this
function shouldn't return immediately; instead it needs to check further
if select_idx is ARMV8_PMU_CYCLE_IDX.

Another issue is that KVM shouldn't copy the eventsel bits of PMCCFILTER
blindly to attr.config. Instead it ought to convert the request to the
"cpu cycle" event type (i.e. 0x11).

To support this patch and to prevent duplicated definitions, a limited
set of ARMv8 perf event types were relocated from perf_event.c to
asm/perf_event.h.

Cc: stable@vger.kernel.org # 4.6+
Acked-by: Will Deacon &lt;will.deacon@arm.com&gt;
Signed-off-by: Wei Huang &lt;wei@redhat.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-arm-for-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD</title>
<updated>2016-11-11T10:13:36Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2016-11-11T10:13:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=05d36a7dff0b091803034a0d70b41af86aecbc8d'/>
<id>urn:sha1:05d36a7dff0b091803034a0d70b41af86aecbc8d</id>
<content type='text'>
KVM/ARM updates for v4.9-rc4

- Kick the vcpu when a pending interrupt becomes pending again
- Prevent access to invalid interrupt registers
- Invalid TLBs when two vcpus from the same VM share a CPU
</content>
</entry>
<entry>
<title>Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm</title>
<updated>2016-11-04T20:08:05Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2016-11-04T20:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66cecb67894b35c6af17eb4e6b6aaec6c8957c2e'/>
<id>urn:sha1:66cecb67894b35c6af17eb4e6b6aaec6c8957c2e</id>
<content type='text'>
Pull KVM updates from Paolo Bonzini:
 "One NULL pointer dereference, and two fixes for regressions introduced
  during the merge window.

  The rest are fixes for MIPS, s390 and nested VMX"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  kvm: x86: Check memopp before dereference (CVE-2016-8630)
  kvm: nVMX: VMCLEAR an active shadow VMCS after last use
  KVM: x86: drop TSC offsetting kvm_x86_ops to fix KVM_GET/SET_CLOCK
  KVM: x86: fix wbinvd_dirty_mask use-after-free
  kvm/x86: Show WRMSR data is in hex
  kvm: nVMX: Fix kernel panics induced by illegal INVEPT/INVVPID types
  KVM: document lock orders
  KVM: fix OOPS on flush_work
  KVM: s390: Fix STHYI buffer alignment for diag224
  KVM: MIPS: Precalculate MMIO load resume PC
  KVM: MIPS: Make ERET handle ERL before EXL
  KVM: MIPS: Fix lazy user ASID regenerate for SMP
</content>
</entry>
<entry>
<title>KVM: arm/arm64: vgic: Kick VCPUs when queueing already pending IRQs</title>
<updated>2016-11-04T17:56:56Z</updated>
<author>
<name>Shih-Wei Li</name>
<email>shihwei@cs.columbia.edu</email>
</author>
<published>2016-10-27T15:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d42c79701a3ee5c38fbbc82f98a140420bd40134'/>
<id>urn:sha1:d42c79701a3ee5c38fbbc82f98a140420bd40134</id>
<content type='text'>
In cases like IPI, we could be queueing an interrupt for a VCPU
that is already running and is not about to exit, because the
VCPU has entered the VM with the interrupt pending and would
not trap on EOI'ing that interrupt. This could result to delays
in interrupt deliveries or even loss of interrupts.
To guarantee prompt interrupt injection, here we have to try to
kick the VCPU.

Signed-off-by: Shih-Wei Li &lt;shihwei@cs.columbia.edu&gt;
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
<entry>
<title>KVM: arm/arm64: vgic: Prevent access to invalid SPIs</title>
<updated>2016-11-04T17:56:54Z</updated>
<author>
<name>Andre Przywara</name>
<email>andre.przywara@arm.com</email>
</author>
<published>2016-11-01T18:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=112b0b8f8f6e18d4695d21457961c0e1b322a1d7'/>
<id>urn:sha1:112b0b8f8f6e18d4695d21457961c0e1b322a1d7</id>
<content type='text'>
In our VGIC implementation we limit the number of SPIs to a number
that the userland application told us. Accordingly we limit the
allocation of memory for virtual IRQs to that number.
However in our MMIO dispatcher we didn't check if we ever access an
IRQ beyond that limit, leading to out-of-bound accesses.
Add a test against the number of allocated SPIs in check_region().
Adjust the VGIC_ADDR_TO_INT macro to avoid an actual division, which
is not implemented on ARM(32).

[maz: cleaned-up original patch]

Cc: stable@vger.kernel.org
Reviewed-by: Christoffer Dall &lt;christoffer.dall@linaro.org&gt;
Signed-off-by: Andre Przywara &lt;andre.przywara@arm.com&gt;
Signed-off-by: Marc Zyngier &lt;marc.zyngier@arm.com&gt;
</content>
</entry>
</feed>
