Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1649737imm; Tue, 22 May 2018 07:19:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoPLl8JCaOmKyTeY91cLxNCxb5vAIIjKcsJovmbLaYM50UuX5Meqqwu+LlL/kT/WabFEdD0 X-Received: by 2002:a63:6f05:: with SMTP id k5-v6mr4861325pgc.62.1526998776455; Tue, 22 May 2018 07:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526998776; cv=none; d=google.com; s=arc-20160816; b=hlGKszpaVFLkTyuRgWyFJW8zeNlx72Z7H6CytdUK1Tu5Lcwnmqq9nVYJoXyXstmqp4 Ec7fNeZzmPyLgrZSENBPC5n3qP3qZESjEVkCbHnkJr0kc7WExPwErDo+Ki7QDEuW9619 ypuZjLCz7Y+0tZTyYzacpvoRj9QENZd+scaIL0v8NZ4nTehM7r7tWkyIjb8P5biMtCpz euWe8sYSzrkLyxa6cAO+GXmu8WMCrA5OzCvaJ5j7IjNc6tF5/ccNhCOzliZ7rdMu1onG lcF4xbMOrVQUut3rahHf5NXQeR65r2LVyhFzmUVAWk27J/3Se6XAaTELlYuXcq9CmQrQ hGVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=jD984oQeRXLiU1SSGjGsIySYX6MK9RCFvVVEMrBcQmk=; b=b4FDBvkxEbIMPTOya9bHEmR0wKB1WoldBJYr1/IScUwgGMv24PKGtW1ADBLFbUX6KD JJywc4vQsg6c3LgWlp57cKlBbod/Vs1aZveE+69+DZxs0UZxll2eWjnhRdV1Eh4B2PQM 7PCHZQ8qPBoJNsTEHXEcIjsL/FGgVN4aKfYOW7lgIdM04jRvwmG9add4iUecON4nLYtp GbvDk9MS9PPOb1R02nZg0Z6SuIRXXl7i6vcwfiKUsQjyUC35Iw2wNKG9884eMItRe8xA s7rjEdD1D1lf5jdfI1Xli0NqPKr0hLf+F4hx/42jOEyB6Xm/JfLZTXhKDivI5UXe6q7Q 7qHw== 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 x7-v6si17557466plo.303.2018.05.22.07.19.21; Tue, 22 May 2018 07:19:36 -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 S1751544AbeEVORq (ORCPT + 99 others); Tue, 22 May 2018 10:17:46 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:40103 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbeEVORo (ORCPT ); Tue, 22 May 2018 10:17:44 -0400 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fL86e-0007RG-Fg; Tue, 22 May 2018 16:17:40 +0200 Date: Tue, 22 May 2018 16:17:37 +0200 (CEST) From: Thomas Gleixner To: Dou Liyang cc: x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, hpa@zytor.com Subject: Re: [PATCH] x86/idt: Simplify the idt_setup_apic_and_irq_gates() In-Reply-To: Message-ID: References: <20180426054452.32308-1-douly.fnst@cn.fujitsu.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-1887395153-1526998660=:1711" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-1887395153-1526998660=:1711 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 22 May 2018, Dou Liyang wrote: > Hi Thomas, > > At 05/19/2018 08:32 PM, Thomas Gleixner wrote: > > On Thu, 26 Apr 2018, Dou Liyang wrote: > > > > > The vectors between FIRST_SYSTEM_VECTOR and NR_VECTORS are special IRQ > > > vectors used by the SMP architecture. But, if X86_LOCAL_APIC=n, it will > > > not be used, and the FIRST_SYSTEM_VECTOR is equal to NR_VECTORS. > > > > Correct, but that function has nothing to do with FIRST_SYSTEM_VECTOR. > > > > Oops, sorry, when I reread, my changelog even made me misunderstand. > the patch hided it. > > void __init idt_setup_apic_and_irq_gates(void) > ... > for_each_clear_bit_from(i, system_vectors, FIRST_SYSTEM_VECTOR) > ^^^^^^^^^^^^^^^^^^^ > ... > for_each_clear_bit_from(i, system_vectors, NR_VECTORS) > > What I want to say is: > >   In the APIC=n system, the FIRST_SYSTEM_VECTOR is equal to >   NR_VECTORS, So all entries has been set by > > for_each_clear_bit_from(i, system_vectors, FIRST_SYSTEM_VECTOR) >        ... > >   the following setup code for APIC=n is redundant. Just setup gates for >   APIC=y. > > If it is OK, I will send v2. Right you are. I got confused .... --8323329-1887395153-1526998660=:1711--