From patchwork Sat Oct 14 03:01:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dexuan Cui X-Patchwork-Id: 10006169 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F01CB60360 for ; Sat, 14 Oct 2017 03:01:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED52B291A2 for ; Sat, 14 Oct 2017 03:01:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1761291A6; Sat, 14 Oct 2017 03:01:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E1FD291A2 for ; Sat, 14 Oct 2017 03:01:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753532AbdJNDBs (ORCPT ); Fri, 13 Oct 2017 23:01:48 -0400 Received: from mail-pu1apc01on0136.outbound.protection.outlook.com ([104.47.126.136]:63712 "EHLO APC01-PU1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753528AbdJNDBr (ORCPT ); Fri, 13 Oct 2017 23:01:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=CgkinAAPOf7ZjHffqOqaneRhqkFOGrzzIXAfIrMNjCA=; b=F3o/XfLuW4+wFDX4V35wLTXJjaHOaCReRma+6KyQCRsENH6StWWUr1Ie/GBt+OkCKpdf02r0QAQUqj7YbfHNf/3EWuMYrBKHDtQOZ83f7kWTJWT7AzVaGcQdI/cHi4xhyLYwdb1acFd4p2DTQDd55CTFdc8bOUrMp0mrseYrPtA= Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM (10.170.167.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.156.3; Sat, 14 Oct 2017 03:01:34 +0000 Received: from KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) by KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM ([10.170.167.17]) with mapi id 15.20.0156.003; Sat, 14 Oct 2017 03:01:22 +0000 From: Dexuan Cui To: Bjorn Helgaas , Thomas Gleixner , KY Srinivasan , Stephen Hemminger , "linux-pci@vger.kernel.org" CC: "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" , Josh Poulson , Haiyang Zhang , Simon Xiao , Saeed Mahameed , "Mihai Costache (Cloudbase Solutions SRL)" , Jork Loeser Subject: [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode Thread-Topic: [PATCH] PCI: hv: fix "spurious APIC interrupt" due to new vector reservation mode Thread-Index: AdNElnAVNmAqnPUhSSK45mkq9WSZFw== Date: Sat, 14 Oct 2017 03:01:22 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Ref=https://api.informationprotection.azure.com/api/72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=decui@microsoft.com; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2017-10-13T20:01:18.9698274-07:00; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic; Sensitivity=General authentication-results: spf=none (sender IP is ) smtp.mailfrom=decui@microsoft.com; x-originating-ip: [2001:4898:80e8:4::144] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; KL1P15301MB0006; 6:GWOTbhS3iMf0D8dyYySJCZFGI2Uc7AOwvR6qBmg1huSwnEjOubKnwuaYSXFzcDc7PKo8ZYrO+UShxNr0zDxbz3A7w/JAg0KGzViDnZ/NbNvLIg90SEXKpW+o1sMJnm6H17M2znCUWoz6k4RCYFn/CZvN7Pv8PxqEQwEchz5lqxCZ19Nc5zbb/QBkq3ieEdIj2FOmZN/D59/KDMQZRhCdX8rs5ARIN2d6WfCkr2slJHPZaEobGr/k/gqFiup8F80hkko4lTgeH1abWrGLaqeCL7iITkCFksXzE6cD3uduChhzarl1PE+NBuPXf471pLlrjWP/ptxG6xJCUMsppjU6wQ==; 5:/oBsXBPyi5Axl+mwKqcsWvby/OyTlmB7h2FpjrmEyWp4iRI5wezbBf4TwT9V3iU6kJ9bzWdx8mKPyl/lc1w2UbyD198gpOocoCy8DFSeP2YbrAhB2yVvWVQkps4zy3TBc86q447z5QmydEXyOj4w0u+XUWlFp5dz4uzqM6iMsZA=; 24:iulZ6K9r/agq5QaiXtGblSBPEpuK3w/sZZw3meKzma/10st0fYXjEnBa/dxMotG6HJUOVZh1Etmuz0diKj9bp24RoASWaoqU33o0SDqXKCE=; 7:kAh6u2W2nVnmLPMqHpCUBJdvMyW5aKU1VMMBst0PlVWCdIHmzNskPh2UUaBSFg8eKep/vw2yShWPBPB0mQyGBepczLgQht94ShX6l9oBNoPu/jHWL873GUFJLBRL7wBmDyNOVfbvT4HELEDoNBofj8q8xsndM9+HfqQjJNs/tq93754W0w4nGZGJfbi6sxops072Ei3mYZkCYril98lmtKDD99nL3jPq7QPZhHvGLxk= x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(6009001)(346002)(376002)(39860400002)(47760400005)(199003)(189002)(8990500004)(6436002)(68736007)(77096006)(2561002)(1511001)(8676002)(55016002)(81166006)(189998001)(4326008)(8936002)(2501003)(54356999)(81156014)(6506006)(53936002)(101416001)(50986999)(33656002)(107886003)(6116002)(2421001)(575784001)(34040400001)(7736002)(74316002)(105586002)(106356001)(9686003)(7696004)(86362001)(102836003)(86612001)(97736004)(3660700001)(305945005)(2900100001)(10290500003)(478600001)(5660300001)(54906003)(22452003)(3280700002)(14454004)(316002)(2906002)(10090500001)(110136005)(25786009); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1P15301MB0006; H:KL1P15301MB0006.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; x-ms-office365-filtering-correlation-id: 9303d8a5-4f0b-4266-4686-08d512afda0d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:KL1P15301MB0006; x-ms-traffictypediagnostic: KL1P15301MB0006: x-exchange-antispam-report-test: UriScan:(89211679590171)(211936372134217)(153496737603132); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(61425038)(6040450)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(920507026)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1P15301MB0006; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1P15301MB0006; x-forefront-prvs: 046060344D received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9303d8a5-4f0b-4266-4686-08d512afda0d X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2017 03:01:22.3508 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1P15301MB0006 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Last month the vector management code was reworked, and as a result of the changes, e.g. commit 22d0b12f3560 ("genirq/irqdomain: Add force reactivation flag to irq domains"), commit 4900be83602b ("x86/vector/msi: Switch to global reservation mode") etc, now we must add this new flag MSI_FLAG_MUST_REACTIVATE when calling pci_msi_create_irq_domain() on x86, otherwise Hyper-V PCIe pass-through can't work, and we get: "spurious APIC interrupt through vector ff on CPU#0, should never happen", this is because no valid MSI/MSI-X vector is allocated. Signed-off-by: Dexuan Cui Cc: Thomas Gleixner Cc: Bjorn Helgaas Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Stephen Hemminger --- Currently the "reservation mode" patchset has not been in Linus's tree yet, so today's mainline hasn't shown the issue, but today's linux-next has shown the issue (PCIe pass-through on Hyper-V can't work). I think any caller of pci_msi_create_irq_domain() that runs on x86 needs to be updated, but besides pci-hyper I'm not sure which callers run on x86. drivers/pci/host/pci-hyperv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c index 0fe3ea1..35a7683 100644 --- a/drivers/pci/host/pci-hyperv.c +++ b/drivers/pci/host/pci-hyperv.c @@ -1196,7 +1196,8 @@ static int hv_pcie_init_irq_domain(struct hv_pcibus_device *hbus) hbus->msi_info.ops = &hv_msi_ops; hbus->msi_info.flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | MSI_FLAG_MULTI_PCI_MSI | - MSI_FLAG_PCI_MSIX); + MSI_FLAG_PCI_MSIX | + MSI_FLAG_MUST_REACTIVATE); hbus->msi_info.handler = handle_edge_irq; hbus->msi_info.handler_name = "edge"; hbus->msi_info.data = hbus;