From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.19 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796010020; b=O7me9m59j5ZVvuhWG1FNXDiykK2nli7fwnuJf67NDJh/DkgXgLuEULmrideBSaYuPx25 nWOodZhoXZmYxvHOvilP0/HG3LMN7YuxtYmzBsSgk+k/PNyvwu4nQLHkt8sXgX9Utmkn3 TdtLMEq4y5fYDLlWpZdVaCImEDeD6RHJzPQmNdhd1hjQDRCEgq7g0Zs13JT71rrFX3HAS mTjy0LA/Gr+DQcI08t+x57eyFhL1DvfUzrFUa0tMQpmMbA4v4WbcGfZXmKcS0f09VJZ5Z di7Pr9BmUcU85EffpP9RBGUm9Y50LBymO10s5f9xWUhCoMpu0tvfeYqPKgvUqVAHgew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796010020; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=pvGpIcMhwaVLWxVxwuwoC3g/rQs4DmAlzLPX6wJlYEs=; b=Pw8SwvH+jwlgC3R+ITWiVwHUzhylw2Oa7mG+Xn+OCKF6V4htNjNzuxd+mrS4REsstg2w Jvk5Cc2fLDW1wc32t5UUQm6nFWqe5Ec6swHFLeRtz+VybIPGPaPhYHpd3CmXbYRfL54Bm zmPXafPHlKZHt4j9iqbZfGohNKjOj1jrsb+RrlvTKUAnqYs9e0gvKhdMAOXeBBT5EU8Ms 3MTZUrfYGJzcxK2d6fKC9ETn3WSoO6UCNvblz4lsdZqFV0V6jSWNirNdVD61VH53WppJF Qu7/p8EhQuJ3v4Wiu/uH1b3Bq/qF7QkxFw+7y3OLsJNHoIh++EUt3CbPh7jOerlWaUw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b="L/RTzYob"; arc=none smtp.remote-ip=192.198.163.19 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7D5AD606A33F; Mon, 30 Nov 2026 03:40:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7D5AD606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=L/RTzYob DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796010019; x=1827546019; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Aon2YNJBaygF14scYZm3iUXRBTRwfwXFe8k9bb4/T2A=; b=L/RTzYobDPAe8Y0AMxR+Fwcf1EtLQtRmHtLr43vTed9aSMgp8M0caveQ 0h/rlNbmbSJC0p6klpoPIFvsiIxQyPaS34smPTqBbbZoO7R4qIn6sBvLe 2CEqJB7db5TbFy5bqnV1F6mJaYmHNwUvIv5stiiNHL6F10yRAOh32Ic5g GvBEbLoMlmKgOykh6cj+wOBdTqXs6zEj3VFf8NIU4MSJqBQk8UBw8Yn5G oW/Mri6/xkDQjEDIpoX3tq+JIyzuxGpXIz3KjESjYz6uEJZ42Z1lz6hOF dpm3Rd2sQeD0oogmQPtvUL6xNrE+XsphUs9U20v1d+ERvGzgdS22dVxZh w==; X-CSE-ConnectionGUID: /+p108iiS1CuHvgpbKMU8Q== X-CSE-MsgGUID: puzpGeH5RK6bkXyoOKjhTA== X-IronPort-AV: E=McAfee;i="6800,10657,11981"; a="4848224" X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="4848224" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Nov 2026 19:40:18 -0800 X-CSE-ConnectionGUID: 64PfqGuQT8uaFQcyyDWV6A== X-CSE-MsgGUID: xUVofXLjQ62wEZXnoKr5Jg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,242,1787036400"; d="scan'208";a="12950980" Received: from pankris-x299-ud4-pro.bj.intel.com ([10.238.152.122]) by fmviesa005.fm.intel.com with ESMTP; 29 Nov 2026 19:40:10 -0800 From: Kris Pan To: tglx@kernel.org, maz@kernel.org Cc: mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, x86@kernel.org, peterz@infradead.org, frederic@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, longman@redhat.com, tj@kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, dwmw2@infradead.org, baolu.lu@linux.intel.com, vasant.hegde@amd.com, suravee.suthikulpanit@amd.com, iommu@lists.linux.dev, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, linux-hyperv@vger.kernel.org, bhelgaas@google.com, lpieralisi@kernel.org, linux-pci@vger.kernel.org, steve.wahl@hpe.com, bigeasy@linutronix.de, clrkwllms@kernel.org, linux-rt-devel@lists.linux.dev, radu@rendec.net, linux-kernel@vger.kernel.org, Kris Pan Subject: [RFC PATCH 01/10] genirq: Add IRQCHIP_AFFINITY_FILTERABLE flag Date: Mon, 30 Nov 2026 11:36:59 +0800 Message-ID: <20261130033709.2704805-2-kris.pan@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261130033709.2704805-1-kris.pan@intel.com> References: <20261130033709.2704805-1-kris.pan@intel.com> X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Runtime IRQ isolation needs to program a mask which differs from irq_common_data.affinity for unmanaged interrupts: it is either the request with runtime-isolated CPUs subtracted, or a relocation to housekeeping CPUs when an automatic placement loses every online target. Legacy irqchips which derive mask/unmask or routing state directly from the requested affinity cannot tolerate that divergence. Define IRQCHIP_AFFINITY_FILTERABLE for delivery irqchips which can safely accept a filtered or relocated mask, and IRQCHIP_AFFINITY_PASSTHROUGH for the forwarding levels above them which only hand the mask to their parent. The core requires every level which implements .irq_set_affinity to be one of the two, so an unmarked domain keeps filtering off instead of inheriting it from a parent. Expose both flags in debugfs. No irqchip opts in yet. Signed-off-by: Kris Pan --- include/linux/irq.h | 23 +++++++++++++++++++++++ kernel/irq/debugfs.c | 2 ++ 2 files changed, 25 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index f485369b1b4f7..d47ebe8ec3708 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -569,6 +569,27 @@ struct irq_chip { * IRQCHIP_AFFINITY_PRE_STARTUP: Default affinity update before startup * IRQCHIP_IMMUTABLE: Don't ever change anything in this chip * IRQCHIP_MOVE_DEFERRED: Move the interrupt in actual interrupt context + * IRQCHIP_AFFINITY_FILTERABLE: Delivery chip accepts a filtered or + * relocated affinity mask instead of the + * requested one. Set it on the level + * which programs the delivery target; the + * core walks the parent chain and requires + * every level which implements + * .irq_set_affinity to be FILTERABLE or + * PASSTHROUGH. A chip which derives + * routing from irq_common_data.affinity + * must not opt in. The opt-in also covers + * the initial placement: the activation + * path must respect the runtime isolation + * filter before the first affinity request + * runs. + * IRQCHIP_AFFINITY_PASSTHROUGH: Forwarding level above a filterable + * delivery chip. The chip only hands the + * mask to its parent and derives no state + * from it, so it accepts a filtered mask. + * An unmarked level which implements + * .irq_set_affinity disables filtering for + * the whole chain. */ enum { IRQCHIP_SET_TYPE_MASKED = (1 << 0), @@ -584,6 +605,8 @@ enum { IRQCHIP_AFFINITY_PRE_STARTUP = (1 << 10), IRQCHIP_IMMUTABLE = (1 << 11), IRQCHIP_MOVE_DEFERRED = (1 << 12), + IRQCHIP_AFFINITY_FILTERABLE = (1 << 13), + IRQCHIP_AFFINITY_PASSTHROUGH = (1 << 14), }; #include diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index 5c5ebaee35f2c..3bdc5a388ea5f 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c @@ -54,6 +54,8 @@ static const struct irq_bit_descr irqchip_flags[] = { BIT_MASK_DESCR(IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND), BIT_MASK_DESCR(IRQCHIP_IMMUTABLE), BIT_MASK_DESCR(IRQCHIP_MOVE_DEFERRED), + BIT_MASK_DESCR(IRQCHIP_AFFINITY_FILTERABLE), + BIT_MASK_DESCR(IRQCHIP_AFFINITY_PASSTHROUGH), }; static void -- 2.43.0