Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1418067imm; Wed, 6 Jun 2018 16:00:23 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKekZTXOG30wzABJb1NxTUcdwZfRPqqSGm4xmsqTWH0n8vHziYHAu+LUnoNHXIoxr1aiT59 X-Received: by 2002:a62:d453:: with SMTP id u19-v6mr4201640pfl.203.1528326023220; Wed, 06 Jun 2018 16:00:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528326023; cv=none; d=google.com; s=arc-20160816; b=dePdHAgnRg+kpGHgCelYoguuz47Q7btg1bkOCmVFSChfmBG9nWwCzgCqjdNm/0VjM5 vreyg2R+GQpTB2vzSkayx4c2dPjX8UWaaRN1SU6gbU34LVPlnKXtJXy+Gbyt70Wy6iI1 JXF2zgctbJ29TxjVzfooGQ6fvF2hzs6eAPkIcp2Z6ko9twJZArf0tfFZwlmZ4GCd+ewI HTyT2asUibqXFCeuUsGybeoTCTyc8NMflyF3L2YVMxDgXwWLWYxGp1xo32qeQnMBFAtJ j1buyrNIU1rzmAdLOlpf95TDKyEi6jLcPG6AY5w+FFkIrKfaSpdQq28fjjyKesdjOJd+ ezEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:arc-authentication-results; bh=rJ8yqmBoGEvu6YPYXCm6ZvAFo4o1UTH52L+lu9OULjc=; b=OGUe1DVEe9srEtr0XrCWN3xnnIeW7iVszAOnoUU4D0yVYsAK96xxTUBfOuDRKOJOFk GWn45JFgNg+xm5hHAGG0r2zsOPAcZYSH96gHtLL0PA2iVcid9FmMDChaAuvLaopIxIS7 nRqjm8jkStOdimvZL9aGaVSN80RxwPiu+RthaacK7x9cgO3lKPKPZ+PpFEYfdAUmMip0 NACiakBSXAIZRrTmxKk+0zMyhiOUE5eChymiK5+Zn5ilahDf+iU/yy9xw9hw0RnS+pJP L5Ag8k6kWZnNRQbbeGsiokBbHzcbnUYRSs7JNqU0eUIHpPM0e0brVJmdZR6BARgQDt02 H8kw== 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 73-v6si25327234ple.157.2018.06.06.16.00.09; Wed, 06 Jun 2018 16:00:23 -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 S1752709AbeFFWxS convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 Jun 2018 18:53:18 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51431 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752026AbeFFWxR (ORCPT ); Wed, 6 Jun 2018 18:53:17 -0400 Received: from wld62.hos.anvin.org (c-24-5-245-234.hsd1.ca.comcast.net [24.5.245.234] (may be forged)) (authenticated bits=0) by mail.zytor.com (8.15.2/8.15.2) with ESMTPSA id w56Mr9b71974975 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 6 Jun 2018 15:53:10 -0700 Date: Wed, 06 Jun 2018 15:53:02 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <1528302199-29619-1-git-send-email-chang.seok.bae@intel.com> <1528302199-29619-8-git-send-email-chang.seok.bae@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Subject: Re: [PATCH v2 7/8] x86/segments/32: Introduce CPU_NUMBER segment To: Brian Gerst , Andy Lutomirski CC: "Bae, Chang Seok" , Thomas Gleixner , Ingo Molnar , Andi Kleen , Dave Hansen , "Metzger, Markus T" , "Ravi V. Shankar" , LKML From: hpa@zytor.com Message-ID: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On June 6, 2018 12:07:15 PM PDT, Brian Gerst wrote: >On Wed, Jun 6, 2018 at 1:16 PM, Andy Lutomirski >wrote: >> On Wed, Jun 6, 2018 at 9:23 AM Chang S. Bae > wrote: >>> >>> The new entry will be equivalent to that of x86-64 which >>> stores CPU number. The entry is placed in segment 23 in GDT >>> by bumping down 23-28 by one, which are all kernel-internal >>> segments and so have no impact on user space. >>> >>> CPU_NUMBER segment will always be at '%ss (USER_DS) + 80' >>> for the default (flat, initial) user space %ss. >> >> No, it won't :( This is because, on Xen PV, user code very >frequently >> sees a different, Xen-supplied "flat" SS value. This is definitely >> true right now on 64-bit, and I'm reasonably confident it's also the >> case on 32-bit. >> >> As it stands, as far as I can tell, we don't have a "cpu number" >> segment on 32-bit kernels. I see no compelling reason to add one, >and >> we should definitely not add one as part of the FSGSBASE series. I >> think the right solution is to rename the 64-bit segment to >> "CPU_NUMBER" and then have the rearrangement of the initialization >> code as a followup patch. The goal is to make the patches >> individually reviewable. As it stands, this patch adds some #defines >> without making them work, which is extra confusing. >> >> Given how many times we screwed it up, I really want the patch that >> moves the initialization of the 64-bit CPU number to be obviously >> correct and to avoid changing the sematics of anything except the >> actual CPU number fields during boot. >> >> So NAK to this patch, at least as part of the FSGSBASE series. >> >> (My apologies -- a bunch of this is because I along with everyone >else >> misunderstood the existing code.) > >The sole purpose of this segment is for the getcpu() function in the >VDSO. No other userspace code can rely on its presence or location. > >-- >Brian Gerst Unfortunately that is not true in reality :( -- Sent from my Android device with K-9 Mail. Please excuse my brevity.