Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp473231imm; Mon, 4 Jun 2018 22:20:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAlLdvwtTxuDgzl/LwyWZSrdZGogHVJQJMUndAq2xHousw6pFu4pCl6U+Kjme4mnjD+dsZ X-Received: by 2002:a62:8703:: with SMTP id i3-v6mr14223677pfe.115.1528176038593; Mon, 04 Jun 2018 22:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528176038; cv=none; d=google.com; s=arc-20160816; b=l8WShaPCAXsHLAqUdmS74pSyi70ujsloHd3PEeMrxp4+e9m3AncrHF4bTVcYP5TJO9 vq+8pfKdCA5fTdzN+/tAjAHU0xIC7DOpXk0pyl1YqIdVTpEWGAAEdSS/DcZqzIKHfgRE mEcD27GI+MDkPOX56fW19vev0wt5SoJIexfRfLhbJnetGBH7DOvXHEP1lCC87qDdCq2L RW4T9FKWveT0fHnnQ0NXQiLw5aTg7O6p3MVyQQhv5cl/KzBa16ANvZfqcmLHj9JlYtHj SzTM5971D8SD+c3yKR3UijaVWC46ox/YgkNQ8D4MrGM2qY7AkIYpyCAA4Z+itXrW/dXO DuJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=f1E9J4/csNPZ68dNdsRd8yWdO2l3rQCie93LikkSz1U=; b=z8zRRLSUNnt57k3Go/jYMQjvEh5YMJPBEgbWjucJRM9dCD65tbCAV7Yd4JnAQNyu2v FlZIXU+IP+COpGacWKK57IRezMnkgE6lR0fwG2otN7WU0PRhzh9j30oFnTlU146twF9I IfGgNVv15eBD/8+ihnfkN10k8QdntRURhl8k6uVMhxoUARIox4YCNqzRWNow3RFn95MO YGlLDA7oauYBa4boj3+i42TCNOs5E8kleARBdTMQaViUCkqnpqT2iYEB7OB6Pl8SbIN1 DjHYnKebGXR1KkBSyzBK3SNin2s9SlTfO/RAkwQyGJeoLvmJO+iRR7WJndfmbt/Fd19V 0RVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@NextfourGroupOy.onmicrosoft.com header.s=selector1-nextfour-com header.b=BZ8eEhYB; 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 b9-v6si8394015plx.286.2018.06.04.22.20.24; Mon, 04 Jun 2018 22:20:38 -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; dkim=pass header.i=@NextfourGroupOy.onmicrosoft.com header.s=selector1-nextfour-com header.b=BZ8eEhYB; 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 S1751601AbeFEFTy (ORCPT + 99 others); Tue, 5 Jun 2018 01:19:54 -0400 Received: from mail-eopbgr30068.outbound.protection.outlook.com ([40.107.3.68]:19456 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751497AbeFEFTx (ORCPT ); Tue, 5 Jun 2018 01:19:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NextfourGroupOy.onmicrosoft.com; s=selector1-nextfour-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=f1E9J4/csNPZ68dNdsRd8yWdO2l3rQCie93LikkSz1U=; b=BZ8eEhYBLMd/7GwAxgYFoBXTCISmQCtJejr+pF7UccGEO2cwVqi1pBhE7OBS490dpi0p8pSjanvbuydm4eFwIOVyamafqyPYafPEfckKx+7hyEaoIbetlnz392dZ7I9U86ofrsj38LHEOz34JTL8nBi+GcQK7r5miH/WUwezmaQ= Received: from [10.10.10.110] (194.157.170.35) by AM4PR07MB3331.eurprd07.prod.outlook.com (2603:10a6:205:a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.841.9; Tue, 5 Jun 2018 05:19:48 +0000 Subject: Re: [PATCH 6/6] x86/vdso: Move out the CPU number store To: "Bae, Chang Seok" , Andy Lutomirski , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar Cc: Andi Kleen , Dave Hansen , "Metzger, Markus T" , "Shankar, Ravi V" , LKML References: <1528140269-26205-1-git-send-email-chang.seok.bae@intel.com> <1528140269-26205-7-git-send-email-chang.seok.bae@intel.com> <8a41304a-3517-003a-badf-1ba8f7ababe4@nextfour.com> From: =?UTF-8?Q?Mika_Penttil=c3=a4?= Message-ID: Date: Tue, 5 Jun 2018 08:19:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [194.157.170.35] X-ClientProxiedBy: HE1P195CA0015.EURP195.PROD.OUTLOOK.COM (2603:10a6:3:fd::25) To AM4PR07MB3331.eurprd07.prod.outlook.com (2603:10a6:205:a::12) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(7021125)(5600026)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);SRVR:AM4PR07MB3331; X-Microsoft-Exchange-Diagnostics: 1;AM4PR07MB3331;3:EA+K/NA4JE2vTRJrkS4PttdFKKKV16dhqPQPAYthb5MFohWsyK5wUDexIyC9XKLS3B2vqk7RHxvIuw6tkVIGUlPk7p5deS5Md0AvR+2wW8ytw2EtGJVj2P+IV7HhNoc7LEJTpP6At/jQY5psTKrwfkrmNL3AaaK9CJUKwUZAC1fpjuZfdDfWi/GMZAEC3WVboxVL5XSY3QSbUksqSmvhfYqQkbwOxYMf6CklMdGSiZId+BTB3im9XvmxDT4qDxUr;25:MXXjS1CYEYdwtxOxN4h3rhGsC0aClesr2TChPor0EoiEG2ypZgoUVKqiO4Dbstb545q9IPIzSsHOU6JT6f7M5q+O7TMa7/OS4QfaXV0t7vrWnAMJQtQ1DdP+HsfAB4mCxDDPiKy4b3gZzkV5eprhILb+UOVlIZz9dkTvzCu1bQXTDzELie9JNbvG88MJlgH3Bog0wjb1ibAq5xNlyBMl6lbUY6DsZqtsjPUk2ulRBxQYvAmEVYeK5OTZL5KaThWf2BI3ucYMkjdycjl5tLBR5HttSHnxwhuWIDki7/l0HdHpQVw52somVSkPXOfmBTLgokiz4dPOQtzHO9kjVO+FGQ==;31:AY+jBfvL8zsN6JEnBYMU+LYhggTKD0nZ360NPg/qkA6NCHSl/0143EWZ6NHTCOg+QEPyBpJVtm03zfofCCNkAdVNJvqnDomixIifptalw620+htPozpsH4QdxIzSKHJB6fycIEZptAS1OBmfKq8KhyWPRQXswvxsYVFlwW/yX3Lwxgc+sM/cJbWHzQ+bde2VQhCshFIcjtao5x1UzTrF9ZFH1HosE9PZJH5h6P2WTLY= X-MS-TrafficTypeDiagnostic: AM4PR07MB3331: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=mika.penttila@nextfour.com; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231254)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(2016111802025)(6043046)(6072148)(201708071742011)(7699016);SRVR:AM4PR07MB3331;BCL:0;PCL:0;RULEID:;SRVR:AM4PR07MB3331; X-Microsoft-Exchange-Diagnostics: 1;AM4PR07MB3331;4:aUHAVEIjCeiG+jHzK6scalfnWtqVuasr4UzvqJfgrP16W4HfilSCYOwCxQzLZxmqyfnh+K22eq0xFALsh5ot2g6r4R2J0krOCmWEngoPfTA3JL0zSk/WpnqiXGDZZnUmu2I8q0eDQWUnJ5GCo0qR9TP08JyKbvCWkMaA3wx67qodoDSNWtjcEv4Coh45JQfv6qez2gGCc4ghK93ITzc8idXNj0hjiuY1tU9htOR+891HMNK20FMsEv0c0B/1vvVJIzNlejWnkcrgYvurrK/rCA== X-Forefront-PRVS: 0694C54398 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39380400002)(376002)(346002)(366004)(396003)(39830400003)(199004)(189003)(6116002)(106356001)(68736007)(64126003)(3846002)(105586002)(86362001)(31696002)(305945005)(6666003)(7736002)(186003)(16526019)(36756003)(77096007)(5660300001)(26005)(7416002)(23676004)(2486003)(52146003)(52116002)(31686004)(65826007)(53546011)(386003)(76176011)(59450400001)(25786009)(8936002)(93886005)(4326008)(6486002)(81166006)(8676002)(81156014)(956004)(476003)(2616005)(478600001)(486006)(11346002)(446003)(229853002)(47776003)(58126008)(53936002)(54906003)(2906002)(97736004)(65806001)(66066001)(65956001)(316002)(230700001)(110136005)(50466002)(6246003)(16576012);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR07MB3331;H:[10.10.10.110];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nextfour.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtBTTRQUjA3TUIzMzMxOzIzOlRzeXlQZW1jb0JkQjRrLzFlSFU1eVB5QmtD?= =?utf-8?B?dGlUOXp4Smhjc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YYwl/0YBFNUXwJPO7tMifKaFs3JxnMURfk6QFPgmSHbmifs3wu1kzCrhrJ98w3SYJYfiVkTC2WButfcC+SWxszwQDW9L050Ag=;24:K2Bvg+VkLZgVlK6YO95dalZJt1GK4EN3iYE6VsXC7UvgkPU6h2qnAF6N2OG8D3ZFdZOFY6gQ7RsKukStlbXw7NaFFBntGbvK1y7DnLFmNyg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR07MB3331;7:OMUeu7ytcLKTmfiJmvql8p9sZ80U2oUynbqnzHFLoF2c4MCTF4+eyP90+b5EXoonJcgXqe9Vv6LRdaCQ4QvjuSH1CrhJ0yZDcxhnwvqi7DNn+WaNlpzMzGdiitZ+LGNA2X9HvRkSWpdgTLRP7XsughZA+JGmTkWupQzo8UuxBo3PcNT4Whbk6RhHahw/LXie+MwGWFuC6dBquArri2UH7hF5VVMq7g8RSBOt58aBjehGVXQGjcsxIIiRWiZrWB7G X-MS-Office365-Filtering-Correlation-Id: 0a1593ff-beda-423d-8908-08d5caa3f659 X-OriginatorOrg: nextfour.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 05:19:48.1810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a1593ff-beda-423d-8908-08d5caa3f659 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 972e95c2-9290-4a02-8705-4014700ea294 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR07MB3331 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2018 07:44 AM, Bae, Chang Seok wrote: >>> diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c >>> index ea554f8..e716e94 100644 >>> --- a/arch/x86/kernel/setup_percpu.c >>> +++ b/arch/x86/kernel/setup_percpu.c >>> @@ -155,12 +155,21 @@ static void __init pcpup_populate_pte(unsigned long addr) >>> >>> static inline void setup_percpu_segment(int cpu) >>> { >>> -#ifdef CONFIG_X86_32 >>> - struct desc_struct d = GDT_ENTRY_INIT(0x8092, per_cpu_offset(cpu), >>> - 0xFFFFF); >>> +#ifdef CONFIG_NUMA >>> + unsigned long node = early_cpu_to_node(cpu); >>> +#else >>> + unsigned long node = 0; >>> +#endif >>> + struct desc_struct d = GDT_ENTRY_INIT(0x0, per_cpu_offset(cpu), >>> + make_lsl_tscp(cpu, node)); >>> + >>> + d.type = 5; /* R0 data, expand down, accessed */ >>> + d.dpl = 3; /* Visible to user code */ >>> + d.s = 1; /* Not a system segment */ >>> + d.p = 1; /* Present */ >>> + d.d = 1; /* 32-bit */ >>> >>> write_gdt_entry(get_cpu_gdt_rw(cpu), GDT_ENTRY_PERCPU, &d, DESCTYPE_S); >>> -#endif >>> } > >> This won't work on X86-32 because it actually uses the segment limit with fs: access. So there >> is a reason why the lsl based method is X86-64 only. > > The limit will be consumed in X86-64 only, while the unification with i386 was suggested for a > different reason. > > Thanks, > Chang > The unification affects i386, and the limit is consumed by the processor with fs: access. The limit was 0xFFFFF before, now it depends on the cpu/node. So accesses on small number cpus are likely to fault. --Mika