Re: [PATCH 0 of 3] create kvm_x86

Hollis Blanchard
2007-11-30T21:09:16Z

On Fri, 2007-11-30 at 22:31 +0200, Avi Kivity wrote:
> Hollis Blanchard wrote:
> > On Fri, 2007-11-30 at 11:04 +0200, Avi Kivity wrote:
> >
> >> Zhang, Xiantao wrote:
> >>
> >>>>>
> >>>>>
> >>>> The nicer one:
> >>>>
> >>>> struct kvm {
> >>>> struct kvm_arch arch;
> >>>> // common fields
> >>>> }
> >>>>
> >>>>
> >>> I prefer this one, seems it is more direct and readable. Same thinking
> >>> about kvm_vcpu structure:)
> >>>
> >>>
> >> I agree, kvm_vcpu should use the same method.
> >>
> >
> > And we will convert vcpu_vmx/vcpu_svm as well?
> >
> >
>
> These cannot use the same method, since we need to support both vmx and
> svm in the same binary. The arch specific members aren't the same size,
> nor do the symbols they use have the same visibility.

I have never understood this. Why on earth do you need to support VMX
and SVM in the same binary? For example, when would you overwrite
kvm_x86_ops after initialization? If you wouldn't, then why are you
using function pointers instead of the linker?

PowerPC will also need to support multiple processor types, and so I
expect to have one kvm_arch structure for each. That also means struct
kvm_arch must be the *last* member in struct kvm, which is not how it is
shown above.

--
Hollis Blanchard
IBM Linux Technology Center