<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kvm, branch linux-3.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.12.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-04-07T07:17:47Z</updated>
<entry>
<title>KVM: PPC: Book3S PR: Fix illegal opcode emulation</title>
<updated>2017-04-07T07:17:47Z</updated>
<author>
<name>Thomas Huth</name>
</author>
<published>2016-05-18T19:01:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c244d3d033b42fd719c4f6aba0c9d3bdd969c425'/>
<id>urn:sha1:c244d3d033b42fd719c4f6aba0c9d3bdd969c425</id>
<content type='text'>
commit 708e75a3ee750dce1072134e630d66c4e6eaf63c upstream.

If kvmppc_handle_exit_pr() calls kvmppc_emulate_instruction() to emulate
one instruction (in the BOOK3S_INTERRUPT_H_EMUL_ASSIST case), it calls
kvmppc_core_queue_program() afterwards if kvmppc_emulate_instruction()
returned EMULATE_FAIL, so the guest gets an program interrupt for the
illegal opcode.
However, the kvmppc_emulate_instruction() also tried to inject a
program exception for this already, so the program interrupt gets
injected twice and the return address in srr0 gets destroyed.
All other callers of kvmppc_emulate_instruction() are also injecting
a program interrupt, and since the callers have the right knowledge
about the srr1 flags that should be used, it is the function
kvmppc_emulate_instruction() that should _not_ inject program
interrupts, so remove the kvmppc_core_queue_program() here.

This fixes the issue discovered by Laurent Vivier with kvm-unit-tests
where the logs are filled with these messages when the test tries
to execute an illegal instruction:

     Couldn't emulate instruction 0x00000000 (op 0 xop 0)
     kvmppc_handle_exit_pr: emulation at 700 failed (00000000)

Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Reviewed-by: Alexander Graf &lt;agraf@suse.de&gt;
Tested-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Cc: Sumit Semwal &lt;sumit.semwal@linaro.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>KVM: PPC: Book3s PR: Allow access to unprivileged MMCR2 register</title>
<updated>2016-10-17T07:46:19Z</updated>
<author>
<name>Thomas Huth</name>
</author>
<published>2016-09-21T13:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=50b5e30e8111f88029dd0f6e922251f1839a1044'/>
<id>urn:sha1:50b5e30e8111f88029dd0f6e922251f1839a1044</id>
<content type='text'>
commit fa73c3b25bd8d0d393dc6109a1dba3c2aef0451e upstream.

