Because zero sizing then 'over allocating' the struct on intel lets
you save space on svm, same extends obviously for other architectures
in future.

- Paul

On 6/25/07, Jun Koi <[EMAIL PROTECTED]> wrote:
> On 6/26/07, Avi Kivity <[EMAIL PROTECTED]> wrote:
> > Paul Turner wrote:
> > > From: Paul Turner <[EMAIL PROTECTED]>
> > >
> > > This just separates vmx/svm specific fields off kvm_vcpu into
> > > kvm_vmx_data and kvm_svm_data fields respectively.  Ideally these
> > > should be compiled out depending on target architecture, at least the
> > > waste is organized now. I didn't notice any svm specific fields,
> > > however I've included the empty struct for completeness, let me know
> > > if I've missed anything and I'll refresh.
> > >
> >
> > This is much needed; thanks.
> >
> > > p.s. let me know if pine mangles this email/the patch at all, I did a
> > > test mail to myself and it seemed to come out ok :)
> > >
> >
> > There are many spaces-instead-of-tabs violations.
> >
> > >
> > > +
> > >  struct kvm_vcpu {
> > >      struct kvm *kvm;
> > >      union {
> >
> > This union holds vmx/svm specific members that can be moved into the new
> > structures.
> >
> > > +
> > > +       union {
> > > +           struct kvm_vmx_data vmx;
> > > +            struct kvm_svm_data svm;
> > > +       };
> > >  };
> > >
> >
> > If you make this
> >
> > +       union {
> > +           struct kvm_vmx_data vmx[1];
> > +            struct kvm_svm_data svm[1];
> > +       };
> >
> > then we can later change it to a zero-sized array with variable-size
> > allocation, with no additional code changes.
> >
>
> Why do we want to make it array? I suppose that we only have 1 struct
> (either vmx or svm) for each vcpu, no?
>
>
> Thanks,
> Jun
>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to