Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3115063lqt; Tue, 23 Apr 2024 10:39:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXbguEucgiy9akSPO815kE3gruQNjR+zzKFGfKtupmIQs/31QEQJ7bcyj3vhwSZnqvVB/CePI3gwYpHqnOSg7uTMM/mhuNBPkaHcGoLBg== X-Google-Smtp-Source: AGHT+IGt6lBEWWZG63gadtBlyq+iWgIlfIgQjYS0g/BXkNFh7HAQZL+9ZAqkyQPtSMW4Nad9mdKB X-Received: by 2002:a05:6830:200a:b0:6eb:7bc3:12a5 with SMTP id e10-20020a056830200a00b006eb7bc312a5mr264408otp.32.1713893955605; Tue, 23 Apr 2024 10:39:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713893955; cv=pass; d=google.com; s=arc-20160816; b=g866/c2nOedVXMHPTA+6NOcd3e8eRSm8dGzpVIUK1NnAhTl+lvbL0vjgEjGos611MO 1fKqVp7Tgr78/8SGA9CjftfGlnqhsD9XufBXrCJXvQA/SS0C4W9Y0Ogvfq5rdrqZJvd8 awQzYh9+JGEEEhxlPNUPyxUXRNb8xcVIjNT+e5twcWyitv1LHXHaRje/VHFtEV1XuUN1 ZHGHcaPu/jXyMIki5inskjV+e+YlSTSX0G8WJfDlE0rnNneZUyyjrsYzk0FEaLrcD0/G yXMfc7ljntD8N4tAkmTYEh11jiJ+sgwjjgvnwRAzPr/NhAOWzpmQSLawEMXpKX5HXBG6 aHKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=bQF6LL5tfaahqoImfXO9guzQzgIIUqpiMvApyQxh/vM=; fh=4IBoZs+3h6h6AGI2zwHuwus2k8ZfhluO5SikKfX3GCM=; b=o/LQgccESIg8uW+COHmV0SHBA1SxNF3TAiPYPVZaAbgan3Pivv0lihEOuRHexui9wg G0iXrzxEXWFUFSk50K67xSNOyKsRwi4l2SR6WmkdL6PhtUPBkPM6D9G72VWYqnH/kmcg KbBi4E4VcgEB9K2RcLYKL9/oC/ZJ753Ucc9DJ4KKhYSaHx5B2xZZ4dmbjk/lc7F+T0S6 tN1v/qWgZSuDcK9JQOhmdku+tE2q3AdDswS6I5Mc3PaJH1rKqM03sjc7m5QIWGN3IJdC +e41bnBqidp/x8Vm21RzONsQfFwliYEgzuurEF2QwVFf1EDViRgpEbRxylA9hgyDfBqQ JDKw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HI8YBru8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-155689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ea10-20020a05620a488a00b0078f11d90182si13755713qkb.4.2024.04.23.10.39.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:39:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=HI8YBru8; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-155689-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155689-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2920F1C243A5 for ; Tue, 23 Apr 2024 17:38:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A29C9142E6A; Tue, 23 Apr 2024 17:36:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HI8YBru8" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 7EE65142651; Tue, 23 Apr 2024 17:36:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713893813; cv=none; b=ZoHxO4q9n7g7fefZ8o0gJfLcG0tCRtQmwsNNnJTfsis7Q+IvN7LpMhJVTVV20zd8N4wis/C4ERJOVwzSxeIi6mEX73c56OWO7qU5fPIBqa3kLEu5ESGXLm76TnH7hIrfJy0zaPFT+uwmGCXP0mtlXOdoa1oizyKT8WFuXndXebY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713893813; c=relaxed/simple; bh=vHveCBoYcLQh8NROkIMdspOYAm2kEY1xSagTRG3zNfk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hO4NkxVFKUzX1ln9Sgt1tVrcoObDz+PXIJvn8ctnrjoTLdDI/Nm6ncAfcToeNi6KQ0RErZQEXIW0LoO/MDTiOh/11Vqho/FspB0WJ/c4ow3UoWORm77P56FfU66xYpYu1A3YsA03Q9NniLUtGnKIh+QaOr8EsLECNhWQXClnios= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HI8YBru8; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713893813; x=1745429813; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vHveCBoYcLQh8NROkIMdspOYAm2kEY1xSagTRG3zNfk=; b=HI8YBru8XwiX9DokqoirXJ8QHiBFGTHr8uNqh8VNqLy4kNZUjaRXBI2/ tUwTDVSkc3HE9IIvdijqoY8u3MrBIwUkYHkdbkKNIvx5wxNsginesHoEA aAV8sOzEXOvsBn6gCnm75QXNzk4m9mERdDujEKpne0nH6kVYyxzUH46Jh yRkpMogMUSkU349pb6228N6/7aZQLgpV0rbzC5fIcnpfPdy6fEah1Rue4 Xf388wvRY3a16fvIbLYAfOfpvf33WKeZjUEimm83lny+HaC6+LLxZx8u3 RsP8NTWILD+pscb5NnzgagBm/+aLwfqIvkbJ9R78Ukr/r+JP8zwuGYvgb g==; X-CSE-ConnectionGUID: Ljro6GvHTrqzFmy0ShV9Bw== X-CSE-MsgGUID: yC7P864iQs+qKrg5fbzDxw== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9712424" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="9712424" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 10:36:44 -0700 X-CSE-ConnectionGUID: 6813K98VTTKaYFVGkrcS0w== X-CSE-MsgGUID: jJuW4cXiQbOaxBaDu9DBsg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="29097428" Received: from jacob-builder.jf.intel.com ([10.54.39.125]) by fmviesa004.fm.intel.com with ESMTP; 23 Apr 2024 10:36:43 -0700 From: Jacob Pan To: LKML , X86 Kernel , Peter Zijlstra , iommu@lists.linux.dev, Thomas Gleixner , "Lu Baolu" , kvm@vger.kernel.org, Dave Hansen , Joerg Roedel , "H. Peter Anvin" , "Borislav Petkov" , "Ingo Molnar" Cc: Paul Luse , Dan Williams , Jens Axboe , Raj Ashok , "Tian, Kevin" , maz@kernel.org, seanjc@google.com, "Robin Murphy" , jim.harris@samsung.com, a.manzanares@samsung.com, "Bjorn Helgaas" , guang.zeng@intel.com, robert.hoo.linux@gmail.com, oliver.sang@intel.com, acme@kernel.org, Jacob Pan Subject: [PATCH v3 07/12] x86/irq: Factor out calling ISR from common_interrupt Date: Tue, 23 Apr 2024 10:41:09 -0700 Message-Id: <20240423174114.526704-8-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240423174114.526704-1-jacob.jun.pan@linux.intel.com> References: <20240423174114.526704-1-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 Content-Transfer-Encoding: 8bit Prepare for calling external IRQ handlers directly from the posted MSI demultiplexing loop. Extract the common code with common interrupt to avoid code duplication. Signed-off-by: Jacob Pan --- arch/x86/kernel/irq.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index dbb3a19b3004..d652b0481899 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c @@ -242,18 +242,10 @@ static __always_inline void handle_irq(struct irq_desc *desc, __handle_irq(desc, regs); } -/* - * common_interrupt() handles all normal device IRQ's (the special SMP - * cross-CPU interrupts have their own entry points). - */ -DEFINE_IDTENTRY_IRQ(common_interrupt) +static __always_inline void call_irq_handler(int vector, struct pt_regs *regs) { - struct pt_regs *old_regs = set_irq_regs(regs); struct irq_desc *desc; - /* entry code tells RCU that we're not quiescent. Check it. */ - RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU"); - desc = __this_cpu_read(vector_irq[vector]); if (likely(!IS_ERR_OR_NULL(desc))) { handle_irq(desc, regs); @@ -268,7 +260,20 @@ DEFINE_IDTENTRY_IRQ(common_interrupt) __this_cpu_write(vector_irq[vector], VECTOR_UNUSED); } } +} + +/* + * common_interrupt() handles all normal device IRQ's (the special SMP + * cross-CPU interrupts have their own entry points). + */ +DEFINE_IDTENTRY_IRQ(common_interrupt) +{ + struct pt_regs *old_regs = set_irq_regs(regs); + + /* entry code tells RCU that we're not quiescent. Check it. */ + RCU_LOCKDEP_WARN(!rcu_is_watching(), "IRQ failed to wake up RCU"); + call_irq_handler(vector, regs); set_irq_regs(old_regs); } -- 2.25.1