Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1158197imm; Wed, 6 Jun 2018 11:20:43 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKtNqBo6V5SxLFgnqxhZtDc8sVVoucx8RgOVjtN8F2RmRRL0afZBhL8uno0+GPxiBdBEeuS X-Received: by 2002:a17:902:9b92:: with SMTP id y18-v6mr4303294plp.57.1528309243703; Wed, 06 Jun 2018 11:20:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528309243; cv=none; d=google.com; s=arc-20160816; b=fCB+a+MBc7iGhCxQts3HhEiIxPWjUDA+HKNMZHiM4q/3S17k+haD5xmx0jp5o4uHdu 1o0xrTTtnOFRzbrxIEF1hW0tZDzNv6hZx7p9aAqg/5Q/75v624usrBOpmwHz7igqxmN0 FGnsDTmLPjNskWsBoIb911PGa5WUsYqcfEMxXFHgFwUVKoVf6q9MPSaB3e+9OAlK/PzM PRitp402j0E+88NNU5RX3vUXtb3yNtX7is5ErmJx9VIDaG2eKJC6fLndBnMJEhAvjiUV TlcSk/amz2KFLgx1GOwYjbwW/HweN4pWWyUpCaxfJY6I5WlkepJvdXHBM+VQ2QcDOF2v ykMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=bQ7C8opPWkpi9XmywH657ZVOz9c5t1QbNZagtyVx4lE=; b=PT2TcNyfU7XwShzY/zSa8bWYRwKEJtVvRPx+1oT1S7kP6I1IoGpl6BLPkcPsu9/qtP XgvE1I4caX8RhHrI2evNfrxirbvitpkO3VBH54dZt7/5feQJirGI2ivoC0v1AgVuy4wB B+CBmJ4xwCM7xvPCMK/GDcSA1s5Ak2y1LYjtD6XxxQFhZ1NiNP95nahFX0WV05mLujBC ABVw5o6qhKLPArUZd89Cf7MJ3KoxmtQygb/R3nW0GBLpL7t712SV63zkJMDm5VdOWu3z pBbFvLsUVvBSGhUJu5jjoG0VvvrXqrM1BainhPMOntrXOQ8wGcUIXQK9VXjwMROS+uNm lLDg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9-v6si16173539pll.370.2018.06.06.11.20.29; Wed, 06 Jun 2018 11:20:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932959AbeFFQYP (ORCPT + 99 others); Wed, 6 Jun 2018 12:24:15 -0400 Received: from mga17.intel.com ([192.55.52.151]:61009 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752952AbeFFQXe (ORCPT ); Wed, 6 Jun 2018 12:23:34 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Jun 2018 09:23:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,483,1520924400"; d="scan'208";a="62323479" Received: from chang-linux-2.sc.intel.com ([10.3.52.139]) by orsmga001.jf.intel.com with ESMTP; 06 Jun 2018 09:23:33 -0700 From: "Chang S. Bae" To: Andy Lutomirski , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar Cc: Andi Kleen , Dave Hansen , Markus T Metzger , "Ravi V . Shankar" , "Chang S . Bae" , LKML Subject: [PATCH v2 6/8] x86/segments/64: Rename PER_CPU segment to CPU_NUMBER Date: Wed, 6 Jun 2018 09:23:17 -0700 Message-Id: <1528302199-29619-7-git-send-email-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528302199-29619-1-git-send-email-chang.seok.bae@intel.com> References: <1528302199-29619-1-git-send-email-chang.seok.bae@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 64-bit doesn't use the entry for per CPU data, but for CPU numbers. The change will clarify the real usage of this entry in GDT. Suggested-by: H. Peter Anvin Signed-off-by: Chang S. Bae Cc: Andy Lutomirski Cc: Andi Kleen Cc: Dave Hansen Cc: Thomas Gleixner Cc: Ingo Molnar --- arch/x86/entry/vdso/vma.c | 5 ++++- arch/x86/include/asm/segment.h | 5 ++--- arch/x86/include/asm/vgtod.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c index 5b8b556..833e229 100644 --- a/arch/x86/entry/vdso/vma.c +++ b/arch/x86/entry/vdso/vma.c @@ -359,7 +359,10 @@ static void vgetcpu_cpu_init(void *arg) d.p = 1; /* Present */ d.d = 1; /* 32-bit */ - write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_PER_CPU, &d, DESCTYPE_S); + write_gdt_entry(get_cpu_gdt_rw(cpu), + GDT_ENTRY_CPU_NUMBER, + &d, + DESCTYPE_S); } static int vgetcpu_online(unsigned int cpu) diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 8f09012b..492e3d1 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h @@ -186,8 +186,7 @@ #define GDT_ENTRY_TLS_MIN 12 #define GDT_ENTRY_TLS_MAX 14 -/* Abused to load per CPU data from limit */ -#define GDT_ENTRY_PER_CPU 15 +#define GDT_ENTRY_CPU_NUMBER 15 /* * Number of entries in the GDT table: @@ -207,7 +206,7 @@ #define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS*8 + 3) #define __USER32_DS __USER_DS #define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS*8 + 3) -#define __PER_CPU_SEG (GDT_ENTRY_PER_CPU*8 + 3) +#define __CPU_NUMBER_SEG (GDT_ENTRY_CPU_NUMBER*8 + 3) #endif diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h index fb856c9..9cd9036 100644 --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h @@ -96,7 +96,7 @@ static inline unsigned int __getcpu(void) alternative_io ("lsl %[p],%[seg]", ".byte 0xf3,0x0f,0xc7,0xf8", /* RDPID %eax/rax */ X86_FEATURE_RDPID, - [p] "=a" (p), [seg] "r" (__PER_CPU_SEG)); + [p] "=a" (p), [seg] "r" (__CPU_NUMBER_SEG)); return p; } -- 2.7.4