[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 0/7] KVM SMP support, early version
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] Re: [PATCH 0/7] KVM SMP support, early version |
Date: |
Tue, 01 Dec 2009 13:33:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Glauber Costa wrote:
> On Tue, Dec 1, 2009 at 10:17 AM, Jan Kiszka <address@hidden> wrote:
>> Avi Kivity wrote:
>>> On 11/30/2009 07:30 PM, Jan Kiszka wrote:
>>>>>> No. But what's wrong with on_vcpu?
>>>>>>
>>>>> intrinsically racy. signal passing slow down things, etc.
>>>>>
>>>>> That said, as I've stated many times: I don't believe there's anything
>>>>> fundamentally wrong with on_vcpu. But we might get benefits from a
>>>>> re-design
>>>>> of things to avoid it whenever possible. (just like the vcpu_reset()
>>>>> I've just posted)
>>>>>
>>>>>
>>>> If you don't want immediate execution of update_guest_debug, save the
>>>> state that shall be transferred, set some flag, and run the transfer
>>>> before guest entry inside the vcpu threads (after putting the registers
>>>> as older kernels may otherwise overwrite the flags register). Should
>>>> work, may even avoid redundant calls during a gdb session.
>>>>
>>> There's no guarantee the vcpu will ever exit to qemu, so you have to
>>> signal the vcpu thread anyway. When you do that, you might as well load
>>> the new state.
>> Debugging is special here as it involves vmstop before you start playing
>> with the debug settings. But I may also oversee some corner case right now.
>>
>
> I imagined so. In this case, it might be better to set a flag before
> vmstop, and then
> honor it on vcpu entry. I had this feeling that in most cases where we
> current signal the
> vcpu, the VM will be already stopped anyway, so we don't need to resignal.
>
Do not set the flag before the machine stop, otherwise you risk to race
with vcpus that exit and re-enter briefly before that. This manipulation
should really be done under vmstop protection.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux