From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] Separate vmx/svm fields from kvm_vcpu Date: Mon, 25 Jun 2007 17:00:32 -0400 Message-ID: <46802CF0.6090100@qumranet.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Paul Turner Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Paul Turner wrote: > From: Paul Turner > > 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. ------------------------------------------------------------------------- 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/