Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1415854imm; Tue, 10 Jul 2018 01:08:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdwcwE2M0aPimBXsNOYGGSpi0gvrSNSwwbK4zdvW0YrJyhOPntesi7u9gjVk+lrh2ZUi8Z4 X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr23589761plg.135.1531210139117; Tue, 10 Jul 2018 01:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531210139; cv=none; d=google.com; s=arc-20160816; b=jXTpk3BgIq/8dpEc28LcKivaUoFweFt1enOB1Q0a36gBxmrp88O6zHtFaeLwLOQjtp bRBrvfCtvGiwUS+zcw3cJxlwsLcJSzLQOknMRM0+BGOiygZlDMKrGsxG0gg16uluLM9A 42L3CpZuAzjIgee1MmpTaj4NpiIOfISbyqlPqCgzbE5uiPAllEL+VVkSZoQxZZd0uiEE u6LLEkhRQ5c0p/3BMmOD5uMm6tUVsJtZNI2chIU2XxbmwULWCNiP0QBlWXHMqy8RqG0r dbRU1mehq+oV79cBYlARSLbXHWym5dd7Xv4SrSQo18F4jmf8iKvx/NaNJtFYD5KcSZ58 CVkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=YELPnNnzJnT6/A7lKHCzWA/4HT0wnij4pmhjBqKQnHs=; b=SO1orQ1Xoa76XpZwufTeG+zz21N2uQOKHskW2yvPT28tWxE7RIRtqJ+ksvNvXav8YW Jt80jAMuEgy7CiP39nFlO4E7sh8neDzYwC+O0kLdLR3XXvMhd73VMm4xaXIqr6Sb2DhG 8BSdcwtILnMqCGWKBBRR/YfPWmjOWJp0gaPJ3HsVQGdha6ptkaLJxTaFsMjfZANd4qsp EhHaEMYh/1AU79uHT2kEfyokbQbCbuiHFbreeggUTIHi34SH+sOKxF/0Z7bJQVDtsXXB o/e0VsSAjrpvVJS9bd1OiCaYnjNMJlKkJcnpU1R919RNKpPc7IKub5FLIce91RL+1C/P BfFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=iBL8IWDT; 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 l15-v6si15577036pgf.451.2018.07.10.01.08.44; Tue, 10 Jul 2018 01:08:59 -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=@gmail.com header.s=20161025 header.b=iBL8IWDT; 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 S933377AbeGJIHC (ORCPT + 99 others); Tue, 10 Jul 2018 04:07:02 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:46083 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbeGJIG7 (ORCPT ); Tue, 10 Jul 2018 04:06:59 -0400 Received: by mail-vk0-f66.google.com with SMTP id b14-v6so11931110vke.13; Tue, 10 Jul 2018 01:06:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YELPnNnzJnT6/A7lKHCzWA/4HT0wnij4pmhjBqKQnHs=; b=iBL8IWDTGNF9uBx/4l7ILoxd0YXOolcDjQFedloWJr9m7ms1ZbrBrs3dcRDogdQgQU KrEgWXkq1oudyavYKbUAh6zOhRdoK7Zp8q0LuyCuyQp7OFvZvTPyWpXSQKyuSt3zLNus Qe+5VkG0vV5VqF9JJw7qyG+xmf2mWKuaiByAFoQSnEV+P3yDOw4wX+TxArZmW/ywlunP HRGscxZMMvMSiyStwQULrDDNMNOsfosu5ugHG82bEEflg9FprqdQgmyCrA2gukrFqWFQ OJcshzYhMGQK0hsGyeMMI8jWZp6YN0+W4ydvV71hdVkUWh9/C5sAQdu2e0nakIjAJyVx 8GlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YELPnNnzJnT6/A7lKHCzWA/4HT0wnij4pmhjBqKQnHs=; b=Xge6Q2Xkui1OsE8b7VdTJNL14DbpR9M1GpcitN5TqsCaMf8fmzc2786FIwmXhpN977 HArXgyTXRGhcNgKtIuLwNFZ6G0vjFogLfbix6JFsdken7wTnuTI7Cs8IZUr+XpVMngFI WLDtRLwWyr9bVPx6aKPdVFDU9s7z6EKzYEFWxmsFlEFtoqvnCZJ2esCRye8Lf349OXGL UsfetNnysjvCgegvvnYNhaMQ+gQKYoP8me1eu2dM9V9LQIKY0DulIgqlu4Begof9zRmV 3C4lOC3rO7EPQibLRQm8G6MBq3GzUuuRCUdOzXfIHvvj8Lhqs9LYN3MrOHTZQ70GDnzQ r5uA== X-Gm-Message-State: APt69E1aTMMlD7m4PX+14AABBCXch5vFYv+8Soo3L9NHUUdowIxl7Ao9 Iq1jca5kSjH2AVww6VsrqMXVUZTFuYIMFeUdHOQ= X-Received: by 2002:a1f:7d09:: with SMTP id y9-v6mr13477829vkc.15.1531210018385; Tue, 10 Jul 2018 01:06:58 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Tue, 10 Jul 2018 01:06:57 -0700 (PDT) In-Reply-To: References: <20180703182118.15024-1-jarkko.sakkinen@linux.intel.com> <20180703182118.15024-6-jarkko.sakkinen@linux.intel.com> <20180705200912.GA10701@linux.intel.com> From: Andy Shevchenko Date: Tue, 10 Jul 2018 11:06:57 +0300 Message-ID: Subject: Re: [PATCH v12 05/13] x86/sgx: architectural structures To: "H. Peter Anvin" Cc: Jarkko Sakkinen , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 6, 2018 at 12:50 AM, wrote: > On July 5, 2018 1:09:12 PM PDT, Jarkko Sakkinen wrote: >>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. > For things exported to user space use __u* and __s* types... the _t types would actually violate the C standard with respect to namespace pollution. Hmm... Coding style 5(d) allows to use uintNN_t in new code (as a variation of uNN choice). -- With Best Regards, Andy Shevchenko