From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hollis Blanchard Subject: Re: RFC/patch 2/3 portability: move x86 emulation and mmio device hook to x86.c Date: Tue, 30 Oct 2007 13:12:39 -0500 Message-ID: <1193767959.26183.26.camel@basalt> References: <1193763784.7800.17.camel@cotte.boeblingen.de.ibm.com> <1193766261.7800.45.camel@cotte.boeblingen.de.ibm.com> Reply-To: Hollis Blanchard Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: "kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" , "Zhang, Xiantao" , Avi Kivity To: Carsten Otte Return-path: In-Reply-To: <1193766261.7800.45.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 On Tue, 2007-10-30 at 18:44 +0100, Carsten Otte wrote: > > -/* > - * Only apic need an MMIO device hook, so shortcut now.. > - */ > -static struct kvm_io_device *vcpu_find_pervcpu_dev(struct kvm_vcpu *vcpu, > - gpa_t addr) > -{ > - struct kvm_io_device *dev; > - > - if (vcpu->apic) { > - dev = &vcpu->apic->dev; > - if (dev->in_range(dev, addr)) > - return dev; > - } > - return NULL; > -} > - > -static struct kvm_io_device *vcpu_find_mmio_dev(struct kvm_vcpu *vcpu, > - gpa_t addr) > -{ > - struct kvm_io_device *dev; > - > - dev = vcpu_find_pervcpu_dev(vcpu, addr); > - if (dev == NULL) > - dev = kvm_io_bus_find_dev(&vcpu->kvm->mmio_bus, addr); > - return dev; > -} > - > static struct kvm_io_device *vcpu_find_pio_dev(struct kvm_vcpu *vcpu, > gpa_t addr) > { > return kvm_io_bus_find_dev(&vcpu->kvm->pio_bus, addr); > } These are APIC-specific for now, but as the "shortcut" comment implies they should be generalized in the future, and I expect they will be useful for PowerPC. I'm fine with the patch as-is; I just want to point out that future work will be needed in this area. Acked-by: Hollis Blanchard -- Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- 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/