Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3067599pxj; Mon, 10 May 2021 17:57:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRUAQhx8DG4ll/lEDfUB2IR64qXjLBIzYCSb70r15EGo7LZPTC1pf9rZ+2HtRaCEwPJKrn X-Received: by 2002:a05:6602:1223:: with SMTP id z3mr20358914iot.97.1620694647798; Mon, 10 May 2021 17:57:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620694647; cv=none; d=google.com; s=arc-20160816; b=a9YuqR+Xh+r0xzSzPInvsgszviYhm7DYkfyAmT1mM0bM2uvP40k/sTNAWVRA7rEG9F Z1dKKjtAU2/vGQSvUrlzSSSbGCD5ql0Te+5TPuBWBheZC6gv/GpK1phwKxhdNpmixH6F t0nS6/h7/S2L3YcUuBPWkV2gv03jDT/VFLh8lS4wxuOQ2UTdGriSMJeuaOVzUiyF4b7j VC5FIXZij2QgP7fRPE8gbkewAG0lFvzcJAWStOGQb/kfpKKNQW7bSR101K0h6Ky5Vdhj TNgNhspqR2VbEDRmDRreWytv3qID91ZbRayVVoQ8FrpfCzlIXcewAf5FJt6klZznVjLB XPmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=b6Pm9Da93G0mktOYEh8EcyhbJDM2lkg5wM5WXiBhdNI=; b=GAZ4E6VrY7TnqaeBts98hlGUL0ECYLA5PIlJW4Gx1IohZTaJt4abJJamI5Lsk1stqI M/vO4rO5kewfkzu4bzn6wUI7hSbWvHJER71Ek65WZ5Rn5T4LVInv2HJdgnfvzMhUkFA2 2VaMmboKZKCtNgoCma2/+9fAaCMh2KBvjVay9t9rutjAXlDpkOHVdbeal30X/aIxyfqM TWdk1Ejde76iBvASm5oLYClTkL9Tffwrwrz62RFYOfqjUfpmUY4m3XW0HI9JE+oT+wPe 2dXEUegN9HWmRVe+NqpqvEztPiHL9/WZbzQ3gMqDXniHRgHRiU9vKeTzFuNxkLQHtKjq aONA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2021042801 header.b=rcB5SuUC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si1209661jaj.107.2021.05.10.17.57.15; Mon, 10 May 2021 17:57:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2021042801 header.b=rcB5SuUC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbhEKA52 (ORCPT + 99 others); Mon, 10 May 2021 20:57:28 -0400 Received: from terminus.zytor.com ([198.137.202.136]:37761 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbhEKA5I (ORCPT ); Mon, 10 May 2021 20:57:08 -0400 Received: from tazenda.hos.anvin.org ([IPv6:2601:646:8602:8be0:7285:c2ff:fefb:fd4]) (authenticated bits=0) by mail.zytor.com (8.16.1/8.15.2) with ESMTPSA id 14B0tdw72504247 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 10 May 2021 17:55:49 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 14B0tdw72504247 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2021042801; t=1620694550; bh=b6Pm9Da93G0mktOYEh8EcyhbJDM2lkg5wM5WXiBhdNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rcB5SuUCHDgtERvY7bJD/p5UE2Vpq4lD77CI8JAk3sXZuvyduuSn4cRIozXHoH1gv Z2o/RS+nKuViHw0Jf7vj964208LUZbzFT896zDVu9f4P0D4TCeX5G9aTD/Up9RoyR7 qQ1nTTQVmCfJGY3uUKy1t8L/11KKv+3wi/I5Bk/MpmV75UtugJP6equQCdQl4TqjIQ dCFenuElH9ZRVVnBKkvck3qvBcXHl/Xp3K3MMGJVWNLrTkMdJ+QiRIdAJgKdZziEFN XuUDIZRjuo7naWzXPsjrlFPAovMguC/tYbYK7vjxPG6BSD0VGL4W4Nc8joLSe4k/FT asO+iIMI7Q/rg== From: "H. Peter Anvin" To: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Andy Lutomirski Cc: Steve Wahl , Mike Travis , Dimitri Sivanich , Russ Anderson , Linux Kernel Mailing List , "H. Peter Anvin (Intel)" Subject: [PATCH 2/6] x86/irqvector: add NR_EXTERNAL_VECTORS and NR_SYSTEM_VECTORS Date: Mon, 10 May 2021 17:55:27 -0700 Message-Id: <20210511005531.1065536-3-hpa@zytor.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210511005531.1065536-1-hpa@zytor.com> References: <20210511005531.1065536-1-hpa@zytor.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "H. Peter Anvin (Intel)" Add defines for the number of external vectors and number of system vectors instead of requiring the use of (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) and (NR_VECTORS - FIRST_SYSTEM_VECTOR) respectively. Signed-off-by: H. Peter Anvin (Intel) --- arch/x86/include/asm/idtentry.h | 4 ++-- arch/x86/include/asm/irq_vectors.h | 3 +++ tools/arch/x86/include/asm/irq_vectors.h | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index 73d45b0dfff2..c03a18cac78e 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -504,7 +504,7 @@ __visible noinstr void func(struct pt_regs *regs, \ .align 8 SYM_CODE_START(irq_entries_start) vector=FIRST_EXTERNAL_VECTOR - .rept (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) + .rept NR_EXTERNAL_VECTORS UNWIND_HINT_IRET_REGS 0 : .byte 0x6a, vector @@ -520,7 +520,7 @@ SYM_CODE_END(irq_entries_start) .align 8 SYM_CODE_START(spurious_entries_start) vector=FIRST_SYSTEM_VECTOR - .rept (NR_VECTORS - FIRST_SYSTEM_VECTOR) + .rept NR_SYSTEM_VECTORS UNWIND_HINT_IRET_REGS 0 : .byte 0x6a, vector diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 889f8b1b5b7f..d2ef35927770 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h @@ -114,6 +114,9 @@ #define FIRST_SYSTEM_VECTOR NR_VECTORS #endif +#define NR_EXTERNAL_VECTORS (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) +#define NR_SYSTEM_VECTORS (NR_VECTORS - FIRST_SYSTEM_VECTOR) + /* * Size the maximum number of interrupts. * diff --git a/tools/arch/x86/include/asm/irq_vectors.h b/tools/arch/x86/include/asm/irq_vectors.h index 889f8b1b5b7f..d2ef35927770 100644 --- a/tools/arch/x86/include/asm/irq_vectors.h +++ b/tools/arch/x86/include/asm/irq_vectors.h @@ -114,6 +114,9 @@ #define FIRST_SYSTEM_VECTOR NR_VECTORS #endif +#define NR_EXTERNAL_VECTORS (FIRST_SYSTEM_VECTOR - FIRST_EXTERNAL_VECTOR) +#define NR_SYSTEM_VECTORS (NR_VECTORS - FIRST_SYSTEM_VECTOR) + /* * Size the maximum number of interrupts. * -- 2.31.1