Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1935791ybt; Mon, 15 Jun 2020 13:22:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiM0okz5QCiK0K2YRfAxOA3/leDau41a0JPK8Z9HdJumYbs2Yi0DtzaicgwVUBLUPhCOuq X-Received: by 2002:aa7:c5c7:: with SMTP id h7mr24820513eds.177.1592252568774; Mon, 15 Jun 2020 13:22:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592252568; cv=none; d=google.com; s=arc-20160816; b=CPP5YsCowwqP6KRfil6laNgqHKp23L4qT6jQiMmINwU7o2bC5LZK7wNQaMK32/pTAs 3iMM0SwlIJcSOp4L0EGTqZ22z4adiAzi4nOJPyqei8gWZZb1r+hGcUaUcKuytW1oOno4 4qub67hQIix37yQLYCcpx7lgTrXDZOfvnhWzu5OUPNBSWJ+VAwWdX1PWGZZ5LSetSt8o NFRBUsx7hXEcJ7WyWIEfMGL3ysesZUCNxgTa5aG3pqlg/keirZFmEbzPyrMzlP5djsrf Svd1Hj2Gr0ifTSHRMo+rwnHm5jhz5Q5p+V5gNO+MwTz3/jM+LcZEmEb+FwoR5F+IhQ9k ZWqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=c7TwhbRUXmP23nWCfcgSkFO13o8auNrfQI5uHL/+umo=; b=C5a1nn1+zBqpAbkWMJAboZAf9bUHrjZ5IdW/99ywFDmJGgPm9HNlhYm/xM45GCHuUO efr6ikp6ejOEi7Yy7tocq+4P60NqB9Zl3oy5zU+u4V711oZBDt9f4p4Tl48npvwhORU7 fk3uQ/F36c9xIUS7XfaJjQUsr+ByeQBjwLzVNy+GAk/izcYAx68UU2611R2cxdUu+cOC 0vxM2weLpTytX7rByMihjqXUunk9pRjKpTxxRkiaaOXOIBv/yExjxhhDRgPwA8Gta/ry KC8rosFXlFXvLGIHe3rcIb0NXJiN5KOiY5C+OVcFXSSaaWpA97FxW4FWKCN3CgI7D5rs riGQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p9si9898093ejm.658.2020.06.15.13.22.26; Mon, 15 Jun 2020 13:22:48 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731460AbgFOUSG (ORCPT + 99 others); Mon, 15 Jun 2020 16:18:06 -0400 Received: from mga05.intel.com ([192.55.52.43]:37178 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728346AbgFOUSG (ORCPT ); Mon, 15 Jun 2020 16:18:06 -0400 IronPort-SDR: +j69V2XXin4o6DQYgRoImEYIWWuDDn3p7U5/c+82VLLB6FLMfkXKiqaopbbJxM7BcGe7UUcmEv VhUCLm1nb3Dg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 13:18:05 -0700 IronPort-SDR: 7UGogxNsF5wX7XX/7pmqGbq6uruuIb+aUdmRHpRdQG1RzTUi+jc9MYje1Q/vT/miaEn7JZq3sj YC1frf1vW+xg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,516,1583222400"; d="scan'208";a="298643381" Received: from ifaivilx-mobl.ger.corp.intel.com (HELO localhost) ([10.249.35.251]) by fmsmga004.fm.intel.com with ESMTP; 15 Jun 2020 13:17:54 -0700 Date: Mon, 15 Jun 2020 23:17:54 +0300 From: Jarkko Sakkinen To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, linux-kselftest@vger.kernel.org, akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, bp@alien8.de, cedric.xing@intel.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 v32 19/21] selftests/x86: Add a selftest for SGX Message-ID: <20200615201754.GD5416@linux.intel.com> References: <20200601075218.65618-1-jarkko.sakkinen@linux.intel.com> <20200601075218.65618-20-jarkko.sakkinen@linux.intel.com> <20200603220634.GB25606@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200603220634.GB25606@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 03, 2020 at 03:06:34PM -0700, Sean Christopherson wrote: > On Mon, Jun 01, 2020 at 10:52:16AM +0300, Jarkko Sakkinen wrote: > > Add a selftest for SGX. It is a trivial test where a simple enclave > > copies one 64-bit word of memory between two memory locations. > > ... > > > --- /dev/null > > +++ b/tools/testing/selftests/sgx/Makefile > > @@ -0,0 +1,53 @@ > > +top_srcdir = ../../../.. > > + > > +include ../lib.mk > > + > > +.PHONY: all clean > > + > > +CAN_BUILD_X86_64 := $(shell ../x86/check_cc.sh $(CC) \ > > + ../x86/trivial_64bit_program.c) > > + > > +ifndef OBJCOPY > > +OBJCOPY := $(CROSS_COMPILE)objcopy > > +endif > > + > > +INCLUDES := -I$(top_srcdir)/tools/include > > +HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC -z noexecstack > > There's a pending pull request for 5.8[1] that includes a patch that turns > off automatic READ_IMPLIES_EXEC for x86_64[2]. Assuming that gets pulled > for 5.8, we should drop noexecstack to verify/ensure that the workaround is > no longer needed to avoid conflicts with the EPCM permissions. > > [1] https://lkml.kernel.org/r/20200603213452.GG19667@zn.tnic > [2] https://lkml.kernel.org/r/20200327064820.12602-4-keescook@chromium.org If the check is removed from encl.c, then this needs to be taken into account in backporting. /Jarkko