From patchwork Sat May 7 14:55:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrill Gorcunov X-Patchwork-Id: 764452 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 p47Eumtp002004 for ; Sat, 7 May 2011 14:56:48 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755492Ab1EGO4q (ORCPT ); Sat, 7 May 2011 10:56:46 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:59900 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755452Ab1EGO4m (ORCPT ); Sat, 7 May 2011 10:56:42 -0400 Received: by ewy4 with SMTP id 4so1213676ewy.19 for ; Sat, 07 May 2011 07:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:user-agent:date:from:to:cc:subject :references:content-disposition; bh=cm7eMCJ/5j7jm5vlFTpl4yp6HGGhWipQ3pdsgNeB9fY=; b=Ue6fr8PrYEYTjEh1KqkNfxjlZ4x97kqMD1qN5QNqRWhrq/WW2DmYIVjqZgnKBy+Xpw XkPM+k3XFzDvISDjDH8gJX0F1n1XcfsfdqkP+ZyQCuan4/FGOyHDdbQAllGgzh/wT+ds /xCGFpw8JSXqljeGKo40v1dmm4L4dw2tUezBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:user-agent:date:from:to:cc:subject:references :content-disposition; b=Z2HFJqrhl9sgUBHkxLCvwbL6Q6MxkP9Ws0xVeJ+noOx80RzUoPj/XUdScC/0qFTFq+ EvsVctSS4CXKQDkgGTKCcVVXgo2ykN60eCWLmWitLAKZ99EZMwkJOyU8jfn53Nf9Vdtx Jv7wzJdg+he3j5SGPlMSV999FgHyuc6D/Jr5s= Received: by 10.213.14.140 with SMTP id g12mr331019eba.16.1304780201396; Sat, 07 May 2011 07:56:41 -0700 (PDT) Received: from gorcunov (95-26-151-249.broadband.corbina.ru [95.26.151.249]) by mx.google.com with ESMTPS id y44sm2133333eey.12.2011.05.07.07.56.38 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 May 2011 07:56:39 -0700 (PDT) Received: by gorcunov (Postfix, from userid 1000) id BCF279E; Sat, 7 May 2011 18:56:36 +0400 (MSD) Message-Id: <20110507145636.384301162@gmail.com> User-Agent: quilt/0.47-1 Date: Sat, 07 May 2011 18:55:16 +0400 From: Cyrill Gorcunov To: penberg@kernel.org, mingo@elte.hu Cc: levinsasha928@gmail.com, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, Cyrill Gorcunov Subject: [patch 2/2] kvm tools: mptable -- Fix up srcbusirq assignment for PCI devices References: <20110507145514.476517775@gmail.com> Content-Disposition: inline; filename=kvm-tools-fix-srcbusirq 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]); Sat, 07 May 2011 14:56:48 +0000 (UTC) The kernel expects srcbusirq follows MP specification and consists a tuple of PCI device number with pin encoded. Make it so, otherwise the kernel reports kind of "buggy MP table" found. Signed-off-by: Cyrill Gorcunov --- tools/kvm/mptable.c | 10 +++++++--- 1 file changed, 7 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 Index: linux-2.6.git/tools/kvm/mptable.c ===================================================================== --- linux-2.6.git.orig/tools/kvm/mptable.c +++ linux-2.6.git/tools/kvm/mptable.c @@ -191,12 +191,16 @@ void mptable_setup(struct kvm *kvm, unsi for (pci_tree = irq__get_pci_tree(); pci_tree; pci_tree = rb_next(pci_tree)) { struct pci_dev *dev = rb_entry(pci_tree, struct pci_dev, node); - struct irq_line *tmp; + struct irq_line *irq_line; + + list_for_each_entry(irq_line, &dev->lines, node) { + unsigned char srcbusirq; + + srcbusirq = (dev->id << 2) | (dev->pin - 1); - list_for_each_entry(tmp, &dev->lines, node) { mpc_intsrc = last_addr; - mptable_add_irq_src(mpc_intsrc, pcibusid, dev->pin, ioapicid, tmp->line); + mptable_add_irq_src(mpc_intsrc, pcibusid, dev->pin, ioapicid, irq_line->line); last_addr = (void *)&mpc_intsrc[1]; nentries++; }