Received: by 2002:a05:7412:9c07:b0:fa:6e18:a558 with SMTP id lr7csp82956rdb; Fri, 26 Jan 2024 20:26:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrhlBsrqcg+rgT1RQGbDKM5EQBRNvDGgLKtx/sQiGUaEoAuYCFLOwGEyLMpqQacIyIVHl1 X-Received: by 2002:a17:906:a04e:b0:a30:fc7b:5b37 with SMTP id bg14-20020a170906a04e00b00a30fc7b5b37mr698218ejb.62.1706329575078; Fri, 26 Jan 2024 20:26:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706329575; cv=pass; d=google.com; s=arc-20160816; b=p0SUbsfLJZvgo/0MmRVS9AWgppIrwvcQtgPei98oV4gGzNt6ZlOfEHMhu9aiChbb9W jfWiLE0bi9p9Z+KZzUZqwR7aStWHBw0FvMeomwIkm7B6DiMpK+C1/gRz1lr7QZE9cZir VUm7+puJ7cr77+BlsY2ovDVeXuv71sNU61+FtRYyqUz5B3eLnbpg4dpBTwYJZrjCnyWS jL6BYqVQ/CCLR8QMvxDcHs3y/5iSCYjInfLLeZH11bFA73d30nR3RfRA/UKzlc3UNubj 3WjCURAHizA8APRA0DXlfbgK9AlMsyEQ1AxeqOPHoiC4AO6nYrrookdAWsD8YHejdxOG 9P7Q== 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=Hz+dM7n1d3LChMbTYY8oWqylr6EvO0b3mjV1H/syzYo=; fh=EHxjn8iMtmEJ1Nwp2Nv05+TVlxb0pe4eSZ5ytBRUMYc=; b=Di/t4zl3kKnh390fdjJvXMdKyLM9vx/vun2cXvz9Ilvto/aPRl2naAknubNcpLMhLG ABgowhe1jwfwB6RxKr+IRjTr896LIC8Ndie2sO17AAWAqKkwunjh7KfreHanDtfiCJfy H/5RweOWEf8HgBODDFeQW52emsI4/rSWvNcBcAd82fgmt0P/BD1in8MdUjoKkKN1TOXe rrClMsogZAMKymxvHkWNsFuV4v1+tf10JuZr3jkKdlpIx5UFdG0XHPoa0c/GMBCatZbu cvcVB3DvsMoaKm/24APeJIc4LbqLii0Cg4v6EJmHZuE4eOkjA05vY5RtLAPGzWzzwsJ5 2BBg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R0KGBdX9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-40856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s21-20020a1709060c1500b00a2ebec5666esi1180679ejf.829.2024.01.26.20.26.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 20:26:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R0KGBdX9; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-40856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40856-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 768761F2727F for ; Fri, 26 Jan 2024 23:38:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B26FD5F544; Fri, 26 Jan 2024 23:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R0KGBdX9" 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 BC2065A7A2; Fri, 26 Jan 2024 23:37:25 +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=1706312247; cv=none; b=fqhZRQ9rChwt3FzSpnZFchBVZNgrx6O8LrMlnW/L/3PbxqnggyT7RlNgQQARX7k+gIF97q0oUOfTWhLClFmH0EsXvoFM2vHb7aUsz2NdEwruKCDMcvOeybQWSG4plM+3xqZIdoQo9ZHfkxt+/Jjhf3wtReg57i9Cc0cOPfwDvJ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706312247; c=relaxed/simple; bh=QJV30lNeix5myDOaVVsdK3RMyy1VcDvQ9cOpKGwrPwg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SbNrgXSESzomJSsD+2oeIZzRarAH+od2CCaXEiHhSN3YbtcQkZ3YvC3K5EC9G7mdpMASBaXX2PlBabghAZuhnyrWNMsFAksX9nCWIabEF5/sdcrawHqgPk9nbw3v6SZVzKqFrU8pnOr1PlF2cs7UKhm603z6yC7JZsUfn7nZO8w= 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=R0KGBdX9; 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=1706312246; x=1737848246; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QJV30lNeix5myDOaVVsdK3RMyy1VcDvQ9cOpKGwrPwg=; b=R0KGBdX9thnwx1KkeuOUNNwybbsWww76snbTLVeujKIj/aVeBIcRF9yz YLtLNBvpyhifmvCUnBZhECmsT0jUajSx6CakdR/Yhy9YblOB0E31g96RM +/4+ivpABHmFNMfRySda3wFJi+2gCw42xj7baAeOaBRTNGrFfTvEPLXXQ dm1UWP2UasNS7HHdBwZsk+c+BBY9yHMKRP6xT1WVZu2WvtRRzfrvsAQzK 6SLKSDunpCZ1l1msPj7YhtGvJ+XMG3MJAVsqdjJe5C/OELalHTvhRCSKb RDp8n5FcH3uSIk19WyQLqdUus0cIU1dPhTE4lvP8VO03WTHZw+niHNIRT Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="9990682" X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="9990682" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2024 15:37:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10964"; a="821290725" X-IronPort-AV: E=Sophos;i="6.05,220,1701158400"; d="scan'208";a="821290725" Received: from srinivas-otcpl-7600.jf.intel.com (HELO jacob-builder.jf.intel.com) ([10.54.39.116]) by orsmga001.jf.intel.com with ESMTP; 26 Jan 2024 15:37:21 -0800 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" , Jacob Pan Subject: [PATCH 05/15] x86/irq: Reserve a per CPU IDT vector for posted MSIs Date: Fri, 26 Jan 2024 15:42:27 -0800 Message-Id: <20240126234237.547278-6-jacob.jun.pan@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240126234237.547278-1-jacob.jun.pan@linux.intel.com> References: <20240126234237.547278-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 When posted MSI is enabled, all device MSIs are multiplexed into a single notification vector. MSI handlers will be de-multiplexed at run-time by system software without IDT delivery. Signed-off-by: Jacob Pan --- arch/x86/include/asm/irq_vectors.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 3a19904c2db6..08329bef5b1d 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h @@ -99,9 +99,16 @@ #define LOCAL_TIMER_VECTOR 0xec +/* + * Posted interrupt notification vector for all device MSIs delivered to + * the host kernel. + */ +#define POSTED_MSI_NOTIFICATION_VECTOR 0xeb #define NR_VECTORS 256 -#ifdef CONFIG_X86_LOCAL_APIC +#ifdef X86_POSTED_MSI +#define FIRST_SYSTEM_VECTOR POSTED_MSI_NOTIFICATION_VECTOR +#elif defined(CONFIG_X86_LOCAL_APIC) #define FIRST_SYSTEM_VECTOR LOCAL_TIMER_VECTOR #else #define FIRST_SYSTEM_VECTOR NR_VECTORS -- 2.25.1