Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1023715imm; Thu, 5 Jul 2018 13:11:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfY7u/WfCQiQsJTaWy60nLVqwDoBXyrGnUgv9hYxV7LHMxZi7Is/9DpfhYb7b2Edw2gOJ8S X-Received: by 2002:a17:902:988f:: with SMTP id s15-v6mr7553370plp.95.1530821478797; Thu, 05 Jul 2018 13:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530821478; cv=none; d=google.com; s=arc-20160816; b=oCPBw4V6nz6F4heddCmPaZkn/ukYXOVJ9L1yrruHTAMHkUxh+mbQ4s+Yei+zdYGu3O sLIpVGKrxT5Pvs7VLl7GOFlEJWN0kyZJvBPouav5o+6G2wWsZPrY1ueaxpW7bJfNqSXK lyvTe+XJPX1f4fMaFX4YlBFpTi4zc8hx4+AHmiybqeJe/jpaOuDhf28/ANCIUBxb6aub e6Et85ymKDJlKjyyXNDUeookxClOg7H5SviAqJ/qKtAAU51qtaPrezc6xbITWjJCsGWu zqnDHDjkSBUxVCi7rfQdpXNkzJCx5QY7AXsvJd+E8K5HpXOKBWYYuiPqQ6faTIdUDK+1 11sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=OzkUBeGtyVe+yWMTvwARLwlYyEyCnYngp0a2G/Opt4c=; b=DndfUPXlcRJgE6fnkrPB/cb5ncZcxls4Lfx+6i6s3VMW5YhFmcm4hFkK6p/Cki8JYu JOLP+4PV1dnmuLCcUP0d8qGQdZvsW4w6/In+vcZxiFv+9i+3nxQeEum78xSi83rVA8Q2 5n0IOLTwN32rQAXDpXOI0l28JnU8u1By0lF+KAkwC8aMlvbSwL5LYrGAaOYkmjTyDMuy Op70TuPoeFgQpLgWfNwuKjZGphD8hsVmk8kTG2ahYBpvooAsqT5lF5LQqGqzvD0tQHnv J3muj4Vs34f9vfk2ybxvRfSvUhRhJ4Iv0QQxiWptqcLDAYUsl33uCsSsP7QAfiy4WiYk 6qmQ== 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 194-v6si6533138pgf.651.2018.07.05.13.11.04; Thu, 05 Jul 2018 13:11:18 -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 S1754312AbeGEUJV (ORCPT + 99 others); Thu, 5 Jul 2018 16:09:21 -0400 Received: from mga05.intel.com ([192.55.52.43]:25878 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753983AbeGEUJT (ORCPT ); Thu, 5 Jul 2018 16:09:19 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 13:09:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,313,1526367600"; d="scan'208";a="69970018" Received: from dmorlich-mobl.amr.corp.intel.com (HELO localhost) ([10.252.36.24]) by fmsmga001.fm.intel.com with ESMTP; 05 Jul 2018 13:09:14 -0700 Date: Thu, 5 Jul 2018 23:09:12 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: x86@kernel.org, platform-driver-x86@vger.kernel.org, sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Subject: Re: [PATCH v12 05/13] x86/sgx: architectural structures Message-ID: <20180705200912.GA10701@linux.intel.com> References: <20180703182118.15024-1-jarkko.sakkinen@linux.intel.com> <20180703182118.15024-6-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 05, 2018 at 08:31:42AM -0700, Dave Hansen wrote: > On 07/03/2018 11:19 AM, Jarkko Sakkinen wrote: > > +struct sgx_secs { > > + uint64_t size; > > + uint64_t base; > > + uint32_t ssaframesize; > > + uint32_t miscselect; > > + uint8_t reserved1[SGX_SECS_RESERVED1_SIZE]; > > + uint64_t attributes; > > + uint64_t xfrm; > > + uint32_t mrenclave[8]; > > + uint8_t reserved2[SGX_SECS_RESERVED2_SIZE]; > > + uint32_t mrsigner[8]; > > + uint8_t reserved3[SGX_SECS_RESERVED3_SIZE]; > > + uint16_t isvvprodid; > > + uint16_t isvsvn; > > + uint8_t reserved4[SGX_SECS_RESERVED4_SIZE]; > > +} __packed __aligned(4096); > > Why are the uint* versions in use here? Those are for userspace ABI, > but this is entirely for in-kernel-use, right? > > We've used u8/16/32/64 in arch code in a bunch of places. They're at > least a bit more compact and easier to read. It's this: > > u8 foo; > u64 bar; > > vs. this: > > uint8_t foo; > uint64_t bar; The reason was that with in-kernel LE these were in fact used by user space code. Now they can be changed to those that you suggested. /Jarkko