qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] s390/migration: Provide a cpu save for init


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH 1/3] s390/migration: Provide a cpu save for initial life migration work
Date: Wed, 21 Nov 2012 16:08:58 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121028 Thunderbird/16.0.2

On 21/11/12 16:06, Alexander Graf wrote:
[...]
>>>>>> +static int cpu_post_load(void *opaque, int version_id)
>>>>>> +{
>>>>>> +    CPUS390XState *env = opaque;
>>>>>> +    struct kvm_fpu fpu;
>>>>>> +    int i, r;
>>>>>> +
>>>>>> +    if (!kvm_enabled()) {
>>>>>> +        return 0;
>>>>>> +    }
>>>>>> +
>>>>>> +    for (i = 0; i<    16; i++) {
>>>>>> +        fpu.fprs[i] = env->fregs[i].ll;
>>>>>> +    }
>>>>>> +    fpu.fpc = env->fpc;
>>>>>> +
>>>>>> +    r = kvm_vcpu_ioctl(env, KVM_SET_FPU,&fpu);
>>>>>> +    assert(r == 0);
>>>>>> +
>>>>>> +    return 0;
>>>>>> +}
>>>>> The kvm register sync needs to happen in the kvm register sync function :)
>>>> That would eliminate the whole purpose of sync regs and forces us to have 
>>>> an
>>>> expensive ioctl on lots of exits (again). I would prefer to sync the 
>>>> registers
>>>> that we never need in qemu just here.
>>> That's why the register sync has different stages.
>> Not the get_register. Which is called on every synchronize_state. Which 
>> happen quite often
>> on s390.
> 
> Sounds like bad design then :).
> 
> Maybe we should explicitly tell the register synchronization which register 
> sets to sync, so that we don't waste time getting _all_ the state every time 
> we sync registers?

Yes, a level statement for kvm_arch_get_registers would be good.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]