From patchwork Thu May 26 10:30:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 820352 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 p4QAUprc003758 for ; Thu, 26 May 2011 10:30:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757444Ab1EZKaq (ORCPT ); Thu, 26 May 2011 06:30:46 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:34139 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757407Ab1EZKam (ORCPT ); Thu, 26 May 2011 06:30:42 -0400 Received: by mail-wy0-f174.google.com with SMTP id 21so381431wya.19 for ; Thu, 26 May 2011 03:30:42 -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=V6VYX45ZFivOoH6ffNLvNvNr7rYBTvyO4aN5G6yM/5A=; b=Xxf7LN4N8EG3UuqoCmrzxrL9OvkSwUbjl3rINu1ODxLOukJcwlnKLrQKDnqS3nFvUl qQeua0ZYqfOTry/M9jPIt85cBwGLJr7hVUcLslPgc29DuENUoOBl+6ZH0ecFG+zN8Tq7 iACB/I4qa5ebJsgRa6nGbz5LO25d2Kme6Ncos= 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=ZCgSM/oKtxoB9r8Zs9C1NBjYA7qqRoCzP6Jswp1/yR9Ih3CZD6PiymdOJwGbqX0D1L SAfNLzsokLuzoM8S+ZVwxNh9m2xrz+/vI7WE1TWGjn6aPDMo6OmtTV4vvBn6/s0fBRaf bdqSx249MXPUYPCmY2EyEv5wrM6btDk7MsksI= Received: by 10.216.237.136 with SMTP id y8mr646202weq.76.1306405841897; Thu, 26 May 2011 03:30:41 -0700 (PDT) Received: from localhost.localdomain ([109.66.201.145]) by mx.google.com with ESMTPS id et5sm365858wbb.33.2011.05.26.03.30.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 26 May 2011 03:30:41 -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 v3 5/8] kvm tools: Use dynamic IO port allocation in vesa driver Date: Thu, 26 May 2011 13:30:08 +0300 Message-Id: <1306405811-4482-5-git-send-email-levinsasha928@gmail.com> X-Mailer: git-send-email 1.7.5.rc3 In-Reply-To: <1306405811-4482-1-git-send-email-levinsasha928@gmail.com> References: <1306405811-4482-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]); Thu, 26 May 2011 10:30:51 +0000 (UTC) Signed-off-by: Sasha Levin --- tools/kvm/hw/vesa.c | 7 +++---- tools/kvm/include/kvm/ioport.h | 2 -- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/kvm/hw/vesa.c b/tools/kvm/hw/vesa.c index ec4788c..85fe1a9 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,17 +65,17 @@ 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__register(IOPORT_EMPTY, &vesa_io_ops, IOPORT_SIZE, NULL); + 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, NULL); - kvm__register_mmio(VESA_MEM_ADDR, VESA_MEM_SIZE, &vesa_mmio_callback); pthread_create(&thread, NULL, vesa__dovnc, kvm); diff --git a/tools/kvm/include/kvm/ioport.h b/tools/kvm/include/kvm/ioport.h index 55d53e0..84eb65a 100644 --- a/tools/kvm/include/kvm/ioport.h +++ b/tools/kvm/include/kvm/ioport.h @@ -12,8 +12,6 @@ #define IOPORT_START 0x6200 #define IOPORT_SIZE 0x400 -#define IOPORT_VESA 0xa200 -#define IOPORT_VESA_SIZE 256 #define IOPORT_VIRTIO_P9 0xb200 /* Virtio 9P device */ #define IOPORT_VIRTIO_P9_SIZE 256 #define IOPORT_VIRTIO_CONSOLE 0xd200 /* Virtio console device */