From nobody Wed May 1 05:04:46 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linutronix.de ARC-Seal: i=1; a=rsa-sha256; t=1612967412; cv=none; d=zohomail.com; s=zohoarc; b=SX/kW6WzAJR0F2ESLyxgA1IFzE7HSSq5vZaQGTy6Rvwt0shF7OQsBR2021hMTBGtZkWtuP8ZV1CfaNwPTaHltAvJNArrElpNY4v9eg0seE4BgfgyzfjLoPZwEthWuITkVV62GuU05bqbBkTSHABML0jF4OZwE7XtE3iq/KmQvos= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612967412; h=Content-Type:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=Mcmrh40B4VXMR0jisEUU+cJGgnUcEN2FqgSKv/zts9E=; b=beRWeAli5Wrc3PXZV8UpQxnyj3Ppxsh9A9nkhtdaCoR+9Sy32Q0uQhXWEnQzyJOuJ6QFBRu3xaIQk8NohQ3qfU3T19Xv2o9VzT6zyPZnGK6bwjvQNnyFSpIr+nX05bXdKNqw2q2PkPXCGjeB6bcvLhdXjsI6nX3OW4weYt08/zQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 16129674123041021.0532889497358; Wed, 10 Feb 2021 06:30:12 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.83622.156066 (Exim 4.92) (envelope-from ) id 1l9qV4-0003Bk-0h; Wed, 10 Feb 2021 14:29:50 +0000 Received: by outflank-mailman (output) from mailman id 83622.156066; Wed, 10 Feb 2021 14:29:49 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l9qV3-0003Bd-Tf; Wed, 10 Feb 2021 14:29:49 +0000 Received: by outflank-mailman (input) for mailman id 83622; Wed, 10 Feb 2021 14:29:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1l9qV2-0003BW-9Y for xen-devel@lists.xenproject.org; Wed, 10 Feb 2021 14:29:48 +0000 Received: from galois.linutronix.de (unknown [2a0a:51c0:0:12e:550::1]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a9157564-3bfb-41fa-922f-11244f485e6d; Wed, 10 Feb 2021 14:29:47 +0000 (UTC) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: a9157564-3bfb-41fa-922f-11244f485e6d From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1612967386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Mcmrh40B4VXMR0jisEUU+cJGgnUcEN2FqgSKv/zts9E=; b=srlefx8a2kD8X/vmt4ioMIIxZZglHMRpj9VCzFN/sZPpXWWRXtpaDBFK7eWAhleW0djea+ YEUrV/RvdNehfZL4K0XqkoIlp2saO19yN5Lb2+wnANLFHq8C5OH7CqomeG5YoJWrAurfBH 3+bvaKz55Y7gzeoeMrAyk+im74WyP2QOTaotf9vnCpqAYX2boLeRqe/sdbw1GqSnrgmfpm ZeP3ZLO2X55/PxcAfxMWPwV3UuQEazJxBiL3EaVmGWNyRluCNzWVtbiFHpbYbnMnYyPMQG 6qNtZLIr8v6CneWg5VStMIs9F0AuJhdZLzM8D11lZeM9Dga1yPkPLbtO7zDomQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1612967386; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type; bh=Mcmrh40B4VXMR0jisEUU+cJGgnUcEN2FqgSKv/zts9E=; b=EFO99bDjKUzkHNQTvugRYUNwQ8vOsXhGSENrxZIiNx7Y6K2/Pa2PR0WHFm501Blt1FDvOH cuS/REXCk4AFX7AQ== To: lkml@nanos.tec.linutronix.de Cc: Juergen Gross ,x86@kernel.org,Bjorn Helgaas ,xen-devel@lists.xenproject.org Subject: [PATCH] x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init() Date: Wed, 10 Feb 2021 15:29:44 +0100 Message-ID: <87sg64dmhz.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 X-ZohoMail-DKIM: pass (identity @linutronix.de) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoking x86_init.irqs.create_pci_msi_domain() before x86_init.pci.arch_init() breaks XEN PV. The XEN_PV specific pci.arch_init() function overrides the default create_pci_msi_domain() which is obviously too late. As a consequence the XEN PV PCI/MSI allocation goes through the native path which runs out of vectors and causes malfunction. Invoke it after x86_init.pci.arch_init(). Fixes: 6b15ffa07dc3 ("x86/irq: Initialize PCI/MSI domain at PCI init time") Reported-by: Juergen Gross Signed-off-by: Thomas Gleixner Tested-by: Juergen Gross Cc: stable@vger.kernel.org --- arch/x86/pci/init.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) --- a/arch/x86/pci/init.c +++ b/arch/x86/pci/init.c @@ -9,16 +9,23 @@ in the right sequence from here. */ static __init int pci_arch_init(void) { - int type; - - x86_create_pci_msi_domain(); + int type, pcbios =3D 1; =20 type =3D pci_direct_probe(); =20 if (!(pci_probe & PCI_PROBE_NOEARLY)) pci_mmcfg_early_init(); =20 - if (x86_init.pci.arch_init && !x86_init.pci.arch_init()) + if (x86_init.pci.arch_init) + pcbios =3D x86_init.pci.arch_init(); + + /* + * Must happen after x86_init.pci.arch_init(). Xen sets up the + * x86_init.irqs.create_pci_msi_domain there. + */ + x86_create_pci_msi_domain(); + + if (!pcbios) return 0; =20 pci_pcbios_init();