Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp47381imu; Thu, 8 Nov 2018 13:33:43 -0800 (PST) X-Google-Smtp-Source: AJdET5c9wQywRn9KKRT5IQXXJ08mdEdc7zrFgRnZVOTTaV1wIxZpLB85J3z8SSCi7L2QhV0hJqAC X-Received: by 2002:a62:4502:: with SMTP id s2-v6mr1996947pfa.31.1541712822944; Thu, 08 Nov 2018 13:33:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541712822; cv=none; d=google.com; s=arc-20160816; b=Cz6Au2nCEEDUzILDcWQVXEwcn8KHnFiv88vPJ53T7uPtzevUJPnPjG9VQZBhyT8tsq 0tcu6mq1Ym/12+wGeoGlenvckFBfxMAs3AKUVc/kqSKEVani+Yutc/Hj+BaqP6fqY9+w 6RzLuxZn74KxBauVlH4UCnNLxOMPinpLa5utAg81L10khi5cBRrXFY8bxmIAw//FhyQR 5hGLgLq3s5nWf7TsgLCqCcdn8J9GF2NU9glLsHMeKg1dS9w8umqsk3VynyapNxwf57uK qf8RhnwptOCf9B+VUy3eNh2w/hgPZ6j0rL07dVHn+dzkGFxpHCmu7s5wxQ9KlehSQzS1 cWYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=C3pszWJZIvtEEQQnKu7V/MM4CVUt13HqVhxs6osWXLo=; b=AsVh+fM2P0/3lbl2BFZXVZD7M2lOy//d3CZ0FB+zUxgWonrSfwPPp4gnoAriemh3dP 5QfHMmMocsfISMTENgmvL0EHDh3yYZHr/2NdHiN8paL5YXaKCaF5CRNUh+bJhi1ov38W Qno262Jte3iImddYaglCGMu6OQhjkVbPlVc4s5Ew7M6gwXTf7mg9Sd6o5nRgGz3XHPPq 9EhzMvJJ35FrfRCtIYK8S7MoABXpS9jwVOmJip5BGmkKyjtuZvsBScXbKoV+4N6JS+Xm 4KXKlV+98r8ZfJ6MqtrGQJvysRZtzbuaLRyr7DgBhcHmKTOItprbiq+KkpLTcuiNlUmq vQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DJ88Q6Pb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2-v6si5362325plk.264.2018.11.08.13.33.26; Thu, 08 Nov 2018 13:33:42 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=DJ88Q6Pb; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727326AbeKIHIw (ORCPT + 99 others); Fri, 9 Nov 2018 02:08:52 -0500 Received: from mail-lj1-f194.google.com ([209.85.208.194]:39304 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726182AbeKIHIw (ORCPT ); Fri, 9 Nov 2018 02:08:52 -0500 Received: by mail-lj1-f194.google.com with SMTP id t9-v6so16166337ljh.6; Thu, 08 Nov 2018 13:31:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=C3pszWJZIvtEEQQnKu7V/MM4CVUt13HqVhxs6osWXLo=; b=DJ88Q6PbNjIst8NPGoPzV7IHSPXhCY0q6Zpi+fXMK16oJVp8RF4zq+2PjWybBZx8Kb 9M3eVr8lfxinKtpBWutaA89N0kircSOm90m+dlQv0hzboCSF/eq9ZeUd9/SUyEdziVjH z2oylMhL0s3GUVes8FI1BSKeC3m4XSM8+ljakiTmCld2Dng75k7LqAPE4QezOAZbh8V8 q+tGG+/9rJ+C7TSUszwtNuLQeO1ncen90T8Gd90lnr+zpU4SY3t5yElz+fdS/oUKojmd yuMqQB6Guw0IMCG7T6jelMG8HyMerM5qmpgnvMb0Dob7nw6+XEqww4GNXhrssbs67nnf 1cUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=C3pszWJZIvtEEQQnKu7V/MM4CVUt13HqVhxs6osWXLo=; b=RYYuUD62ghdNCKxR5ILBlJnUCNDJC58EHIKJJ+YKTw62E+Z/3OYmrf0tjlivxIBeoK v17nlqpwNMZlMW3ibT77bufggt/yrbGStgMTPMR4L0ruWnmFxd74kSHMlWHX+ucevYiY rxcQZnX2Q+oeejc9ixKsmNZat4XyQKrKN+3fZA/yzQS3eLdK07O4ET+oAwtS5GUDnHKd iH6Ngg7oTjrHmyWNhfFkbcf8nzvybb62EbHus6FSEH6XCbCbzNvK4BcO7mpvnlh0OUgp t+amiRspHWsGKBpi8M3d86BljfnEL+0B4vE/sWusRb6m1XvGT1J2vtN/eHytatro4bnN jXEQ== X-Gm-Message-State: AGRZ1gJO+GJeKhbQqGg3be/gdc+zNe6r1TI074eKcf77D2rhKeA67bBE BldVNiGPCga9aFovrAplaoU= X-Received: by 2002:a2e:92ca:: with SMTP id k10-v6mr3806897ljh.103.1541712687899; Thu, 08 Nov 2018 13:31:27 -0800 (PST) Received: from uranus.localdomain ([5.18.102.224]) by smtp.gmail.com with ESMTPSA id u12-v6sm871897ljk.79.2018.11.08.13.31.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 13:31:26 -0800 (PST) Received: by uranus.localdomain (Postfix, from userid 1000) id 4471D4607EF; Fri, 9 Nov 2018 00:31:26 +0300 (MSK) Date: Fri, 9 Nov 2018 00:31:26 +0300 From: Cyrill Gorcunov To: Andy Lutomirski Cc: Yu-cheng Yu , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H. J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , "Shanbhogue, Vedvyas" Subject: Re: [PATCH v5 04/27] x86/fpu/xstate: Add XSAVES system states for shadow stack Message-ID: <20181108213126.GD13195@uranus.lan> References: <20181011151523.27101-1-yu-cheng.yu@intel.com> <20181011151523.27101-5-yu-cheng.yu@intel.com> <4295b8f786c10c469870a6d9725749ce75dcdaa2.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 08, 2018 at 01:22:54PM -0800, Andy Lutomirski wrote: > > > > > > Why are these __packed? It seems like it'll generate bad code for no > > > obvious purpose. > > > > That prevents any possibility that the compiler will insert padding, although in > > 64-bit kernel this should not happen to either struct. Also all xstate > > components here are packed. > > > > They both seem like bugs, perhaps. As I understand it, __packed > removes padding, but it also forces the compiler to expect the fields > to be unaligned even if they are actually aligned. How is that? Andy, mind to point where you get that this attribute forces compiler to make such assumption?