Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2023134lqa; Tue, 30 Apr 2024 06:29:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBqLTF8uzVHs7oPoF7ugc9P0Pm3T637EfaTiZ3lx1+8eyK5Sr+wf0P2TvYadIYpxzbHtNBEQ3E0VKXXVLEhQYwcXWN1ADRMXPaa2W7ng== X-Google-Smtp-Source: AGHT+IGDvwgaaoKBjzb0xNGVrSVwa1wm3m3gQUt9NnRz24y/rEwMpfunKDDXeLLUUJ0cNz68GPfQ X-Received: by 2002:a50:d651:0:b0:572:47be:be36 with SMTP id c17-20020a50d651000000b0057247bebe36mr8294902edj.0.1714483748087; Tue, 30 Apr 2024 06:29:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714483748; cv=pass; d=google.com; s=arc-20160816; b=MR5ejwvv14ZszAzzaTl4TLuzn9r3wwhNbUcXhBZ2N3Z2Lm5YxRQfw1LQJES06J4USm /xUWzLfHmRO3xCogz0RWmzbIwrjnm8mIKjkZPaPe9xYf2WLSc/SqtfEuFtdyfZZZHB5v 0LR45mfOQsKvTR6yXSLP/PcERm3d/i4HdeK2rX60gSUSkohKSrbId7Xd2wvh/eZOgMHj RODbB14148TYT8jYw17dDxN7LU/MGU38ACMXYYpxDEd161HNqp+Pq6MwO0HYroQH+mBI q8Y8TsU4Q7qNyvZN6+JtUgYF6+egYdnm0sYkoBZGPO0KAL5AuzxvXfxyVyEANy1LV6Ar Jorg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=7zU5eaJp0wwbY0xMMfq6TY3Sx9Qd3GTQb8XToag6itQ=; fh=R7LqAt/jSCi02Q5rwNYol6TuujP5ISPK9p+EdW5x3xs=; b=vn0DKUKFGjEQg2AcHCDUzN1E0BueDI17qYGr311hqUiwQbWE2hGqyN+QYdfD77JV/p dMUVZ9LBwqkmRSztZM9NRnQjKa3L82IY2FX/UmwG3smhd0lMOCFK8X45mAFQUepf8K+l TgSuRHJnkfWRu9bSyCdLkY4wEIwDM7sBVRp1DYbaKsdSO1B+cxbzYoJk/oV33kTnW3g0 eKA+qHg4ieHlupl5yUhyTdb0f1/1f21q+p0MTJ/dZZZRNl4vmafGnIBdJI+2LQGCYqnQ DnOIN7ckC5bgtXD7KMGpOIaEIK+LGX/+snMWs6YM2ew6RQ0RM/hlPBxQzTEQpotfIgIO ipEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3G365SOC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-164001-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id c9-20020a509f89000000b005726d40a0cdsi4011472edf.245.2024.04.30.06.29.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 06:29:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164001-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=3G365SOC; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-164001-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164001-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id CC7851F22369 for ; Tue, 30 Apr 2024 13:29:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6B7EA172780; Tue, 30 Apr 2024 13:28:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3G365SOC"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="BaxmTeLQ" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2696917167B; Tue, 30 Apr 2024 13:28:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483725; cv=none; b=KSKJ76SmeQ/KyND9fzA94MaCJq8cwgXLlvHK7rAvD4Ljbpg9kJ76TzzjCeQBsQr0qcmTk52KxsKYbsS5+8dEMLBkGIsxvt2Cq31Lp/ea4mcQzr8PwRUGSIlWv42yBsxnbQqqAi3Fnbe5gC1ZdY/js3UBN2xUnYInefaS4caNbcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714483725; c=relaxed/simple; bh=tLFWX7t/A/fiQh3OFL+nFAsakFf8aQgUCSh6ABUaEiU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=OaQjR/p6MAlSv73S/XknCWlNEeMbFBa5eWXwRdL/9ZajCtZnkeB2CXEl4iaLc5vrp11KR4BRKeU3mTvb9zRbi+zZYQI48suSqj3kpDVRK8+T8PMP7VI8AnNRBnUGKSv2ZTgE9P5PjEmFua0B6flAwMeAWo3qoaVrd9hDLIldT6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3G365SOC; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=BaxmTeLQ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 30 Apr 2024 13:28:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1714483721; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zU5eaJp0wwbY0xMMfq6TY3Sx9Qd3GTQb8XToag6itQ=; b=3G365SOC4zpTHW9DKRypTwTbM8d8z2VhEh9TJuPc1FjfWkbGs+fl8XNDDwVF24yLhZFZYk YUZw8JHJMouwfpkHuTehEMophxgBp2vGu3HoAMjpdgBwNyiXib+4iLN7Pnzjbuic8/6kSU d9y3riZc1PA6cMEXQjvQ2jQ8igF8nkbWiYao3GB/f+rpDHcs+j5mFaLlPHpDJ9UKxfKQxM E9u9OlT228j4cq6Qk8lMtaOx6eDbJh6a9B8FP77EwFRhBMg3DEDlfwiopj3m7OHRDphSVJ BE24Qq056erDPX9yMql1REGJ9jwhnYJi60Z2yrWTZiWRCUPnmHpWajDBYruq7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1714483721; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7zU5eaJp0wwbY0xMMfq6TY3Sx9Qd3GTQb8XToag6itQ=; b=BaxmTeLQlzY/lHMnLj6H4KTWw9Es+KkAaqje7UYQdLVabUcqXLTJKhbeDajul2PXUms8js 3adVERDoeIKFMIBg== From: "tip-bot2 for Jacob Pan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/irq] iommu/vt-d: Make posted MSI an opt-in command line option Cc: Jacob Pan , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240423174114.526704-12-jacob.jun.pan@linux.intel.com> References: <20240423174114.526704-12-jacob.jun.pan@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <171448372107.10875.12692815650049599253.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/irq branch of tip: Commit-ID: be9be07b22c96dc03d0ecc76b5a5f21c2dcb05a1 Gitweb: https://git.kernel.org/tip/be9be07b22c96dc03d0ecc76b5a5f21c2dcb05a1 Author: Jacob Pan AuthorDate: Tue, 23 Apr 2024 10:41:13 -07:00 Committer: Thomas Gleixner CommitterDate: Tue, 30 Apr 2024 00:54:43 +02:00 iommu/vt-d: Make posted MSI an opt-in command line option Add a command line opt-in option for posted MSI if CONFIG_X86_POSTED_MSI=y. Also introduce a helper function for testing if posted MSI is supported on the platform. Signed-off-by: Jacob Pan Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20240423174114.526704-12-jacob.jun.pan@linux.intel.com --- Documentation/admin-guide/kernel-parameters.txt | 2 ++ arch/x86/include/asm/irq_remapping.h | 7 +++++++ drivers/iommu/irq_remapping.c | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 902ecd9..dfbe9fd 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2251,6 +2251,8 @@ no_x2apic_optout BIOS x2APIC opt-out request will be ignored nopost disable Interrupt Posting + posted_msi + enable MSIs delivered as posted interrupts iomem= Disable strict checking of access to MMIO memory strict regions from userspace. diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h index 7a2ed15..5036f13 100644 --- a/arch/x86/include/asm/irq_remapping.h +++ b/arch/x86/include/asm/irq_remapping.h @@ -50,6 +50,13 @@ static inline struct irq_domain *arch_get_ir_parent_domain(void) return x86_vector_domain; } +extern bool enable_posted_msi; + +static inline bool posted_msi_supported(void) +{ + return enable_posted_msi && irq_remapping_cap(IRQ_POSTING_CAP); +} + #else /* CONFIG_IRQ_REMAP */ static inline bool irq_remapping_cap(enum irq_remap_cap cap) { return 0; } diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index ee59647..056fec6 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c @@ -24,6 +24,8 @@ int no_x2apic_optout; int disable_irq_post = 0; +bool enable_posted_msi __ro_after_init; + static int disable_irq_remap; static struct irq_remap_ops *remap_ops; @@ -70,7 +72,8 @@ static __init int setup_irqremap(char *str) no_x2apic_optout = 1; else if (!strncmp(str, "nopost", 6)) disable_irq_post = 1; - + else if (IS_ENABLED(CONFIG_X86_POSTED_MSI) && !strncmp(str, "posted_msi", 10)) + enable_posted_msi = true; str += strcspn(str, ","); while (*str == ',') str++;