Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1183914yba; Tue, 2 Apr 2019 04:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKQAet8ZZCqCGiGZ0QYodH61ek7EALrRsN71V5xqameH6oUzb54pjqDe+13NMVqKsCcwNK X-Received: by 2002:a63:c10d:: with SMTP id w13mr28719464pgf.311.1554203427266; Tue, 02 Apr 2019 04:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554203427; cv=none; d=google.com; s=arc-20160816; b=kHJNTD5v9ibwW8NzSYMFUeD29k4Epz9u8X4SF/VkC8JcW2UwsUnJdMxOl8p3Ab6kQI NEsH1UqT6mB178Iqm8E5y/C0tq1qAQ7jh287i83vxVjWRz7kUvwM+kEw1hDfJqISrOaK 6nDaEmVumBs5be1QUHsjAz8KaGWaxS2gxDd7+RGj/BjxF2pj8W3MnPuSfFZEyFn9GDa5 OHHXMvrjShCYWNn0ELYOg6CPiDdI4fLg9fAsZNgRHGFE7d0DHbYLzaQVgjNOKnA9WJF6 tR7GyRMzm87sskXN7FsqIkkcrbV46nSVn6zMk3wiAXRP4UsqNN9iFJCLx3z4GGNFyn4j +5CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:user-agent :references:in-reply-to:subject:cc:to:from:message-id:date; bh=spwrXBYsJNSJiWKJssrnwkCAAM6RTa0xSiwHkigBGak=; b=dARvpa8Ik3tF27//e32FAdFN6yELcLQH9N6lWL1EHZ3NLOwgYTAvmGJBT7KkFTKmWz uLc7ikL2gUErPlqeixR6GZF7bK6HbZdOj9NDazBq+/VfLgZ76ZeVNpn7K3w1UI1aCnas ELDFKQuDe+CnYXqWo7Izv5tuuFQ1Mtal7yqoyl07KVbZLTEJQL0q7WQfD6/Bfxp0ll+e nBYPno8EQQV/C19UH9a2ONdH1XGSsMRURQ/q14om7t1JQXUZanminVPJcCh3xoN21C7M MgkqRh601nYgv2HI3D7hiAEMFXWLkCl33zAoNxiU+T9cu1insjbUM7sc9LG11U3I7Sr8 LXzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j9si10952753plk.359.2019.04.02.04.10.11; Tue, 02 Apr 2019 04:10:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729636AbfDBKHW (ORCPT + 99 others); Tue, 2 Apr 2019 06:07:22 -0400 Received: from foss.arm.com ([217.140.101.70]:47784 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfDBKHW (ORCPT ); Tue, 2 Apr 2019 06:07:22 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A8E0515AD; Tue, 2 Apr 2019 03:07:21 -0700 (PDT) Received: from big-swifty.misterjones.org (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AB2683F59C; Tue, 2 Apr 2019 03:07:19 -0700 (PDT) Date: Tue, 02 Apr 2019 11:07:16 +0100 Message-ID: <864l7g67qj.wl-marc.zyngier@arm.com> From: Marc Zyngier To: Heyi Guo Cc: , Thomas Gleixner , Jason Cooper , wanghaibin 00208455 Subject: Re: MSI number limit for PCI hotplug under PCI bridge on ARM platform In-Reply-To: References: <327ba551-2cbd-08bb-d4c1-107c3ff7d45d@huawei.com> <86ef6l57d0.wl-marc.zyngier@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Organization: ARM Ltd MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 02 Apr 2019 10:30:35 +0100, Heyi Guo wrote: > > > > On 2019/4/2 13:00, Marc Zyngier wrote: > > On Mon, 01 Apr 2019 14:55:52 +0100, > > Heyi Guo wrote: > >> Hi folks, > >> > >> In current kernel implementation for ARM platform, all devices under > >> one PCI bridge share a same device ID and the total number of MSI > >> interrupts is fixed at the first time any child device is allocating > >> MSI. However, this may cause failure of allocating MSI if the system > >> supports device hot-plug under the PCI bridge, which is possible for > >> ARM virtual machine with generic pcie-to-pci-bridge and kernel > >> config HOTPLUG_PCI_SHPC enabled. > >> > >> Does it make sense to add support for the above scenario? If it > >> does, any suggestion for how to do that? > > I don't think it makes much sense. You have the flexibility not to add > > such a broken setup to your guests, and instead have enough pcie ports > > so that you can always have an exact allocation and no DevID aliasing. > > > > The alternative is to dynamically grow the ITT for a given DevID, > > which cannot be done without unmapping it first. This in turn will > > result in interrupts being lost while the DevID was unmapped, and > > they'd need to be pessimistically reinjected. This also involves a > > substantial amount of data structure repainting, as you're pretty much > > guaranteed not to be able to reuse the same LPI range. > > > > Given that this is arbitrarily self-inflicted, I'm not overly keen on > > even trying to support this. > SHPC hot plug under PCI-bridge for virtual machine is attracting us > for its larger capacity, i.e. one bridge can have up to hot-plugable > 31 devices, while each PCIe root port or downstream port can only > have one. I understand that. But the real reason why people use the PCI bridge model instead of PCIe is because some VM models have a shortage of ECAM config space. This is now solved in QEMU (see [1]), and you get an extra 256MB of ECAM space. It should be enough for everybody. > Anyway, the reason for not supporting this also makes sense to me. Yeah, the ITS was never designed for aliasing bridges. If you can use another method to achieve the same thing, I'd rather see that. Thanks, M. [1] https://events.linuxfoundation.org/wp-content/uploads/2017/12/ARM-virt-3.0-and-Beyond-Towards-a-Better-Scalability-Eric-Auger-Red-Hat.pdf -- Jazz is not dead, it just smell funny.