From patchwork Wed May 25 14:23:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 816402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4PEQLvr002945 for ; Wed, 25 May 2011 14:26:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755385Ab1EYOZ7 (ORCPT ); Wed, 25 May 2011 10:25:59 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:34776 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754817Ab1EYOZ5 (ORCPT ); Wed, 25 May 2011 10:25:57 -0400 Received: by wya21 with SMTP id 21so5813720wya.19 for ; Wed, 25 May 2011 07:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=uI273wACNhUGZSmRJL+zojUsec01AzVtPR+USF4CZSo=; b=TtvavD2NOmPY1EnUMdzrlVllHc6chVg89RTvqkh0oKrqNsy5922zXLHPOM91c1ZqiV zT4OG/0/bOUtR6JXwxy6Soizmg3J94vdRbnNIewUWST8o98tOBzYEytBMC7hMv7wmYtt GJFOBzZisDfCxj28hfpS593pV4PVpID7cQVSI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=aHu1NHbr3yvlrqFfIvh+e98aLk3tuHPOMh3rSmIDgG8EyM48SoRcgSHpgM3adHlsCR b2rRXk9hAR2RVaHfuoMJzcG/+UWh3eIEqwlRC5d+IYs7wdeULMHa3JqBrHdBok0Vr/bz qFZYSWsomXfUQt685TE8DcLIfadA8MsEfDGoU= Received: by 10.227.199.21 with SMTP id eq21mr4690227wbb.101.1306333469611; Wed, 25 May 2011 07:24:29 -0700 (PDT) Received: from localhost.localdomain (bzq-109-66-201-145.red.bezeqint.net [109.66.201.145]) by mx.google.com with ESMTPS id m21sm404829wbh.25.2011.05.25.07.24.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 May 2011 07:24:29 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: john@jfloren.net, kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, Sasha Levin Subject: [PATCH 5/9] kvm tools: Use dynamic IO port allocation in vesa driver Date: Wed, 25 May 2011 17:23:43 +0300 Message-Id: <1306333427-26186-5-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 In-Reply-To: <1306333427-26186-1-git-send-email-levinsasha928@gmail.com> References: <1306333427-26186-1-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 25 May 2011 14:26:21 +0000 (UTC) Signed-off-by: Sasha Levin --- tools/kvm/hw/vesa.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c index 6ab07ee..eb3ee65 100644 --- a/tools/kvm/hw/vesa.c +++ b/tools/kvm/hw/vesa.c @@ -49,7 +49,6 @@ static struct pci_device_header vesa_pci_device = { .class = 0x030000, .subsys_vendor_id = PCI_SUBSYSTEM_VENDOR_ID_REDHAT_QUMRANET, .subsys_id = PCI_SUBSYSTEM_ID_VESA, - .bar[0] = IOPORT_VESA | PCI_BASE_ADDRESS_SPACE_IO, .bar[1] = VESA_MEM_ADDR | PCI_BASE_ADDRESS_SPACE_MEMORY, }; @@ -66,16 +65,18 @@ void vesa__init(struct kvm *kvm) { u8 dev, line, pin; pthread_t thread; + u16 vesa_base_addr; if (irq__register_device(PCI_DEVICE_ID_VESA, &dev, &pin, &line) < 0) return; vesa_pci_device.irq_pin = pin; vesa_pci_device.irq_line = line; - + vesa_base_addr = ioport__find_free_range(); + vesa_pci_device.bar[0] = vesa_base_addr | PCI_BASE_ADDRESS_SPACE_IO; pci__register(&vesa_pci_device, dev); - ioport__register(IOPORT_VESA, &vesa_io_ops, IOPORT_VESA_SIZE); + ioport__register(vesa_base_addr, &vesa_io_ops, IOPORT_SIZE); kvm__register_mmio(VESA_MEM_ADDR, VESA_MEM_SIZE, &vesa_mmio_callback);