From patchwork Wed May 6 15:48:56 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 22067 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n46FmuWL012388 for ; Wed, 6 May 2009 15:48:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758394AbZEFPsw (ORCPT ); Wed, 6 May 2009 11:48:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759216AbZEFPsw (ORCPT ); Wed, 6 May 2009 11:48:52 -0400 Received: from g1t0027.austin.hp.com ([15.216.28.34]:2407 "EHLO g1t0027.austin.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759113AbZEFPsv (ORCPT ); Wed, 6 May 2009 11:48:51 -0400 Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g1t0027.austin.hp.com (Postfix) with ESMTP id D25EB3841C; Wed, 6 May 2009 15:48:51 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0038.austin.hp.com (Postfix) with ESMTP id B67833005D; Wed, 6 May 2009 15:48:51 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 67E0139C017; Wed, 6 May 2009 09:48:51 -0600 (MDT) X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2Ts-UmMltFbM; Wed, 6 May 2009 09:48:51 -0600 (MDT) Received: from dl380g6-3.ned.telco.ned.telco (lart.fc.hp.com [15.11.146.31]) by ldl.fc.hp.com (Postfix) with ESMTP id A029E39C007; Wed, 6 May 2009 09:48:50 -0600 (MDT) From: Alex Williamson Subject: [PATCH 1/2] kvm: bios: Use a different mask to size the option ROM BAR To: kvm@vger.kernel.org, sheng@linux.intel.com Cc: alex.williamson@hp.com Date: Wed, 06 May 2009 09:48:56 -0600 Message-ID: <20090506154856.17937.41849.stgit@dl380g6-3.ned.telco.ned.telco> In-Reply-To: <20090506154850.17937.95258.stgit@dl380g6-3.ned.telco.ned.telco> References: <20090506154850.17937.95258.stgit@dl380g6-3.ned.telco.ned.telco> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.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. Signed-off-by: Alex Williamson --- kvm/bios/rombios32.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/kvm/bios/rombios32.c b/kvm/bios/rombios32.c index 8684987..6502e63 100755 --- a/kvm/bios/rombios32.c +++ b/kvm/bios/rombios32.c @@ -958,11 +958,13 @@ static void pci_bios_init_device(PCIDevice *d) int ofs; uint32_t val, size ; - if (i == PCI_ROM_SLOT) + if (i == PCI_ROM_SLOT) { ofs = 0x30; - else + pci_config_writel(d, ofs, 0xfffffffe); + } else { ofs = 0x10 + i * 4; - pci_config_writel(d, ofs, 0xffffffff); + pci_config_writel(d, ofs, 0xffffffff); + } val = pci_config_readl(d, ofs); if (val != 0) { size = (~(val & ~0xf)) + 1;