Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5072816pxb; Mon, 15 Feb 2021 08:48:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxWV1BAn3V22DshLV0FdRj5aP9wfV+7xqmfgMbA3d/H/OVfF4g5QipAUrQ0QRAVF4pcBut X-Received: by 2002:a05:6402:278a:: with SMTP id b10mr16839203ede.347.1613407680918; Mon, 15 Feb 2021 08:48:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613407680; cv=none; d=google.com; s=arc-20160816; b=j6QL29WUd5mKEDA6imSckl0iY0DWwFP9m8E+XyMUHdwjrrdIXGZq4ud366t8Mlnc3Y 04WQz7sU2sgh1nUo0Xlt8hILaIqr9hXWlyX1IMhEsCOnZT19Ocw1dqawX16/WqqmKLxs bs4Z1mZw8Dl8U/pomv+mH/N25zyAK7JJUF+Du8ifJsugZy3/n01pvvDpyoBjIYZa2xeo TEm6HlAL2aWJumIO6SAAkqGM0E414ZT/VDWQ0Riuxztgkc3OGLyLvJioPTB4X+0Z4ctm YWxhdQ5+Hh9/Ni81ayn6v+dVe8gLDceFhH4HnoJZL1Rex2PLRe/gK0ZH7wuif7WkyUcc V8bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mLXOFt5/mzw9dkZjRp6m4C6JqddubwXvEQwqV4qUK/k=; b=HpGir69DCU9XZhfdhYsiDH7Lo3bFmZICB32xjrKH4/6DQTP1oTyHRnIl2hHhEr3+B7 MsAM6ZQJ9auSeG935yQXY7NM3xeluDtkJP6G6zPTzUJ5lWCdEOZ2raueEU/ykkMbILDH 4/Gl8LLJIMJz314szLxAGe+JRyZOVQo7TTlC21uoI4B3Il7wG1aSW3em5CVVDdjGwS/V IK1/9R21Waltk8Y4x83pwCCdqN3DtXIz4kN5AbgNdwuCSAr9sm4v6rujmvkCseJcisnB dkfYC0jMfwYWhfU4QgVZhee28m6nHk3BXyDURjLRWKWHaHM7Zbdij6qO/XMXlLvdtz3F LkbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J1gZXAKg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s22si3070654eja.338.2021.02.15.08.47.38; Mon, 15 Feb 2021 08:48:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J1gZXAKg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230427AbhBOQps (ORCPT + 99 others); Mon, 15 Feb 2021 11:45:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:49636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230396AbhBOPiI (ORCPT ); Mon, 15 Feb 2021 10:38:08 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71C8B64EEF; Mon, 15 Feb 2021 15:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1613403250; bh=rJ3cqbEgNSmAErDCZ7J+vtEJej8rLb/DxMwN4DWhHaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J1gZXAKgJZOfsHRsMW2Nf2nVJ7s81rnG5T3nT7rZ2Wyyv+ti71arLYb4rXNLlbItL mHljBYdk8zJIbBDwZ4rRUgsQnH0HGp2WjclguqnwDwYwH8hiAkt+GPD3iibuESdgvn dRhlFZhfB8XMQMJmkzeEMpY6ni5bZCx80+EE8zCA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , Thomas Gleixner Subject: [PATCH 5.10 085/104] x86/pci: Create PCI/MSI irqdomain after x86_init.pci.arch_init() Date: Mon, 15 Feb 2021 16:27:38 +0100 Message-Id: <20210215152722.200008050@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210215152719.459796636@linuxfoundation.org> References: <20210215152719.459796636@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner commit 70245f86c109e0eafb92ea9653184c0e44b4b35c upstream. 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 Link: https://lore.kernel.org/r/87pn18djte.fsf@nanos.tec.linutronix.de Signed-off-by: Greg Kroah-Hartman --- 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 = 1; type = pci_direct_probe(); if (!(pci_probe & PCI_PROBE_NOEARLY)) pci_mmcfg_early_init(); - if (x86_init.pci.arch_init && !x86_init.pci.arch_init()) + if (x86_init.pci.arch_init) + pcbios = 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; pci_pcbios_init();