[0/3] Support userspace irqchip with arch timers
diff mbox

Message ID de375a6e-095c-a17a-0db7-876a5619df42@suse.de
State New
Headers show

Commit Message

Alexander Graf Sept. 30, 2016, 2:54 p.m. UTC
On 27.09.16 21:08, Christoffer Dall wrote:
> Hi Alex,
> 
> Marc and I have been looking at this during Linaro connect and have
> slightly reworked your patch into this small series.
> 
> It would be good if you could have a look at it and test it out.
> 
> I've tested it with your QEMU, and it works for UP, but secondary CPUs
> fail to come up, and it looks like the kernel never gets an IPI for
> those CPUs from userspace.  Any chance you're willing to take a look at
> that?

I still need to see whether I can come up with a prettier solution, but
for now this works:



Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Alexander Graf Sept. 30, 2016, 3:38 p.m. UTC | #1
On 30.09.16 16:54, Alexander Graf wrote:
> 
> 
> On 27.09.16 21:08, Christoffer Dall wrote:
>> Hi Alex,
>>
>> Marc and I have been looking at this during Linaro connect and have
>> slightly reworked your patch into this small series.
>>
>> It would be good if you could have a look at it and test it out.
>>
>> I've tested it with your QEMU, and it works for UP, but secondary CPUs
>> fail to come up, and it looks like the kernel never gets an IPI for
>> those CPUs from userspace.  Any chance you're willing to take a look at
>> that?
> 
> I still need to see whether I can come up with a prettier solution, but
> for now this works:
> 
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c

Eh, no, not in i386 code :). But the problem seems to be a missing
mpstate sync.


Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Christoffer Dall Sept. 30, 2016, 3:43 p.m. UTC | #2
On Fri, Sep 30, 2016 at 05:38:11PM +0200, Alexander Graf wrote:
> 
> 
> On 30.09.16 16:54, Alexander Graf wrote:
> > 
> > 
> > On 27.09.16 21:08, Christoffer Dall wrote:
> >> Hi Alex,
> >>
> >> Marc and I have been looking at this during Linaro connect and have
> >> slightly reworked your patch into this small series.
> >>
> >> It would be good if you could have a look at it and test it out.
> >>
> >> I've tested it with your QEMU, and it works for UP, but secondary CPUs
> >> fail to come up, and it looks like the kernel never gets an IPI for
> >> those CPUs from userspace.  Any chance you're willing to take a look at
> >> that?
> > 
> > I still need to see whether I can come up with a prettier solution, but
> > for now this works:
> > 
> > diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> 
> Eh, no, not in i386 code :). But the problem seems to be a missing
> mpstate sync.
> 
Yeah, that looked really dodgy.  Have you tested it? :)

-Christoffer
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf Sept. 30, 2016, 3:55 p.m. UTC | #3
On 30.09.16 17:43, Christoffer Dall wrote:
> On Fri, Sep 30, 2016 at 05:38:11PM +0200, Alexander Graf wrote:
>>
>>
>> On 30.09.16 16:54, Alexander Graf wrote:
>>>
>>>
>>> On 27.09.16 21:08, Christoffer Dall wrote:
>>>> Hi Alex,
>>>>
>>>> Marc and I have been looking at this during Linaro connect and have
>>>> slightly reworked your patch into this small series.
>>>>
>>>> It would be good if you could have a look at it and test it out.
>>>>
>>>> I've tested it with your QEMU, and it works for UP, but secondary CPUs
>>>> fail to come up, and it looks like the kernel never gets an IPI for
>>>> those CPUs from userspace.  Any chance you're willing to take a look at
>>>> that?
>>>
>>> I still need to see whether I can come up with a prettier solution, but
>>> for now this works:
>>>
>>> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
>>
>> Eh, no, not in i386 code :). But the problem seems to be a missing
>> mpstate sync.
>>
> Yeah, that looked really dodgy.  Have you tested it? :)

I have, but I ran the wrong command line and by accident used -M
...,kernel-irqchip=on :)


Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index f1ad805..8b9a084 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -2393,7 +2393,11 @@  static int kvm_get_mp_state(X86CPU *cpu)
         return ret;
     }
     env->mp_state = mp_state.mp_state;
+#ifdef CONFIG_ARM
+    if (kvm_enabled()) {
+#else
     if (kvm_irqchip_in_kernel()) {
+#endif
         cs->halted = (mp_state.mp_state == KVM_MP_STATE_HALTED);
     }
     return 0;