Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp698814imm; Wed, 6 Jun 2018 04:45:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ487Y4SR9RLri0MOJqTHDVdwLsIPh3IgzBU+zFIui1XmtXHrrvnpWWdjDMoCkvG66AEcmv X-Received: by 2002:a17:902:8:: with SMTP id 8-v6mr2824542pla.287.1528285531354; Wed, 06 Jun 2018 04:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528285531; cv=none; d=google.com; s=arc-20160816; b=JGSl9RKfX6w4DW9L5KVXzIrcWMaL1b5O5z/Fra9RjjaQwcXbEwDgfA3ZHHwnLIjgx4 Tl840nkDV3/2mpmkGsgyCVFG3R86jHukPDCCVKSKmrGWV/+3lcEjftWg1zki6EegGH0+ iZEAKqqZ783XRrBjVaDOLGiBW5X89pQGThH29N6V2o1xOOIydBAQXz3siwHEWwO8kU9K GwqzmJi2TEgM+C4qbuxElZEsADed3UrVOvkls8sVDtn9MFTe4FVvRE3IvjFX7b8TLAJw RTH557b6SWm3ziPYRS2NOXx+677Jm5mmLIkkXJd6W2saHvjgLzuGiDo9n6Hmg1K2LyYS RJIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=PqbozRnhSnd9Y3OA9iQYnh+ifjzuqORP9wj/wtOGogo=; b=oiP/2uplzWH+9H8IMZhhiq6o8OpgFkX/aEZUDGJDZ5Hj9Jq00uzgEBdWAk+pTZy369 CXBQ0V1MgtWRvoRdGPUN7P5mJe4fw2huraJiKhGR8IP9IERMnz31ZrLFqfV4O7gFHaqs 7nGFMg54qP6BGXAGl+cXb8WSiR270NPtwDODYVDpFUX+OqGNbKyQ/wgmsOUaZBbnvP22 8TN1O1XcylyOEGLXrtGNcnyQztzBZvHopGd6oDeHTUd/xlA34C6WOXaygBYFA2tKCXuQ 23Bis5pBnsJQ54wAf9JoQBQ2/JFakzMswq2SIxyo+jX11MN1KxbfPLxpa0W3JpGuPkSL 7cJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11-v6si17667044pgq.506.2018.06.06.04.45.17; Wed, 06 Jun 2018 04:45:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752255AbeFFLoj (ORCPT + 99 others); Wed, 6 Jun 2018 07:44:39 -0400 Received: from terminus.zytor.com ([198.137.202.136]:35735 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751730AbeFFLog (ORCPT ); Wed, 6 Jun 2018 07:44:36 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w56Bhxph1764612 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 Jun 2018 04:43:59 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w56BhwRv1764608; Wed, 6 Jun 2018 04:43:58 -0700 Date: Wed, 6 Jun 2018 04:43:58 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Dou Liyang Message-ID: Cc: douly.fnst@cn.fujitsu.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org Reply-To: mingo@kernel.org, douly.fnst@cn.fujitsu.com, tglx@linutronix.de, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <20180523023555.2933-1-douly.fnst@cn.fujitsu.com> References: <20180523023555.2933-1-douly.fnst@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/idt: Simplify the idt_setup_apic_and_irq_gates() Git-Commit-ID: 336628128826a9acb045571a960e32e4414ccb61 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 336628128826a9acb045571a960e32e4414ccb61 Gitweb: https://git.kernel.org/tip/336628128826a9acb045571a960e32e4414ccb61 Author: Dou Liyang AuthorDate: Wed, 23 May 2018 10:35:55 +0800 Committer: Thomas Gleixner CommitDate: Wed, 6 Jun 2018 13:38:01 +0200 x86/idt: Simplify the idt_setup_apic_and_irq_gates() The idt_setup_apic_and_irq_gates() sets the gates from FIRST_EXTERNAL_VECTOR up to FIRST_SYSTEM_VECTOR first. then secondly, from FIRST_SYSTEM_VECTOR to NR_VECTORS, it takes both APIC=y and APIC=n into account. But for APIC=n, the FIRST_SYSTEM_VECTOR is equal to NR_VECTORS, all vectors has been set at the first step. Simplify the second step, make it just work for APIC=y. Signed-off-by: Dou Liyang Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20180523023555.2933-1-douly.fnst@cn.fujitsu.com --- arch/x86/kernel/idt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/idt.c b/arch/x86/kernel/idt.c index 2c3a1b4294eb..74383a3780dc 100644 --- a/arch/x86/kernel/idt.c +++ b/arch/x86/kernel/idt.c @@ -317,15 +317,12 @@ void __init idt_setup_apic_and_irq_gates(void) set_intr_gate(i, entry); } - for_each_clear_bit_from(i, system_vectors, NR_VECTORS) { #ifdef CONFIG_X86_LOCAL_APIC + for_each_clear_bit_from(i, system_vectors, NR_VECTORS) { set_bit(i, system_vectors); set_intr_gate(i, spurious_interrupt); -#else - entry = irq_entries_start + 8 * (i - FIRST_EXTERNAL_VECTOR); - set_intr_gate(i, entry); -#endif } +#endif } /**