From patchwork Fri Nov 21 22:08:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 5358311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1A89AC11AC for ; Fri, 21 Nov 2014 22:09:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 473EE2022A for ; Fri, 21 Nov 2014 22:09:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54B232021F for ; Fri, 21 Nov 2014 22:09:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752667AbaKUWIx (ORCPT ); Fri, 21 Nov 2014 17:08:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41670 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750948AbaKUWIv (ORCPT ); Fri, 21 Nov 2014 17:08:51 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sALM8ejM031705 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 21 Nov 2014 17:08:40 -0500 Received: from gimli.home (ovpn-113-201.phx2.redhat.com [10.3.113.201]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sALM8eon016381; Fri, 21 Nov 2014 17:08:40 -0500 From: Alex Williamson Subject: [PATCH 2/3] PCI/x86: Add arch_supports_multivector_msi() hook To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, joro@8bytes.org, iommu@lists.linux-foundation.org Date: Fri, 21 Nov 2014 15:08:40 -0700 Message-ID: <20141121220839.31095.64245.stgit@gimli.home> In-Reply-To: <20141121213752.31095.30735.stgit@gimli.home> References: <20141121213752.31095.30735.stgit@gimli.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP x86 does support multivector MSI, but only when using interrupt remapping. Extend x86_msi_ops to add an optional callback for this and assume unsupported when not present. Signed-off-by: Alex Williamson --- arch/x86/include/asm/x86_init.h | 1 + arch/x86/kernel/x86_init.c | 6 ++++++ drivers/iommu/irq_remapping.c | 6 ++++++ 3 files changed, 13 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" 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/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h index e45e4da..28951c6 100644 --- a/arch/x86/include/asm/x86_init.h +++ b/arch/x86/include/asm/x86_init.h @@ -185,6 +185,7 @@ struct x86_msi_ops { int (*setup_hpet_msi)(unsigned int irq, unsigned int id); u32 (*msi_mask_irq)(struct msi_desc *desc, u32 mask, u32 flag); u32 (*msix_mask_irq)(struct msi_desc *desc, u32 flag); + bool (*supports_multivector)(struct pci_dev *dev); }; struct IO_APIC_route_entry; diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index e48b674..d917410 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c @@ -148,6 +148,12 @@ u32 arch_msix_mask_irq(struct msi_desc *desc, u32 flag) { return x86_msi.msix_mask_irq(desc, flag); } +bool arch_supports_multivector_msi(struct pci_dev *dev) +{ + if (x86_msi.supports_multivector) + return x86_msi.supports_multivector(dev); + return false; +} #endif struct x86_io_apic_ops x86_io_apic_ops = { diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 74a1767..4310bfb 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -160,6 +160,11 @@ static void eoi_ioapic_pin_remapped(int apic, int pin, int vector) io_apic_eoi(apic, pin); } +static bool remapped_supports_multivector(struct pci_dev *dev) +{ + return true; +} + static void __init irq_remapping_modify_x86_ops(void) { x86_io_apic_ops.disable = irq_remapping_disable_io_apic; @@ -169,6 +174,7 @@ static void __init irq_remapping_modify_x86_ops(void) x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; x86_msi.compose_msi_msg = compose_remapped_msi_msg; + x86_msi.supports_multivector = remapped_supports_multivector; } static __init int setup_nointremap(char *str)