From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: Re: [PATCH 2/4] kvm tools: Fix PCI probing Date: Thu, 28 Jul 2011 13:38:27 +0400 Message-ID: <20110728093826.GJ27137@sun> References: <1311843715-5464-1-git-send-email-levinsasha928@gmail.com> <1311843715-5464-2-git-send-email-levinsasha928@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Sasha Levin , kvm@vger.kernel.org, mingo@elte.hu, asias.hejun@gmail.com, prasadjoshi124@gmail.com To: Pekka Enberg Return-path: Received: from mail-ey0-f171.google.com ([209.85.215.171]:38452 "EHLO mail-ey0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755332Ab1G1Jia (ORCPT ); Thu, 28 Jul 2011 05:38:30 -0400 Received: by eye22 with SMTP id 22so2604841eye.2 for ; Thu, 28 Jul 2011 02:38:29 -0700 (PDT) Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jul 28, 2011 at 12:31:51PM +0300, Pekka Enberg wrote: > On Thu, Jul 28, 2011 at 12:01 PM, Sasha Levin wrote: > > PCI BAR probing is done in four steps: > > > > =A01. Read address (and flags). > > =A02. Mask BAR. > > =A03. Read BAR again - Now the expected result is the size of the B= AR. > > =A04. Mask BAR with address. > > > > So far, we have only took care of the first step. This means that t= he kernel > > was using address as the size, causing a PCI allocation blunder. > > > > This patch fixes the issue by passing a proper size after masking. > > > > Signed-off-by: Sasha Levin > > --- > > =A0tools/kvm/include/kvm/pci.h | =A0 =A01 + > > =A0tools/kvm/pci.c =A0 =A0 =A0 =A0 =A0 =A0 | =A0 57 +++++++++++++++= ++++++++++++++++++++++++---- > > =A02 files changed, 53 insertions(+), 5 deletions(-) > > > > diff --git a/tools/kvm/include/kvm/pci.h b/tools/kvm/include/kvm/pc= i.h > > index 6ad4426..a7532e3 100644 > > --- a/tools/kvm/include/kvm/pci.h > > +++ b/tools/kvm/include/kvm/pci.h > > @@ -51,5 +51,6 @@ struct pci_device_header { > > > > =A0void pci__init(void); > > =A0void pci__register(struct pci_device_header *dev, u8 dev_num); > > +u32 pci_get_io_space_block(void); >=20 > s/pci_get_io_space_block/pci__get_io_space_block/ >=20 Pekka, can we drop this idea with double underscopes? iirc perf is abou= t to drop them too.