From patchwork Fri Nov 11 13:58:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 18822 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp759083wru; Fri, 11 Nov 2022 06:06:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf7zdN2aHUYZtP7hxOY/jNVXroPGM+2lQZNbV0tYODoJw9UV9XmQ0vekM2plZoTGz9G8e5PC X-Received: by 2002:a17:902:da90:b0:187:12cc:d6f1 with SMTP id j16-20020a170902da9000b0018712ccd6f1mr2395013plx.63.1668175617858; Fri, 11 Nov 2022 06:06:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668175617; cv=none; d=google.com; s=arc-20160816; b=PgD5BlpDxmH/aT+N7fk5+nIvr8pC+JAEoGGVTfQ+uvtlOYD/X4HovHhJY+qs6Ve3eW O3iPNHvWxWUIYaKr5izL4tZKFoA+Upy/DcObQXAjzZKmw8XIIfu8gw2pdiZGyZFkbw9d mEftId4ET973z8XhYMmmGtsyfULjeeWtY7zMKv2jKfa6M9v66Y9wi0LkZM9cVpfVTFhB jx10urTOEXboK6kEq2QTIlZAemQE6tKPP97dOyiKrn4ymxL+8PxvrTRT2a83eIkTF/s6 8nvH3VSVVbuC6ZimdySVNqjGtxEkX3+N5w/KmtlBm0g4uf1SpkcxJYNMPX6Lrw6axglD +DWA== 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=wvq/UAWBnWLIn373I3iZtaQ+G1F0GV+IlK6QQPaFqcU=; b=yqyLn5krf54r2W28sy7VCwRz3hsc5FTVc4mmBKKtwImqf9k8FVAepxMit3uadNfiEm lD8wIlQdLd0FWbBJoUaRoV5BI3IIBxDQSEM7JcayI0ZTTPgIkBEFtN3ZPc9OZtu+rLcf hhywwfaepZhWiaVKFn78neKQ1kWpNay0BmZ/g6SMmkSXj9/GaKDUj82DqQPiUFNhhZ21 Fikp8S049CH3DSBXIjLU1z2ZJsdB7Yz5wULXG6s1kv49dKsLA9gR3/x3vKRbAyaDDso0 P1kpbMUlnvHx1MGWKh82mqL8K/QSYGZjByPghGWoei0OxrJd5nK9JQPQ0W2EmDwNw3of gTtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Oi5Fm2es; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="L0f1/AJb"; 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 k18-20020a170902ce1200b001869de3edcasi2583847plg.466.2022.11.11.06.06.43; Fri, 11 Nov 2022 06:06:57 -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=Oi5Fm2es; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="L0f1/AJb"; 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 S234244AbiKKOFa (ORCPT + 99 others); Fri, 11 Nov 2022 09:05:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234226AbiKKOFE (ORCPT ); Fri, 11 Nov 2022 09:05:04 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6A2889FB6; Fri, 11 Nov 2022 05:59:04 -0800 (PST) Message-ID: <20221111135205.486390836@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668175098; 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=wvq/UAWBnWLIn373I3iZtaQ+G1F0GV+IlK6QQPaFqcU=; b=Oi5Fm2esocx23HpZQOPMAz84HbKkki4TfiPD2o+PYIJeY+Q3tFA9Ao+RfshJWWoNuc+u83 bKF5cP8o156ZnFlGZkUhlEUrC9Y4fZESVghFE6K/Cnny8Cy34pBdT0U96HrURFPZaAkUdC KzJkWiwshMmaxz8rSSvZMvJ4GmZld0YC6orJF+DI5Ysvov4AhNEKvAom8RVUMUtdRdKewQ c95eHw09X2ramu0QIwfUTXmwbzokyWT3IA44aD9+mt25iUbhmGcHVyhC+6Ed1PedgbU1/g TY12GFZoi3OhRO6QqmPnmREhT1shvepahKntwBqgjuOfgp98yC+K+Uc+0sv/hw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668175098; 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=wvq/UAWBnWLIn373I3iZtaQ+G1F0GV+IlK6QQPaFqcU=; b=L0f1/AJbwQ15elJ92Io5gqA0ZWGqy0dco6cbPo5Pk3o4px+alA0hfzKHSG4K/nGQJDbBtL UExpj31mr8BvYLDw== 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 , "Ahmed S. Darwish" , Reinette Chatre Subject: [patch 04/33] genirq/msi: Add size info to struct msi_domain_info References: <20221111133158.196269823@linutronix.de> MIME-Version: 1.0 Date: Fri, 11 Nov 2022 14:58:17 +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?1749208916455089846?= X-GMAIL-MSGID: =?utf-8?q?1749208916455089846?= To allow proper range checking especially for dynamic allocations add a size field to struct msi_domain_info. If the field is 0 then the size is unknown or unlimited (up to MSI_MAX_INDEX) to provide backwards compability. Signed-off-by: Thomas Gleixner --- include/linux/msi.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/msi.h +++ b/include/linux/msi.h @@ -410,6 +410,7 @@ struct msi_domain_ops { * struct msi_domain_info - MSI interrupt domain data * @flags: Flags to decribe features and capabilities * @bus_token: The domain bus token + * @hwsize: The hardware table size (0 if unknown/unlimited) * @ops: The callback data structure * @chip: Optional: associated interrupt chip * @chip_data: Optional: associated interrupt chip data @@ -421,6 +422,7 @@ struct msi_domain_ops { struct msi_domain_info { u32 flags; enum irq_domain_bus_token bus_token; + unsigned int hwsize; struct msi_domain_ops *ops; struct irq_chip *chip; void *chip_data;