From patchwork Sun Oct 11 18:59:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 35720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 67F25B7B7E for ; Mon, 12 Oct 2009 06:02:52 +1100 (EST) Received: from localhost ([127.0.0.1]:36377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mx3gv-0007jz-T2 for incoming@patchwork.ozlabs.org; Sun, 11 Oct 2009 15:02:49 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mx3dU-0006SY-Pq for qemu-devel@nongnu.org; Sun, 11 Oct 2009 14:59:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mx3dP-0006Qy-4s for qemu-devel@nongnu.org; Sun, 11 Oct 2009 14:59:15 -0400 Received: from [199.232.76.173] (port=57415 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mx3dO-0006Qf-V1 for qemu-devel@nongnu.org; Sun, 11 Oct 2009 14:59:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28463) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mx3dO-0000lt-D4 for qemu-devel@nongnu.org; Sun, 11 Oct 2009 14:59:10 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9BIx9IY031827; Sun, 11 Oct 2009 14:59:09 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9BIx72D009923; Sun, 11 Oct 2009 14:59:08 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 2113A18D415; Sun, 11 Oct 2009 20:59:07 +0200 (IST) From: Gleb Natapov To: kevin@koconnor.net Date: Sun, 11 Oct 2009 20:59:05 +0200 Message-Id: <1255287547-28329-3-git-send-email-gleb@redhat.com> In-Reply-To: <1255287547-28329-1-git-send-email-gleb@redhat.com> References: <1255287547-28329-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 3/5] Use the correct mask to size the PCI option ROM BAR. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Bit 0 is the enable bit, which we not only don't want to set, but it will stick and make us think it's an I/O port resource. Qemu pcbios commit 6ddb9f5c742b2b82b1755d7ec2a127f6e20e3806 Signed-off-by: Gleb Natapov --- src/pciinit.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pciinit.c b/src/pciinit.c index 1d0f784..29b3901 100644 --- a/src/pciinit.c +++ b/src/pciinit.c @@ -139,11 +139,13 @@ static void pci_bios_init_device(u16 bdf) int ofs; u32 val, size; - if (i == PCI_ROM_SLOT) + if (i == PCI_ROM_SLOT) { ofs = PCI_ROM_ADDRESS; - else + pci_config_writel(bdf, ofs, 0xfffffffe); + } else { ofs = PCI_BASE_ADDRESS_0 + i * 4; - pci_config_writel(bdf, ofs, 0xffffffff); + pci_config_writel(bdf, ofs, 0xffffffff); + } val = pci_config_readl(bdf, ofs); if (val != 0) { size = (~(val & ~0xf)) + 1;