From patchwork Mon Nov 21 14:38:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23837 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1629362wrr; Mon, 21 Nov 2022 06:43:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4gm472rBC5oQ3X47vEGRS+G4TeJ1pn4y7OJKI89AGKPfhzgQDC7H0yA9/bWli2LZuWnrrH X-Received: by 2002:a17:906:ce28:b0:780:8c5d:f86 with SMTP id sd8-20020a170906ce2800b007808c5d0f86mr15737037ejb.391.1669041782451; Mon, 21 Nov 2022 06:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669041782; cv=none; d=google.com; s=arc-20160816; b=siTdbbOIdqTQCdhOwuCEgCs0ASVDeoOWTOpm6aB/cSlgRHZZMxBZtCI39JuvuSreVK whjq95XKkxHYr3QVIf5MEj56QO7fYohEOEFLohDffTxLw2VlXkKoVJeXC6L11nJ8TUKe FqTCVgpCLaRrb1ATv89FD9YtBMqma3zUE64Zp2DFLXKWjCI+sRFUdSlGXRadAya2qLa3 2gMIHLumdtn7SqgwhITbOTh9157p+/Tuqdk048vm/wCuOShg7freCVVRXWFtuuovkFxm fZuYShpmjL7yTp9mZqTyOKNmdPFblTwYHFMWv/eLUwTNdsWwC3Y8VFd0EP09n8F8x/+t fvPg== 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=7ozm1W9vDFfSIoLTXblkyRUQVqcZdWLOTQR4Ad9y7GE=; b=Dqic3+eLZ4XXjbRNWsiAD0fPg3KENp2mVuMjoUgMcgQmIpP4XbN4uCvFS1srw2SK+t KCjFtMmf+yF6XV4dlbQNnfLVR4n0fxYwv7dSb/wWsjjwtfmqBMdmYuNYOf85ilyXsrKi Ttef8u7AmKuBVBF/M9Uo2CvhL3e/C1Jd31SHyd/jOBtZEJiUJX47lRfCSU12KsX8FQbh 2bs87KscTuWPu7w1/6IjSG+CuimYsJpjINfkMu1SsDE2JjjtZpDHVmdL5TETXomblCob kq3ye+1jhZ108Zwxj5PpC2AjMVAbkUpGo112GXqIrsg7jV7XKYvKoqcrUwnO6HAWpA58 L8ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LhyPLCQA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=wFcT822C; 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 i5-20020a05640242c500b00456e33b69e1si10570135edc.347.2022.11.21.06.42.27; Mon, 21 Nov 2022 06:43:02 -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=LhyPLCQA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=wFcT822C; 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 S231783AbiKUOlJ (ORCPT + 99 others); Mon, 21 Nov 2022 09:41:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231488AbiKUOjJ (ORCPT ); Mon, 21 Nov 2022 09:39:09 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D2CCC769F; Mon, 21 Nov 2022 06:38:21 -0800 (PST) Message-ID: <20221121091327.974140298@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041500; 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=7ozm1W9vDFfSIoLTXblkyRUQVqcZdWLOTQR4Ad9y7GE=; b=LhyPLCQAlQHr9qTA1Ov1RETf6QOK21scp548PxBrBrcSgTLtgu3tx6hBXW6pxwdzdk7OJO 8b7fiFl6zWF2xK2qhaBeOyYHJWfjB/qLEo1iRYSFhkzPM3iA3nnvRQLHEyCb6wjUW9TPWG T/b85oB1D2A4HmnGxVuKbDpxwXpwKVHT8t4BE4a2DBLMIXIepfBfrK3aN6Ooq0Q47H4KbV vys+RRBzHlW4F5xwAlsY31feT/DgvE7c203LkV+kqSErylFwaiBFk/W3oDlG+VkhJBjiU6 iGvYrduZqr6rZQGDGsxVseXs1HW6MAzAWDnO+Gka65SSU/rPpyIjzaKdgM5vYg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041500; 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=7ozm1W9vDFfSIoLTXblkyRUQVqcZdWLOTQR4Ad9y7GE=; b=wFcT822CR/M3YtgqkGDDY1oHnMwc1eEUZaiI1oHqaWHZT+lcZLG85Qm845cZgcbFJnmcBz lq4DQI0kv9m+ncAw== 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 Subject: [patch V2 27/33] genirq/msi: Provide constants for PCI/IMS support References: <20221121083657.157152924@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:38:19 +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?1750117156337501037?= X-GMAIL-MSGID: =?utf-8?q?1750117156337501037?= Provide the necessary constants for PCI/IMS support: - A new bus token for MSI irqdomain identification - A MSI feature flag for the MSI irqdomains to signal support - A secondary domain id The latter expands the device internal domain pointer storage array from 1 to 2 entries. That extra pointer is mostly unused today, but the alternative solutions would not be free either and would introduce more complexity all over the place. Trade the 8bytes for simplicity. Signed-off-by: Thomas Gleixner --- include/linux/irqdomain_defs.h | 1 + include/linux/msi.h | 2 ++ include/linux/msi_api.h | 1 + 3 files changed, 4 insertions(+) --- a/include/linux/irqdomain_defs.h +++ b/include/linux/irqdomain_defs.h @@ -25,6 +25,7 @@ enum irq_domain_bus_token { DOMAIN_BUS_PCI_DEVICE_MSIX, DOMAIN_BUS_DMAR, DOMAIN_BUS_AMDVI, + DOMAIN_BUS_PCI_DEVICE_IMS, }; #endif /* _LINUX_IRQDOMAIN_DEFS_H */ --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -529,6 +529,8 @@ enum { 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), + /* Support for PCI/IMS */ + MSI_FLAG_PCI_IMS = (1 << 21), }; /** --- a/include/linux/msi_api.h +++ b/include/linux/msi_api.h @@ -15,6 +15,7 @@ struct device; */ enum msi_domain_ids { MSI_DEFAULT_DOMAIN, + MSI_SECONDARY_DOMAIN, MSI_MAX_DEVICE_IRQDOMAINS, };