Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp153955lqe; Fri, 5 Apr 2024 16:34:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFJYJTBvTcIDowq4VMJwkrHSm+wC3Rnv57kuiRp0XkrUcX8CjwVamCM3zuD+9fuPmvKmnL3k6jCCNdSEtbnnXIOKXndDQvyoUfpxTyMw== X-Google-Smtp-Source: AGHT+IHzfeJFlYYlIJVyOdF8e1/bNE6h2LxDf4Ggc8lJyzS6OC7jLNAmSvxz0t+L+q+3ENCNM/7d X-Received: by 2002:a05:6a20:9782:b0:1a3:62d1:2906 with SMTP id hx2-20020a056a20978200b001a362d12906mr2895394pzc.14.1712360041986; Fri, 05 Apr 2024 16:34:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712360041; cv=pass; d=google.com; s=arc-20160816; b=Sy3lZsG+er9BdBmTIqezF0YTiETAZrEjyzMcFy0RCiq7umgGXCjUFUip7cb+cZrqmv 7duAqJXoP1bXPG0/nwQ2kOAejrv33gpbsZDo9malAbwD7Bplp4VC6i2fP4VBgMc44ITO +4WoUWGvU27gjsjxjiMK0RIMObWvR7ZvZe00Eo/5bSbpO9vZ+MUfxrp2EV2UfrpKyAHV SAu8NittIa1Z7+KejKFZGMceNaoYcwCQfm/ujeERQVRnhxb05wHuW+KhmlP5gZRp9Qve ZyEnzimYSjHlSdJO50KurhRPvpYvC8IXOi+UZ1zZLdQ7ZgFafgJk7YnjAPd4H0/hbrXr qgpg== 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=B02VJn7yCjeBibZTMxxlIcqb8DDbE0pEV3vB6pnkk9Y=; fh=bhqlPbXjHBxQzd6TvgdNdBs+Har8pRoecv6ZHfN2TWo=; b=g2d0bXIYISXu0csA58hzSJG3hi2ZcnlgHmr77fc/aPmcUn0BdWm7jWtiWUUzE7qpE3 F0EmQp1JSGIm78sZL/tepkysLig55D8GnptNbHCz5ZETosFJzB20sUMnMe22otqCjSk5 CFWo9KGAFbobVMx5yRsUXzxNLkTm3kAJGCfHeEFJTdoky8cMz69SpNpZSd4il97i1DbT WhWFGaiLe0VQzkdonWhQ77WSOLqNWrR5f9E2ttM9Go+sZdqeqNJ4HdBv7YgtYGrszS59 DKui1xi09PM+bv4w4jjyj9W7/5j7N5uHyR10c8W+fpuJiXAf50zv56sJrEFk8V7xV/ao +pwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YiO91EgE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bv125-20020a632e83000000b005e838ac3123si2034590pgb.777.2024.04.05.16.34.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 16:34:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=YiO91EgE; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-133673-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133673-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0105F284F0E for ; Fri, 5 Apr 2024 22:28:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0D8B179671; Fri, 5 Apr 2024 22:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="YiO91EgE" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (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 21D3717799D; Fri, 5 Apr 2024 22:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712356012; cv=none; b=HWTRAL80cUmV2gpAHybi5sWu/cAuyXDYsTXAT9mX35H1xDu/MJioSJqfegcHU7YQKqJbzO2W1Mjepgtmh6a2ZcPpnWUb340Q/hPuHq6BBEZxUr1lE7GpnQZJthfEIxjBXi24nqBYfoQZZ1yraEs9kX2yyO4jopM3BQQRVcUdoVQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712356012; c=relaxed/simple; bh=aMX9sw5AlWfnuSsCSRnkGkG0cgUx+sH4S0oPTBTmTuo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hgT7YrcoypaPQGq9aIqoGTXq9gLx0XiflV+VAsLpH8Wll+42W5fansXaxyQfyPse/7HQuMFiZ7EE3sWBQVXvAtrtoUdJOfaykZSVMpZVAiR2PMXTsJYcOvaPzlhXy/+KbxGvcxoNrGhMIoF5XK7EhzJyHzizX4zPskqMsQ+HTwQ= 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=YiO91EgE; arc=none smtp.client-ip=192.198.163.10 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=1712356011; x=1743892011; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aMX9sw5AlWfnuSsCSRnkGkG0cgUx+sH4S0oPTBTmTuo=; b=YiO91EgENp/mq0TUFgdy5gCVa2pDXiz9IZe5WZMrS2au+UAWT1eB6H+K AtY4aJmkZcA+LkQeSvEPx6svC+99l+ayVmFwztNLgdKOpGPfMe9U2SCrC JoysUApXB2MxdyouFGpP87xucQ+XlH0zZ/QlSLOQgiEFyeBmoCsTP4SY3 8vkZSdMcAiREgIkDglRDz4MATWFxz60N/3ii3xsDOz3z1P4PYZn0mtch1 yK8sQCCKAnmM7AzCw0D0aKw27GuVDGgi6H2M196im9P92Y9eIaUkPjHW2 mn858elRPPLtVlyOAS/NTXVFulYBnjeyuQTJURFg6QGVqJnC0ix8qqeEu A==; X-CSE-ConnectionGUID: mUtZWD4JQ5uqx6vWDcfugA== X-CSE-MsgGUID: TBEFnWwkRsGP1Wr+EqKOwg== X-IronPort-AV: E=McAfee;i="6600,9927,11035"; a="19062762" X-IronPort-AV: E=Sophos;i="6.07,182,1708416000"; d="scan'208";a="19062762" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2024 15:26:50 -0700 X-CSE-ConnectionGUID: un+Vo/c2SMSc7Y7UhwtFGg== X-CSE-MsgGUID: uqcZv7bYQ1qshj4GMGZmpQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,182,1708416000"; d="scan'208";a="23928326" Received: from jacob-builder.jf.intel.com ([10.54.39.125]) by fmviesa004.fm.intel.com with ESMTP; 05 Apr 2024 15:26:48 -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, Jacob Pan Subject: [PATCH v2 07/13] x86/irq: Factor out calling ISR from common_interrupt Date: Fri, 5 Apr 2024 15:31:04 -0700 Message-Id: <20240405223110.1609888-8-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240405223110.1609888-1-jacob.jun.pan@linux.intel.com> References: <20240405223110.1609888-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 f39f6147104c..c54de9378943 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