<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/arch/powerpc/kvm/powerpc.c, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/arch/powerpc/kvm/powerpc.c?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/arch/powerpc/kvm/powerpc.c?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-05-19T13:10:42Z</updated>
<entry>
<title>Merge branch 'topic/ppc-kvm' into next</title>
<updated>2022-05-19T13:10:42Z</updated>
<author>
<name>Michael Ellerman</name>
<email>mpe@ellerman.id.au</email>
</author>
<published>2022-05-19T13:10:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b104e41cda1ef9c5e851a7de3f30b53535e7d528'/>
<id>urn:sha1:b104e41cda1ef9c5e851a7de3f30b53535e7d528</id>
<content type='text'>
Merge our KVM topic branch.
</content>
</entry>
<entry>
<title>KVM: PPC: Book3S HV: Use IDA allocator for LPID allocator</title>
<updated>2022-05-13T11:33:33Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2022-01-23T12:00:40Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=6ba2a2924dcf6026de5078ba7025248a580d8bde'/>
<id>urn:sha1:6ba2a2924dcf6026de5078ba7025248a580d8bde</id>
<content type='text'>
This removes the fixed-size lpid_inuse array.

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Reviewed-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220123120043.3586018-4-npiggin@gmail.com

</content>
</entry>
<entry>
<title>KVM: PPC: Remove kvmppc_claim_lpid</title>
<updated>2022-05-13T11:33:33Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2022-01-23T12:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=18827eeef022df43c1fdeca0fde00ca09405dff1'/>
<id>urn:sha1:18827eeef022df43c1fdeca0fde00ca09405dff1</id>
<content type='text'>
Removing kvmppc_claim_lpid makes the lpid allocator API a bit simpler to
change the underlying implementation in a future patch.

The host LPID is always 0, so that can be a detail of the allocator. If
the allocator range is restricted, that can reserve LPIDs at the top of
the range. This allows kvmppc_claim_lpid to be removed.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220123120043.3586018-2-npiggin@gmail.com

</content>
</entry>
<entry>
<title>powerpc: Add missing headers</title>
<updated>2022-05-08T12:15:40Z</updated>
<author>
<name>Christophe Leroy</name>
<email>christophe.leroy@csgroup.eu</email>
</author>
<published>2022-03-08T19:20:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=e6f6390ab7b9d649c13de2c8a591bce61a10ec3b'/>
<id>urn:sha1:e6f6390ab7b9d649c13de2c8a591bce61a10ec3b</id>
<content type='text'>
Don't inherit headers "by chances" from asm/prom.h, asm/mpc52xx.h,
asm/pci.h etc...

Include the needed headers, and remove asm/prom.h when it was
needed exclusively for pulling necessary headers.

Signed-off-by: Christophe Leroy &lt;christophe.leroy@csgroup.eu&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/be8bdc934d152a7d8ee8d1a840d5596e2f7d85e0.1646767214.git.christophe.leroy@csgroup.eu

</content>
</entry>
<entry>
<title>KVM: Add helpers to wrap vcpu-&gt;srcu_idx and yell if it's abused</title>
<updated>2022-04-21T17:16:11Z</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-04-15T00:43:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=2031f2876896d82aca7e82f84accd9181b9587fb'/>
<id>urn:sha1:2031f2876896d82aca7e82f84accd9181b9587fb</id>
<content type='text'>
Add wrappers to acquire/release KVM's SRCU lock when stashing the index
in vcpu-&gt;src_idx, along with rudimentary detection of illegal usage,
e.g. re-acquiring SRCU and thus overwriting vcpu-&gt;src_idx.  Because the
SRCU index is (currently) either 0 or 1, illegal nesting bugs can go
unnoticed for quite some time and only cause problems when the nested
lock happens to get a different index.

Wrap the WARNs in PROVE_RCU=y, and make them ONCE, otherwise KVM will
likely yell so loudly that it will bring the kernel to its knees.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Tested-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Message-Id: &lt;20220415004343.2203171-4-seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: Use KVM_CAP_PPC_AIL_MODE_3</title>
<updated>2022-03-08T02:14:01Z</updated>
<author>
<name>Nicholas Piggin</name>
<email>npiggin@gmail.com</email>
</author>
<published>2022-03-07T02:26:25Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f771b55731fc82b1e8e9ef123f6f1b8d8c92bc63'/>
<id>urn:sha1:f771b55731fc82b1e8e9ef123f6f1b8d8c92bc63</id>
<content type='text'>
Use KVM_CAP_PPC_AIL_MODE_3 to advertise the capability to set the AIL
resource mode to 3 with the H_SET_MODE hypercall. This capability
differs between processor types and KVM types (PR, HV, Nested HV), and
affects guest-visible behaviour.

QEMU will implement a cap-ail-mode-3 to control this behaviour[1], and
use the KVM CAP if available to determine KVM support[2].

[1] https://lists.nongnu.org/archive/html/qemu-ppc/2022-02/msg00437.html
[2] https://lists.nongnu.org/archive/html/qemu-ppc/2022-02/msg00439.html

