From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH] KVM: add support for AMD nested live migration
Date: Wed, 1 Jul 2020 17:49:37 +0100 [thread overview]
Message-ID: <20200701164937.GH3608@work-vm> (raw)
In-Reply-To: <CABgObfZjrBe+87Lhyw_Zyyuyun3VBpHa1RuzovmvthrU-Ea-pQ@mail.gmail.com>
* Paolo Bonzini (pbonzini@redhat.com) wrote:
> Il mer 1 lug 2020, 18:28 Dr. David Alan Gilbert <dgilbert@redhat.com> ha
> scritto:
>
> >
> > > + return (nested_state->format == KVM_STATE_NESTED_FORMAT_SVM &&
> > > + nested_state->size > offsetof(struct kvm_nested_state,
> > data));
> >
> > How does this nested_state->size work? It looks like even if it's 1 byte
> > into 'data' we transmit a whole KVM_STATE_NESTED_SVM_VMCB_SIZE.
> >
>
> The format is documented as having either 0 or KVM_STATE_NESTED_SVM_VMCB_SIZE
> bytes (for vmx instead it can be 0, 4K or 8K).
OK.
Dave
> Paolo
>
>
> > Dave
> >
> > > +}
> > > +
> > > +static const VMStateDescription vmstate_svm_nested_state = {
> > > + .name = "cpu/kvm_nested_state/svm",
> > > + .version_id = 1,
> > > + .minimum_version_id = 1,
> > > + .needed = svm_nested_state_needed,
> > > + .fields = (VMStateField[]) {
> > > + VMSTATE_U64(hdr.svm.vmcb_pa, struct kvm_nested_state),
> > > + VMSTATE_UINT8_ARRAY(data.svm[0].vmcb12,
> > > + struct kvm_nested_state,
> > > + KVM_STATE_NESTED_SVM_VMCB_SIZE),
> > > + VMSTATE_END_OF_LIST()
> > > + }
> > > +};
> > > +
> > > static bool nested_state_needed(void *opaque)
> > > {
> > > X86CPU *cpu = opaque;
> > > CPUX86State *env = &cpu->env;
> > >
> > > return (env->nested_state &&
> > > - vmx_nested_state_needed(env->nested_state));
> > > + (vmx_nested_state_needed(env->nested_state) ||
> > > + svm_nested_state_needed(env->nested_state)));
> > > }
> > >
> > > static int nested_state_post_load(void *opaque, int version_id)
> > > @@ -1139,6 +1166,7 @@ static const VMStateDescription
> > vmstate_kvm_nested_state = {
> > > },
> > > .subsections = (const VMStateDescription*[]) {
> > > &vmstate_vmx_nested_state,
> > > + &vmstate_svm_nested_state,
> > > NULL
> > > }
> > > };
> > > --
> > > 2.26.2
> > >
> > --
> > Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
> >
> >
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
prev parent reply other threads:[~2020-07-01 16:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 16:06 [PATCH] KVM: add support for AMD nested live migration Paolo Bonzini
2020-07-01 16:28 ` Dr. David Alan Gilbert
2020-07-01 16:39 ` Paolo Bonzini
2020-07-01 16:49 ` Dr. David Alan Gilbert [this message]
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=20200701164937.GH3608@work-vm \
--to=dgilbert@redhat.com \
--cc=pbonzini@redhat.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).