The MMCR2 register is available twice, one time with number 785
(privileged access), and one time with number 769 (unprivileged,
but it can be disabled completely). In former times, the Linux
kernel was using the unprivileged register 769 only, but since
commit 8dd75ccb571f3c92c ("powerpc: Use privileged SPR number
for MMCR2"), it uses the privileged register 785 instead.
The KVM-PR code then of course also switched to use the SPR 785,
but this is causing older guest kernels to crash, since these
kernels still access 769 instead. So to support older kernels
with KVM-PR again, we have to support register 769 in KVM-PR, too.

Fixes: 8dd75ccb571f3c92c48014b3dabd3d51a115ab41
Signed-off-by: Thomas Huth &lt;thuth@redhat.com&gt;
Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>KVM: PPC: Book3S PR: Emulate TIR register</title>
<updated>2016-10-17T07:35:09Z</updated>
<author>
<name>Alexander Graf</name>
</author>
<published>2014-04-25T14:07:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cf28bd0ce8c6f14374c8747bbcb73f1d0afd6d91'/>
<id>urn:sha1:cf28bd0ce8c6f14374c8747bbcb73f1d0afd6d91</id>
<content type='text'>
commit a5948fa092a04dfd6b9ee31c99eb6896c158eb08 upstream.

In parallel to the Processor ID Register (PIR) threaded POWER8 also adds a
Thread ID Register (TIR). Since PR KVM doesn't emulate more than one thread
per core, we can just always expose 0 here.

Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: Book3S PR: Ignore PMU SPRs</title>
<updated>2016-10-17T07:34:18Z</updated>
<author>
<name>Alexander Graf</name>
</author>
<published>2014-04-22T10:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3bf7e13f8efaddeb67174fe66537a2eab35544a2'/>
<id>urn:sha1:3bf7e13f8efaddeb67174fe66537a2eab35544a2</id>
<content type='text'>
commit f8f6eb0d189cf2724af5ebc8cad460c78fb1994e upstream.

When we expose a POWER8 CPU into the guest, it will start accessing PMU SPRs
that we don't emulate. Just ignore accesses to them.

Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR</title>
<updated>2016-01-25T14:15:40Z</updated>
<author>
<name>Paul Mackerras</name>
</author>
<published>2015-11-12T05:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=32b1c9d19dbe74b98e572745bbd2452d6a1b6b09'/>
<id>urn:sha1:32b1c9d19dbe74b98e572745bbd2452d6a1b6b09</id>
<content type='text'>
commit c20875a3e638e4a03e099b343ec798edd1af5cc6 upstream.

Currently it is possible for userspace (e.g. QEMU) to set a value
for the MSR for a guest VCPU which has both of the TS bits set,
which is an illegal combination.  The result of this is that when
we execute a hrfid (hypervisor return from interrupt doubleword)
instruction to enter the guest, the CPU will take a TM Bad Thing
type of program interrupt (vector 0x700).

Now, if PR KVM is configured in the kernel along with HV KVM, we
actually handle this without crashing the host or giving hypervisor
privilege to the guest; instead what happens is that we deliver a
program interrupt to the guest, with SRR0 reflecting the address
of the hrfid instruction and SRR1 containing the MSR value at that
point.  If PR KVM is not configured in the kernel, then we try to
run the host's program interrupt handler with the MMU set to the
guest context, which almost certainly causes a host crash.

This closes the hole by making kvmppc_set_msr_hv() check for the
illegal combination and force the TS field to a safe value (00,
meaning non-transactional).

Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;

</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: Fix KVM hang with CONFIG_KVM_XICS=n</title>
<updated>2014-07-02T10:05:55Z</updated>
<author>
<name>Anton Blanchard</name>
</author>
<published>2014-03-24T23:47:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a6f23e021eee3de3100cd93d065393cfd1e81d98'/>
<id>urn:sha1:a6f23e021eee3de3100cd93d065393cfd1e81d98</id>
<content type='text'>
commit 7505258c5fcb0a1cc3c76a47b4cf9506d21d10e6 upstream.

I noticed KVM is broken when KVM in-kernel XICS emulation
(CONFIG_KVM_XICS) is disabled.

The problem was introduced in 48eaef05 (KVM: PPC: Book3S HV: use
xics_wake_cpu only when defined). It used CONFIG_KVM_XICS to wrap
xics_wake_cpu, where CONFIG_PPC_ICP_NATIVE should have been
used.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Paul Mackerras &lt;paulus@samba.org&gt;
Acked-by: Scott Wood &lt;scottwood@freescale.com&gt;
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: e500: Fix bad address type in deliver_tlb_misss()</title>
<updated>2014-02-06T19:22:21Z</updated>
<author>
<name>Mihai Caraman</name>
</author>
<published>2014-01-09T15:01:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee1c2e62dc47f69e5b4b18b1af33851c9491e0c7'/>
<id>urn:sha1:ee1c2e62dc47f69e5b4b18b1af33851c9491e0c7</id>
<content type='text'>
commit 70713fe315ed14cd1bb07d1a7f33e973d136ae3d upstream.

Use gva_t instead of unsigned int for eaddr in deliver_tlb_miss().

Signed-off-by: Mihai Caraman &lt;mihai.caraman@freescale.com&gt;
Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: use xics_wake_cpu only when defined</title>
<updated>2014-02-06T19:22:21Z</updated>
<author>
<name>Andreas Schwab</name>
</author>
<published>2013-12-30T14:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=de0bb60dd19845d14f7d63f640c4b77c2d079c58'/>
<id>urn:sha1:de0bb60dd19845d14f7d63f640c4b77c2d079c58</id>
<content type='text'>
commit 48eaef0518a565d3852e301c860e1af6a6db5a84 upstream.

Signed-off-by: Andreas Schwab &lt;schwab@linux-m68k.org&gt;
Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>powerpc: kvm: fix rare but potential deadlock scene</title>
<updated>2014-01-09T20:25:07Z</updated>
<author>
<name>pingfan liu</name>
</author>
<published>2013-11-15T08:35:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d18b5a0e75f4447ecaac27c81add306617f9e34f'/>
<id>urn:sha1:d18b5a0e75f4447ecaac27c81add306617f9e34f</id>
<content type='text'>
commit 91648ec09c1ef69c4d840ab6dab391bfb452d554 upstream.

Since kvmppc_hv_find_lock_hpte() is called from both virtmode and
realmode, so it can trigger the deadlock.

Suppose the following scene:

Two physical cpuM, cpuN, two VM instances A, B, each VM has a group of
vcpus.

If on cpuM, vcpu_A_1 holds bitlock X (HPTE_V_HVLOCK), then is switched
out, and on cpuN, vcpu_A_2 try to lock X in realmode, then cpuN will be
caught in realmode for a long time.

What makes things even worse if the following happens,
  On cpuM, bitlockX is hold, on cpuN, Y is hold.
  vcpu_B_2 try to lock Y on cpuM in realmode
  vcpu_A_2 try to lock X on cpuN in realmode

Oops! deadlock happens

Signed-off-by: Liu Ping Fan &lt;pingfank@linux.vnet.ibm.com&gt;
Reviewed-by: Paul Mackerras &lt;paulus@samba.org&gt;
Signed-off-by: Alexander Graf &lt;agraf@suse.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>kvm: ppc: booke: check range page invalidation progress on page setup</title>
<updated>2013-10-10T09:40:08Z</updated>
<author>
<name>Bharat Bhushan</name>
</author>
<published>2013-08-07T10:03:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40fde70d0df993d1a652d6cc69f8b4e967656170'/>
<id>urn:sha1:40fde70d0df993d1a652d6cc69f8b4e967656170</id>
<content type='text'>
When the MM code is invalidating a range of pages, it calls the KVM
kvm_mmu_notifier_invalidate_range_start() notifier function, which calls
kvm_unmap_hva_range(), which arranges to flush all the TLBs for guest pages.
However, the Linux PTEs for the range being flushed are still valid at
that point.  We are not supposed to establish any new references to pages
in the range until the ...range_end() notifier gets called.
The PPC-specific KVM code doesn't get any explicit notification of that;
instead, we are supposed to use mmu_notifier_retry() to test whether we
are or have been inside a range flush notifier pair while we have been
referencing a page.

This patch calls the mmu_notifier_retry() while mapping the guest
page to ensure we are not referencing a page when in range invalidation.

This call is inside a region locked with kvm-&gt;mmu_lock, which is the
same lock that is called by the KVM MMU notifier functions, thus
ensuring that no new notification can proceed while we are in the
locked region.

Signed-off-by: Bharat Bhushan &lt;bharat.bhushan@freescale.com&gt;
Acked-by: Alexander Graf &lt;agraf@suse.de&gt;
[Backported to 3.12 - Paolo]
Reviewed-by: Bharat Bhushan &lt;bharat.bhushan@freescale.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
