From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [patch] cleanup struct kvm_vcpu control registers Date: Wed, 08 Aug 2007 17:25:20 +0300 Message-ID: <46B9D250.9020906@qumranet.com> References: <1186575977.7019.11.camel@cotte.boeblingen.de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" , Christian Borntraeger To: Carsten Otte Return-path: In-Reply-To: <1186575977.7019.11.camel-WIxn4w2hgUz3YA32ykw5MLlKpX0K8NHHQQ4Iyu8u01E@public.gmane.org> 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 Carsten Otte wrote: > The patch below removes individual control register definitions from > struct kvm_vcpu and replaces them with an array similar to general > purpose registers. > When splitting kvm_vcpu in architecture dependent and architecture > independent parts, this will allow to keep the control registers in the > architecture independent struct even if we have different control > registers on different architectures. > This is tested on svm, unfortunately I don't have a vmx capable machine > at hand. > I don't think we should aim for keeping control registers in an arch independent manner, since there is nothing common among the different architectures in that area. For x86, keeping them in an array is not helpful since the individual control registers have nothing to do with each other. Also, for most things like the fpu and segment registers this trick won't work. I suggest keeping them in an arch dependent structure (struct kvm_vcpu_arch) in . We can then access them through a member as vcpu->arch.cr0, etc. ------------------------------------------------------------------------- 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/