Thread (5 messages) flat view 5 messages, 3 authors, 2014-08-11

Re: [PATCH] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core

From: Alexander Graf <hidden>
Date: 2014-08-11 23:53:56
Also in: kvm

Am 12.08.2014 um 01:36 schrieb Scott Wood [off-list ref]:
=20
quoted
On Wed, 2014-08-06 at 19:33 +0300, Mihai Caraman wrote:
@@ -390,19 +400,30 @@ static void kvmppc_core_vcpu_free_e500mc(struct kvm=
_vcpu *vcpu)
quoted
=20
static int kvmppc_core_init_vm_e500mc(struct kvm *kvm)
{
-    int lpid;
+    int i, lpid;
=20
-    lpid =3D kvmppc_alloc_lpid();
-    if (lpid < 0)
-        return lpid;
+    /* The lpid pool supports only 2 entries now */
+    if (threads_per_core > 2)
+        return -ENOMEM;
+
+    /* Each VM allocates one LPID per HW thread index */
+    for (i =3D 0; i < threads_per_core; i++) {
+        lpid =3D kvmppc_alloc_lpid();
+        if (lpid < 0)
+            return lpid;
+
+        kvm->arch.lpid_pool[i] =3D lpid;
+    }
=20
Wouldn't it be simpler to halve the size of the lpid pool that the
allocator sees, and just OR in the high bit based on the low bit of the
cpu number?
Heh, I wrote the same and then removed the section from my reply again. It w=
ouldn't really make that much of a difference if you think it through comple=
tely.

But yes, it certainly would be quite a bit more natural. I'm ok either way.


Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help