qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Jens Freimann <jfrei@linux.vnet.ibm.com>,
	Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
	"Jason J. herne" <jjherne@us.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/3] s390/migration: Provide a cpu save for initial life migration work
Date: Wed, 21 Nov 2012 16:27:34 +0100	[thread overview]
Message-ID: <50ACF2E6.8000304@de.ibm.com> (raw)
In-Reply-To: <50ACF1B1.6050904@siemens.com>

On 21/11/12 16:22, Jan Kiszka wrote:
> On 2012-11-21 16:08, Christian Borntraeger wrote:
>> 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.
>>
> 
> The challenge is defining those levels generically - as it is also
> generic code that calls cpu_synchronize_state. What levels do you have
> in mind? And where would they be applied?

I think that RUNTIME_STATE and FULL_STATE would be sufficient for the needs
that I have. The registers that I need during runtime can be accessed quite
fast, but for life migration I also need those registers that are accessed
via ONE_REG or other ioctls.

Christian

  reply	other threads:[~2012-11-21 15:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21 14:46 [Qemu-devel] [RFC/PATCH 0/3] Initial migration patches for s390 Christian Borntraeger
2012-11-21 14:46 ` [Qemu-devel] [PATCH 1/3] s390/migration: Provide a cpu save for initial life migration work Christian Borntraeger
2012-11-21 14:56   ` Alexander Graf
2012-11-21 14:59     ` Christian Borntraeger
2012-11-21 15:02       ` Alexander Graf
2012-11-21 15:03         ` Christian Borntraeger
2012-11-21 15:06           ` Alexander Graf
2012-11-21 15:08             ` Christian Borntraeger
2012-11-21 15:22               ` Jan Kiszka
2012-11-21 15:27                 ` Christian Borntraeger [this message]
2012-11-21 15:32                   ` Jan Kiszka
2012-11-21 14:46 ` [Qemu-devel] [PATCH 2/3] s390/migration: Qemu S390 special register migration Christian Borntraeger
2012-11-21 14:57   ` Alexander Graf
2012-11-21 14:46 ` [Qemu-devel] [PATCH 3/3] s390/migration: Add code to support SCLP live migration Christian Borntraeger
2012-11-21 14:58   ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50ACF2E6.8000304@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=graalfs@linux.vnet.ibm.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=jjherne@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).