Avi Kivity wrote: > Zhang, Xiantao wrote: >> Avi Kivity wrote: >> >>> Christian Ehrhardt wrote: >>> >>>> Hi Xiantao, >>>> it looks good to me to move kvm_vcpu_cache out to the x86 specific >>>> code >>>> >>> Why is that? Do other archs not want kvm_vcpu_cache, or is it just >>> the alignment? >>> >> At lease we didn't fall across the similar requirements about such >> alignment issues in IA64. >> > > What I mean is, other archs do require kvm_vcpu_cache (without the > alignment), so why move the code? Just make the alignment arch > dependent with a #define.
I think IA64 TOTALLY doen't need this logic, so do the move:) > Oh, and since the code is written as > >> - /* A kmem cache lets us meet the alignment requirements of >> fx_save. */ >> - kvm_vcpu_cache = kmem_cache_create("kvm_vcpu", vcpu_size, >> - __alignof__(struct kvm_vcpu), >> - 0, NULL); >> - if (!kvm_vcpu_cache) { > > If other archs don't require special alignment for kvm_vcpu, > __alignof__(struct kvm_vcpu) will return the natural alignment for > that arch, and no memory will be wasted. We use a very different method to allocate kvm_vcpu memory in IA64 side. So we have to set vcpu_size to zero. But if vcpu_size is set to zero, kmem_cache_create returns error, and this logic can't handle this error. Finally, make the kvm_init aborted. Otherwise, it wastes memory. ------------------------------------------------------------------------- SF.Net email is sponsored by: The Future of Linux Business White Paper from Novell. From the desktop to the data center, Linux is going mainstream. Let it simplify your IT future. http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel