From patchwork Thu Nov 24 23:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 25759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3663686wrr; Thu, 24 Nov 2022 15:36:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7UEWkwll0scstb65bnp82yc1eZGduBYP/ahlDfsGSuVW0Z5K5U5H3Nwmpk0BEh32dPsMXp X-Received: by 2002:a05:6402:3886:b0:463:ab08:2bc6 with SMTP id fd6-20020a056402388600b00463ab082bc6mr15292822edb.143.1669333011752; Thu, 24 Nov 2022 15:36:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669333011; cv=none; d=google.com; s=arc-20160816; b=BA5EoPyE9Wg+coOX4vJPCE8SlCiSoFhnbAmlGr1lTnXBxIKrfJWNVrTG2M0HVywc5N /Kc5nAOiC5Zc1UAeOn2RleqHnf7tJ4T9VjRhm6DxvFvs+p0g62ygZmfRFaxCJZ/cPBFT 7WKriWKMmMW6cGZxJDcF6s/32hy9YbndaTnBulm2DsWv6qmOfclWUOhcp2kj+cMWkfl3 nlJWtBUP6Ukc+tz9njMKjwxUlm6Q31soptZfds+VyXRW/KhiGpig4HJ+/wOhcfJe4miV XmxAxAxwNY5koBhcGkTqmrJbUHCxtyptyPhimP4V1rTxVoLLwhiINliel3esQXq2czVd 8PXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=U+wQx81cMa25gz7AqVU1KnfI5ICMKD3knD+g5UcDLC4=; b=kaJ7DySPcK/PBJGY9f8rq6X1o6A1J8rozQy/UGkWte+gX4PSLkYy5V2+KNKLM0DeFe hX/fuYqvaLCUypN5ctcdv16tia8MwzjEJU0tKN4DcqxriUFV1LpqA++EukhGFfyBLXn4 6znWD9N17lyEhXVgpgWE1pXnOyLrWaybXsLE4u00w5ro6IhK9sYb6xmFTP6gFUGYJQsf jL+CIAB96okGGLOkrz9rcOsh8PSKRJt0F6cTMcbrRM0MnUty9Qv5uZX+oq2PIsRqcY1R lUWrVQNUJFlwwMqksa0vlCRY8M1LSCVxgKWzQhYbJxq/c0SCtSr2Dq00zuTQggot1Rnv J3wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yR65BvU6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js6-20020a17090797c600b0078d20d71475si2157703ejc.413.2022.11.24.15.36.26; Thu, 24 Nov 2022 15:36:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yR65BvU6; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230033AbiKXXaD (ORCPT + 99 others); Thu, 24 Nov 2022 18:30:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230017AbiKXX3o (ORCPT ); Thu, 24 Nov 2022 18:29:44 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 443BE2EF68; Thu, 24 Nov 2022 15:27:49 -0800 (PST) Message-ID: <20221124232326.558843119@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669332380; 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: references:references; bh=U+wQx81cMa25gz7AqVU1KnfI5ICMKD3knD+g5UcDLC4=; b=yR65BvU6uxY1TZ9/+XrTodHlBDL1Dsyt1lbD2yiEDaEpGYd4tGxoHPFQ5AB9B4vU0JrCeB eghtYMxJRPKRz3HdlcQCE0pisDoIZsa5HOKBViO6RM/r0SOxBciiByJMD+pguKDXVVs6P/ bwNHiD6sxpxOO1lIlEiOYLvMzFJw9O34V8I3H0sqgAKB0V8jBAP6O108rytoyZpK7wQMUz +6aUKlibNjJY4xxbj84MUNo1HeAf8QvJ38CbB2I8IJ5daKYz1nxgGKAxt1AjmoPBZ2rl+c yLt4M5qUhBDq3CQMpelTn/AruJhKD737EBHnouX0xF1xgTonMpQ/W8ZkyqGXvg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669332380; 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: references:references; bh=U+wQx81cMa25gz7AqVU1KnfI5ICMKD3knD+g5UcDLC4=; b=KC86ODTt2mFTPKTvh3yaCHEfCGmSCUC5b2aBuEzQbscqIr8Gn4T1QqksD9ufY4ZLi+EtNr yQtJs+mN1ui5OfAg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Jason Gunthorpe , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , Jason Gunthorpe Subject: [patch V3 22/33] genirq/msi: Provide MSI_FLAG_MSIX_ALLOC_DYN References: <20221124230505.073418677@linutronix.de> MIME-Version: 1.0 Date: Fri, 25 Nov 2022 00:26:20 +0100 (CET) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750422531904642436?= X-GMAIL-MSGID: =?utf-8?q?1750422531904642436?= Provide a new MSI feature flag in preparation for dynamic MSIX allocation after the initial MSI-X enable has been done. This needs to be an explicit MSI interrupt domain feature because quite some implementations (both interrupt domains and legacy allocation mode) have clear expectations that the allocation code is only invoked when MSI-X is about to be enabled. They either talk to hypervisors or do some other work and are not prepared to be invoked on an already MSI-X enabled device. This is also explicit MSI-X only because rewriting the size of the MSI entries is only possible when disabling MSI which in turn might cause lost interrupts on the device. Signed-off-by: Thomas Gleixner Reviewed-by: Jason Gunthorpe --- include/linux/msi.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -557,7 +557,8 @@ enum { MSI_FLAG_LEVEL_CAPABLE = (1 << 18), /* MSI-X entries must be contiguous */ MSI_FLAG_MSIX_CONTIGUOUS = (1 << 19), - + /* PCI/MSI-X vectors can be dynamically allocated/freed post MSI-X enable */ + MSI_FLAG_PCI_MSIX_ALLOC_DYN = (1 << 20), }; /**