Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp933834pxk; Fri, 25 Sep 2020 01:30:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVOQDYftgFOTQ62QSaj1V76X+6a3sOsxI/1b653or2IbrpbxtsbpIxcaJupixxvIIoMDOW X-Received: by 2002:a17:906:4941:: with SMTP id f1mr1622029ejt.417.1601022655363; Fri, 25 Sep 2020 01:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601022655; cv=none; d=google.com; s=arc-20160816; b=P3N0RLDK0oCafej8/WeC0tLrXsdni/Gcg1lfxi2mE9LIGnLXidKFCeYn0csvBeRR5a uUb0dZaW5SFc6/82uS63DLtk9ZfmjsrLT75b4E4qXuAA203BAyN6jI2oje2gy+aI7Kn5 ko8TbfCfBAz4lRzr/SDKsZD0KnIck5mwq5+2i/4DhxfzgSSv9ZcdzSHWPMVQWmsj8uyx W8WsHyKuGYonBqQja44iwZyP6a178jdfGh0AS2PKoa9GHgQ9i41rIVFaSE2d8xK8D5Pb AB5f1xFF+XFEPuqMsioXWwhGFrDtwRdrmtL0b/dUxrtzwB34eyMIiC4SaJXZJLwjQxoR NaaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aBvHXwx9a9PqqUZzuoVpY410vW5jppv7nSFihXyq/xQ=; b=BBxpz63vMxfcYJUn2viLuq2ivhflFu2mU0F/rmsNDLB2lhyf3NtC45Vz726JBPGcCf kftqvjM73HbZbYfGAk992gtd04D8TXPdYx+HwkHlBoT3o2Xntw7tPhlglNIw9f0HpxvX u0LQ6G0NagmDGh85gmcVtsc3KsFagWgkpiu2bLZaXt9NOPtrgLA+yJ4lH6mVDMdkmtRy vug+4rhJtfThYL1Te8oBu9gnF+085yfXCWq/hG8AY689DSllFzTD26EZF+jTiTiixxvJ uV/LuTevG5HG1w4Nfmesb0CMpq9Z00LGCOw31SRU5soMf86a9XJBcrfjPQ1RQ+8TpVPx VReQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=UUkNyaTo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si1340307eda.92.2020.09.25.01.30.31; Fri, 25 Sep 2020 01:30:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=UUkNyaTo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727428AbgIYI2P (ORCPT + 99 others); Fri, 25 Sep 2020 04:28:15 -0400 Received: from mail.skyhub.de ([5.9.137.197]:36820 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727044AbgIYI2P (ORCPT ); Fri, 25 Sep 2020 04:28:15 -0400 Received: from zn.tnic (p200300ec2f0b3a0093be1e56408cfaf4.dip0.t-ipconnect.de [IPv6:2003:ec:2f0b:3a00:93be:1e56:408c:faf4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id B47501EC0430; Fri, 25 Sep 2020 10:28:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1601022493; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=aBvHXwx9a9PqqUZzuoVpY410vW5jppv7nSFihXyq/xQ=; b=UUkNyaTo5MHxuo5KXBUniRQ5MFQbOkTYQvRMMJhSYw00RwnQtQdAVPyGDWxEt8VS1JcpRe ++qVWlkXZz9wcal/MNO0QjzcLLFHUREbPPtHvKZLAicOzfqZn0eS+Fp71IvZW7TJMfcyLK RjxBAlC2V5hnTwqNkca3FdXgVTI+YnA= Date: Fri, 25 Sep 2020 10:28:07 +0200 From: Borislav Petkov To: Jarkko Sakkinen Cc: x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Sean Christopherson , Andy Lutomirski , Jethro Beekman , Cedric Xing , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, chenalexchen@google.com, conradparker@google.com, cyhanish@google.com, dave.hansen@intel.com, haitao.huang@intel.com, josh@joshtriplett.org, kai.huang@intel.com, kai.svahn@intel.com, kmoy@google.com, ludloff@google.com, luto@kernel.org, nhorman@redhat.com, npmccallum@redhat.com, puiterwijk@redhat.com, rientjes@google.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v38 21/24] x86/vdso: Implement a vDSO for Intel SGX enclave call Message-ID: <20200925082807.GG16872@zn.tnic> References: <20200915112842.897265-1-jarkko.sakkinen@linux.intel.com> <20200915112842.897265-22-jarkko.sakkinen@linux.intel.com> <20200924180407.GO5030@zn.tnic> <20200925010031.GH119995@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200925010031.GH119995@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 25, 2020 at 04:00:40AM +0300, Jarkko Sakkinen wrote: > I renamed it as vsgx.S (for the sake of convention). Right. > I have not authored this patch but what I would propose is to use just > raw value in the place of these constants. It is practially just a > boolean value. > > I can also add sgx_vdso.h to uapi directory. I just don't see the point. Just be very cautious what you add to the uapi/ directory because it becomes API and there's no changing it. That's why I point you guys to it, to think hard what you expose there and that it becomes contract with luserspace. > > I can see why you would write "TCS" though - there's a thread control > > structure thing too in that patch. > > Renamed. See Sean's reply. > /** > * typedef sgx_enclave_exit_handler_t - Exit handler function accepted by > * __vdso_sgx_enter_enclave() > * @rdi: RDI snapshot > * @rsi: RSI snapshot > * @rdx: RDX snapshot > * @rsp: RSP snapshot (untrusted stack) > * @r8: R8 snapshot > * @r9: R9 snapshot I'd say here: "The registers' content is the snapshot made at enclave exit." > Also, I renamed 'r' as 'run' in some places. > > End result: > > https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git/tree/arch/x86/include/uapi/asm/sgx.h > > I'm wondering this sentence: > > "The calling convention is custom and does not follow System V x86-64 ABI." Yeah, I was wondering what that meant too. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette