On Thu, 2007-07-26 at 16:37 +0300, Avi Kivity wrote:
> Gregory Haskins wrote:
> > On Thu, 2007-07-26 at 15:33 +0300, Avi Kivity wrote:
> >
> >   
> >> The suggestion I liked best (Anthony's) was
> >>
> >>   struct vmx_vcpu {
> >>         struct kvm_vcpu vcpu;
> >>         void *vmcs;
> >>         // other vmx-specific data
> >>    };
> >>
> >> to move from a kvm_vcpu to a vmx_vcpu, you use container_of() (inside 
> >> your vmx() inline).  Look ma, no pointers!
> >>     
> >
> > Hmm..well, you still have pointers.  The advantage is that they are
> > implicitly maintained, but now you have to do pointer arithmetic to
> > compute it. :(  I personally would probably rather have the explicit
> > management code than the run-time overhead....
> >   
> 
> Well, the pointer arithmetic consists of adding or subtracting zero, 
> which gcc luckily knows how to deal with.

Ah....i see.  The trick is that we make it the first field.  Clever!

> 
> It's the equivalent of C++ inheritance; no overhead at all.

You mean non-virtuals, right ;)


> 
> Paul Turner did something much like yours, 

Ah, wasn't aware, thanks.  What is the status?  I guess I came this far,
so I will make the final change and you can take it or leave it at your
discretion.  The important thing is to get this cleaned up more than who
did it, IMO.

> and Rusty is working on 
> unraveling the vcpu array, which is complementary to this work.

I saw Rusty's email.  Cool!




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to