From patchwork Mon Nov 21 14:38:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 23841 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1634563wrr; Mon, 21 Nov 2022 06:53:31 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sDA64vHTRnrvkqeXgU8HaaF/VCh1eNtBGKKVCebhyYgBYI+6Ib0kJnOM7ZxDl6PSdZ+cq X-Received: by 2002:a17:902:d0d3:b0:186:f1b6:c3dd with SMTP id n19-20020a170902d0d300b00186f1b6c3ddmr11715205pln.20.1669042411450; Mon, 21 Nov 2022 06:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669042411; cv=none; d=google.com; s=arc-20160816; b=bLMojJyez+Mq2w9KMG0nE5zae5TNMDdKWvKqyGTiYwhteLIyLAqwP/Uu1G8yEvJoQd oEmK8v09V53/jvPVPC0n1B1SyvJPlGPfK4UnJ6HDy7VgIC7y4lqVXjFKrnxY3IBAVR7Z g7HeOkGh1kHBHhjEmaVlPEDqMTZEXf9vp/4odkDBidjOCfhFrqu7pmW9YTR/YNhQQeP/ LLRny6ybx0CO+2W+LMLZNPn6rzQlaJmST5sC02KyrZEcc3TbQjym4kKsCozeJuPOvUTu m19gNKf185DhPuaIMf5bfi8NTYixGUcEArPyY0GV6EC5keu+EAuc59OU3vwkXkeJxLCT 5niA== 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=QDMaEx7ktXTUaBjXhcwy3JcriisNhamDQjdxbqkUVcQ=; b=1LN7cdkX5qyRVwB3AoD0fz5oc67eWwK8AU+EhKBWM8HX9UtTyagbJyHzS1WegC+ILY FBf4iNyau/LMfxFioh5S7tbIaF/8+YqvbMKI+4b+bw2PZLR0awX6MamtFz8qUk8AW5wq RNajYcdMaicQijE2dUSQnThA6o8K9xl5B42gAS7zN2gHMWxpI9SJ3m1au6gTRAS2cYn7 4QSltuCwF1accHhFCJyglBfr4L0sTkzf6vW+AHx4un/PRy8u9fvCxVe38sUiOBpoi3cx Y+5MtpsWwgoSCFzd4Ryu8Ex7vacyhbb4VgwIpejiWnRs92FVyGp2t+e6dJCbGRaohCh0 WqsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=0U8XVxBR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+vKigeOR; 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 w1-20020aa78581000000b0056c25866e36si10422201pfn.79.2022.11.21.06.53.14; Mon, 21 Nov 2022 06:53:31 -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=0U8XVxBR; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=+vKigeOR; 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 S231938AbiKUOlb (ORCPT + 99 others); Mon, 21 Nov 2022 09:41:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbiKUOjc (ORCPT ); Mon, 21 Nov 2022 09:39:32 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1248BC76AC; Mon, 21 Nov 2022 06:38:25 -0800 (PST) Message-ID: <20221121091328.131771866@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669041503; 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=QDMaEx7ktXTUaBjXhcwy3JcriisNhamDQjdxbqkUVcQ=; b=0U8XVxBRJ8Vp/L2pbxJS5DkmJ6EglhHxDqHc/FFNSt/z9Z4FW7zwXXFTf0FPzf439iVdsB Vi/OCNdvyipjwXFMBOitBBWNy4808ajkdGXK+CmlMQuw7kBnbuIpJGqY7EbkdxiAx0EXsN py372Iz/61ExERDtt0PTJQtdf5XxwhubaqpQRjrgdY5oiWwZm9pJchwGbyyGhpXnWADmAV ywMOUCJYy5gsLM5QLXsmHabar4bF2357T7+kWqgDO+uhrdQmr0kfzZwSflaB3y1eOiUBbd xSuh9xfuF6Ktgawg/rpmL8w66w5UD91M/99IrMezDnC/70mr7YSz43WeKFR/rQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669041503; 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=QDMaEx7ktXTUaBjXhcwy3JcriisNhamDQjdxbqkUVcQ=; b=+vKigeORtD6RIyVV9dLEHEachwRvpZSi1kWUpZyKjFTLZUEY67FAAdK/UDwbrEVFi9ASJr kj6KeXgh3eKjG4CQ== 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 30/33] x86/apic/msi: Enable PCI/IMS References: <20221121083657.157152924@linutronix.de> MIME-Version: 1.0 Date: Mon, 21 Nov 2022 15:38:23 +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?1750117815513829388?= X-GMAIL-MSGID: =?utf-8?q?1750117815513829388?= Enable IMS in the domain init and allocation mapping code, but do not enable it on the vector domain as discussed in various threads on LKML. The interrupt remap domains can expand this setting like they do with PCI multi MSI. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/msi.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/arch/x86/kernel/apic/msi.c +++ b/arch/x86/kernel/apic/msi.c @@ -184,6 +184,7 @@ static int x86_msi_prepare(struct irq_do alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSI; return 0; case DOMAIN_BUS_PCI_DEVICE_MSIX: + case DOMAIN_BUS_PCI_DEVICE_IMS: alloc->type = X86_IRQ_ALLOC_TYPE_PCI_MSIX; return 0; default: @@ -230,6 +231,10 @@ static bool x86_init_dev_msi_info(struct case DOMAIN_BUS_PCI_DEVICE_MSI: case DOMAIN_BUS_PCI_DEVICE_MSIX: break; + case DOMAIN_BUS_PCI_DEVICE_IMS: + if (!(pops->supported_flags & MSI_FLAG_PCI_IMS)) + return false; + break; default: WARN_ON_ONCE(1); return false;