Signed-off-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Reviewed-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
[mpe: Rebase onto 93b71801a827 from kvm-ppc-cap-210 branch, add EXPORT_SYMBOL]
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220222064727.2314380-4-npiggin@gmail.com

</content>
</entry>
<entry>
<title>KVM: PPC: Decrement module refcount if init_vm fails</title>
<updated>2022-02-03T05:50:44Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@linux.ibm.com</email>
</author>
<published>2022-01-25T15:57:35Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=4feb74aa64b35b21a4937f96d7a940adee286e5b'/>
<id>urn:sha1:4feb74aa64b35b21a4937f96d7a940adee286e5b</id>
<content type='text'>
We increment the reference count for KVM-HV/PR before the call to
kvmppc_core_init_vm. If that function fails we need to decrement the
refcount.

Also remove the check on kvm_ops-&gt;owner because try_module_get can
handle a NULL module.

Signed-off-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Reviewed-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220125155735.1018683-5-farosas@linux.ibm.com

</content>
</entry>
<entry>
<title>KVM: PPC: Merge powerpc's debugfs entry content into generic entry</title>
<updated>2022-02-02T09:30:26Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
<email>aik@ozlabs.ru</email>
</author>
<published>2022-01-11T00:54:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=faf01aef0570757bfbf1d655e984742c1dd38068'/>
<id>urn:sha1:faf01aef0570757bfbf1d655e984742c1dd38068</id>
<content type='text'>
At the moment KVM on PPC creates 4 types of entries under the kvm debugfs:
1) "%pid-%fd" per a KVM instance (for all platforms);
2) "vm%pid" (for PPC Book3s HV KVM);
3) "vm%u_vcpu%u_timing" (for PPC Book3e KVM);
4) "kvm-xive-%p" (for XIVE PPC Book3s KVM, the same for XICS);

The problem with this is that multiple VMs per process is not allowed for
2) and 3) which makes it possible for userspace to trigger errors when
creating duplicated debugfs entries.

This merges all these into 1).

This defines kvm_arch_create_kvm_debugfs() similar to
kvm_arch_create_vcpu_debugfs().

This defines 2 hooks in kvmppc_ops that allow specific KVM implementations
add necessary entries, this adds the _e500 suffix to
kvmppc_create_vcpu_debugfs_e500() to make it clear what platform it is for.

This makes use of already existing kvm_arch_create_vcpu_debugfs() on PPC.

This removes no more used debugfs_dir pointers from PPC kvm_arch structs.

This stops removing vcpu entries as once created vcpus stay around
for the entire life of a VM and removed when the KVM instance is closed,
see commit d56f5136b010 ("KVM: let kvm_destroy_vm_debugfs clean up vCPU
debugfs directories").

Suggested-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: Cédric Le Goater &lt;clg@kaod.org&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220111005404.162219-1-aik@ozlabs.ru

</content>
</entry>
<entry>
<title>KVM: PPC: Book3s: mmio: Deliver DSI after emulation failure</title>
<updated>2022-01-31T02:43:00Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@linux.ibm.com</email>
</author>
<published>2022-01-25T21:56:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c1c8a66367a35aabbad9bd629b105b9fb49f2c1f'/>
<id>urn:sha1:c1c8a66367a35aabbad9bd629b105b9fb49f2c1f</id>
<content type='text'>
MMIO emulation can fail if the guest uses an instruction that we are
not prepared to emulate. Since these instructions can be and most
likely are valid ones, this is (slightly) closer to an access fault
than to an illegal instruction, so deliver a Data Storage interrupt
instead of a Program interrupt.

BookE ignores bad faults, so it will keep using a Program interrupt
because a DSI would cause a fault loop in the guest.

Suggested-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Reviewed-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220125215655.1026224-6-farosas@linux.ibm.com

</content>
</entry>
<entry>
<title>KVM: PPC: mmio: Return to guest after emulation failure</title>
<updated>2022-01-31T02:43:00Z</updated>
<author>
<name>Fabiano Rosas</name>
<email>farosas@linux.ibm.com</email>
</author>
<published>2022-01-25T21:56:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=349fbfe9b918e6dea00734f07c0fbaf4c2e2df5e'/>
<id>urn:sha1:349fbfe9b918e6dea00734f07c0fbaf4c2e2df5e</id>
<content type='text'>
If MMIO emulation fails we don't want to crash the whole guest by
returning to userspace.

The original commit bbf45ba57eae ("KVM: ppc: PowerPC 440 KVM
implementation") added a todo:

  /* XXX Deliver Program interrupt to guest. */

and later the commit d69614a295ae ("KVM: PPC: Separate loadstore
emulation from priv emulation") added the Program interrupt injection
but in another file, so I'm assuming it was missed that this block
needed to be altered.

Also change the message to a ratelimited one since we're letting the
guest run and it could flood the host logs.

Signed-off-by: Fabiano Rosas &lt;farosas@linux.ibm.com&gt;
Reviewed-by: Nicholas Piggin &lt;npiggin@gmail.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Link: https://lore.kernel.org/r/20220125215655.1026224-5-farosas@linux.ibm.com

</content>
</entry>
</feed>
