Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2933013pxy; Mon, 3 May 2021 11:10:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOMOJ0W2XmD/I/5zv+EcYAqvDcBVjYPlJSHuRIEc/M1EHlnYWkClnZvp/xR3hDBC64WH9H X-Received: by 2002:a17:906:5ad1:: with SMTP id x17mr17587361ejs.257.1620065438741; Mon, 03 May 2021 11:10:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065438; cv=none; d=google.com; s=arc-20160816; b=fM2O1vxcBIY8gAHVUuaeAHeuWd/E2uoLAInoRbfMMjqcED7FMaqrqr9Ebkb7f37Fr8 2tabWST4BuiNq3O3pPd3xJ+iQMlPpFIHyxcB6F6SxjJCXRMFnL750jx0s2Sru/7yBMtJ bgdED/lBdnfGdHp2Qx14+Q/Hte5ZGfskPDiMt2/HN8PK37ydLI3435Jc8OrJ5JKQOm1L 4TatcyAvecBPILDm6vTQOgmf4DZxAUR5X+XTdSj8K4hLkigfN5x9UdxQJYLhsm/FI/r2 T0C96eh9eRWQTIq2mIu2/KC7EGQ0vE25RnO4PD1N3Ai2+HuiN1r2jd5wfJoiuFRcrEwF cRPw== 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=u2EUhWZZXh81AlsL+mntc2G5I10A8FavpgbqEOD+C6o=; b=PWEFye9GTaguh0+lrdbWnMhbfFkSXYu8a7yAU+O7CaKwVzqx74AAPr8C/gLZovG818 +eLjPfdrmntGNeO/OiHtS48mTPudR7cN+UtKd87EoPVrnkNPhJpRQCMueWShJIn+XASX c82IwgMYOLUTnkMR9xx5/dEu+8ATqN5ldbkTOUXjzVcplQZeGviMJjHLZkjcUV25Fh/q ECeZs7veKoXdDkeywFIxz0/9shP3+ZSNpO987Q4TwtBRO88Wfp5akUVCJKhGVc1AUdoo fKNAUrmrPmNf3NqbyS/X0TFt4bkdCKtvUiiz/EVNMOqUYZ8ZPxQ8tD+ezhV7moC0lWSD d/+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BK8aSu1C; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cr15si546758ejc.676.2021.05.03.11.10.15; Mon, 03 May 2021 11:10:38 -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=@kernel.org header.s=k20201202 header.b=BK8aSu1C; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbhECPjE (ORCPT + 99 others); Mon, 3 May 2021 11:39:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:55548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230122AbhECPjD (ORCPT ); Mon, 3 May 2021 11:39:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6385061159; Mon, 3 May 2021 15:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620056289; bh=SkaNcNSC8IW7uIOhzo9I99etpohr4y6w3U/SqE4P9TU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BK8aSu1CYZo7rclcvcJtm5GkJ8t2fTA+FeviFJUlWgwoNdcJHHfBqlXKQ/Zy7AKg3 qyVFwSEYFTJNlxOhbWsGr41CrJNjbmojHwiqFnnMtu5xhP+djSB3MtLGxHtgZghX2I jFf9ZSdr2nshzoQXxy+Y/3Cm20OWhiB/BFv9NA2tvbNgAHBqu6Gy3sCpxBqm3O6+vo YRlwBfdAzdvua1ISTKNAWbabPe08Hva1q9Y4AAu3caNfbMJplqtV8YXum0bes8Bh5a 4MjbYyF0Xx1mPDmSjwp0Fz5iloVSIyTZtrqUNWhGIB953KDgxYh59avni2U/j97BGu 2b9AqQ1qY314w== Date: Mon, 3 May 2021 18:38:07 +0300 From: Jarkko Sakkinen To: Tim Gardner Cc: dave.hansen@linux.intel.com, shuah@kernel.org, linux-sgx@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Subject: [PATCH 0/1] SGX self test fails Message-ID: References: <20210429183952.22797-1-tim.gardner@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210429183952.22797-1-tim.gardner@canonical.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 29, 2021 at 12:39:51PM -0600, Tim Gardner wrote: > I'm just starting my learning curve on SGX, so I don't know if I've missed > some setup for the SGX device entries. After looking at arch/x86/kernel/cpu/sgx/driver.c > I see that there is no mode value for either sgx_dev_enclave or sgx_dev_provision. Take a look at https://github.com/systemd/systemd/pull/18944 > With this patch I can get the SGX self test to complete: > > sudo ./test_sgx > Warning: no execute permissions on device file /dev/sgx_enclave > 0x0000000000000000 0x0000000000002000 0x03 > 0x0000000000002000 0x0000000000001000 0x05 > 0x0000000000003000 0x0000000000003000 0x03 > SUCCESS > > Is the warning even necessary ? > > Tim With a quick look, I think that check is too strict. AFAIK, mmap(PROT_EXEC) can be done, as long as the file is not in a noexec FS. Dave? For reference: https://lore.kernel.org/linux-sgx/20210318194301.11D9A984@viggo.jf.intel.com/ /Jarkko