Received: by 10.192.165.156 with SMTP id m28csp464576imm; Thu, 19 Apr 2018 02:02:28 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/TsdYHgI2dshRWtTH8cvzzr45FxvAAppT5tQo//ztR6ybK1ch0tEE4w8n69o3qUsr3kyRf X-Received: by 2002:a17:902:144:: with SMTP id 62-v6mr5334586plb.202.1524128548122; Thu, 19 Apr 2018 02:02:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524128548; cv=none; d=google.com; s=arc-20160816; b=EBLAwjkCkr59n5WTSPeZEZtKJTFWYxRACKMyp9WQkPRzC24e4yomRDFaSvvbbYovWD rMOk5pYxSah3fOBF+8cbWSZXXzYOyUcg3aR1rl1LmWannP0+nf6H3HlrEunJZeCvf+PJ kRx2vikkGsqFZ5RCJjxfZU6UAWRih4JGEX8F4Cq6vi9idF8bQsGl5IetPdRzlsr4Ts3l a+d4RmyrdqRPZVEGCh23Ww6xLiHzYbBlycQfPCnbPhyh3V7c5tdLqxDeC/mrzkYAemE/ VOeuJGGG2YpsD8wc4vgR4lxP20JQiBe8BOg08HDr432Sof7nIdPmOTU62lhhb2p0pXcn /pOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=33TUa3kOXiFxEu5dhNPg21/9Axv5yQYD8T8JOs+4AGI=; b=UpTnYz6i7ERzhxIBAISAs28AK1Spm72D/H50qzceQ6+qLnTanTSq/9i8K2YXjjjq7h 0lgCyvXiRnldLdxDsTWcjrfUHiKrk7eCpA/TMHXAbWi59fq4Rfj3xbcRQcz4t5a4H7iR Bis6VIBWgNu9sG7U8b33p3rB7ur77DJdMRKssQoxbwfhdxP/NVSbpb6h880Pt+4ae/xp JaNK27yO+SVfbvhL7ex1hJIHthOt0E7Un+ZiUJFfgjmRXaUM4qK7JCsR2fAu7NnDm3OV QzZWPTrcL/knT2qSUtcfxAOXU0TDmS6FVqb3YV84apY9tDXP7XGmZaHBG7qyCYmgGsxg 9aaA== 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 136si2688095pgf.530.2018.04.19.02.02.14; Thu, 19 Apr 2018 02:02:28 -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 S1751882AbeDSJBB convert rfc822-to-8bit (ORCPT + 99 others); Thu, 19 Apr 2018 05:01:01 -0400 Received: from smtp-out6.electric.net ([192.162.217.191]:64060 "EHLO smtp-out6.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750964AbeDSJAs (ORCPT ); Thu, 19 Apr 2018 05:00:48 -0400 Received: from 1f95QH-0005nH-WA by out6c.electric.net with emc1-ok (Exim 4.90_1) (envelope-from ) id 1f95Qn-0009yX-VP; Thu, 19 Apr 2018 02:00:41 -0700 Received: by emcmailer; Thu, 19 Apr 2018 02:00:41 -0700 Received: from [156.67.243.126] (helo=AcuMS.aculab.com) by out6c.electric.net with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1f95QH-0005nH-WA; Thu, 19 Apr 2018 02:00:09 -0700 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 19 Apr 2018 10:01:13 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 19 Apr 2018 10:01:13 +0100 From: David Laight To: 'Andi Kleen' , Linus Torvalds CC: Joerg Roedel , Thomas Gleixner , "Ingo Molnar" , "H . Peter Anvin" , "the arch/x86 maintainers" , Linux Kernel Mailing List , linux-mm , "Andy Lutomirski" , Dave Hansen , "Josh Poimboeuf" , Juergen Gross , "Peter Zijlstra" , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , "Waim@linux.intel.com" Subject: RE: [PATCH 03/35] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler Thread-Topic: [PATCH 03/35] x86/entry/32: Load task stack from x86_tss.sp1 in SYSENTER handler Thread-Index: AQHT13bnKx+NN3fDIEG3+xsazjALzqQHym9Q Date: Thu, 19 Apr 2018 09:01:12 +0000 Message-ID: <15c09c5a13d244ba8ad3f69ee0a24657@AcuMS.aculab.com> References: <1523892323-14741-1-git-send-email-joro@8bytes.org> <1523892323-14741-4-git-send-email-joro@8bytes.org> <87k1t4t7tw.fsf@linux.intel.com> <20180419003833.GO6694@tassilo.jf.intel.com> In-Reply-To: <20180419003833.GO6694@tassilo.jf.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.33] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 X-Virus-Status: Scanned by VirusSMART (c) X-Virus-Status: Scanned by VirusSMART (s) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen > Sent: 19 April 2018 01:39 > > On Wed, Apr 18, 2018 at 05:02:02PM -0700, Linus Torvalds wrote: > > On Wed, Apr 18, 2018 at 4:26 PM, Andi Kleen wrote: > > > > > > Seems like a hack. Why can't that be stored in a per cpu variable? > > > > It *is* a percpu variable - the whole x86_tss structure is percpu. > > > > I guess it could be a different (separate) percpu variable, but might > > as well use the space we already have allocated. > > Would be better/cleaner to use a separate variable instead of reusing > x86 structures like this. Who knows what subtle side effects that > may have eventually. > > It will be also easier to understand in the code. You could (probably) use an unnamed union in the x86_tss structure so that it is more obvious that the two variables share a location. David