Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp401777pxk; Wed, 23 Sep 2020 06:22:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxx7lSkwr8WKdSNAiM/gESCYdsuIhKT9ZbV4UoiN8JQInkilnla0BnXLbVcxiHuyhMDV5A5 X-Received: by 2002:a05:6402:1641:: with SMTP id s1mr10244783edx.66.1600867349926; Wed, 23 Sep 2020 06:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600867349; cv=none; d=google.com; s=arc-20160816; b=HRmKztuT5i2aNeBx1spF8+tq4UJiI3Uj9QqPEWHD50nvuSh7QF+zbqzo8X/XIatm4p ukyZbPFpS+MdHxdfQT6MCWhBIEzhTF+/EW4Wpf/LquuPTUKDqisPQlD2M8djyXzRBG+R jLEo2kryB4xA7bPYghJciCkUOAMHZHqehcd5Obig61YI0lVrIoYAomzoXePbb9fN8vn1 5gVtrZXv8dP26Z6uvWi4scrPYxDFUStnNkkdzhMkHFPFl+FX0F0dSHu9wrN6xnrabS5Q A0tW3448lEnsrPHXLEq0rhqrMsQ9rs5+OFyHpwXuPCgBLJy8oXPE18R/5DeZozwaVRz1 AEwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=EMHZeeixINi2wsoq9grhHiWkxnF9eGkb9JXyHCgxOPk=; b=SqvK49VqT3DBd0Z2kyNoPBWtm0stLB8vxYQEdyfe2TC6y+xTRzSnkDx6/xbcKCeefk N/oSMJCyIT4RIVZL3x9RgJHOozIvpzRVytGxNli3Ev62rJi3vxVm+9+mp3r/kXZH6Mgm 78AUk9DGALN/g+QxOgBDiyqGowXb4IdAI8b7Wk1g0/yFCKHupIiliowd6bC5eEhc8Q5R PSBPX8Iefu2YjD85KZ/kXp/JInuZqY/hf0kfp8gVUPlvbb8VyIC868XgZNfaJogvgYSc b61jM8+FwK2bvy/V5b/kzLiLU3MI5xV1Dm2HxSjFzmKPjpPtsyf6ja8VN0R0KwHMVQqt eOCg== 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 x25si13031035edi.558.2020.09.23.06.22.03; Wed, 23 Sep 2020 06:22:29 -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 S1726518AbgIWNVC (ORCPT + 99 others); Wed, 23 Sep 2020 09:21:02 -0400 Received: from mga02.intel.com ([134.134.136.20]:51334 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726130AbgIWNVC (ORCPT ); Wed, 23 Sep 2020 09:21:02 -0400 IronPort-SDR: yfha8BQq5SAmxsNtRi9kR0BRV6CB9JJEPXbCBbLpeZrdF846djoNyApYu0UCiux9qa5ml4oWXZ UFUhMxRcnr2w== X-IronPort-AV: E=McAfee;i="6000,8403,9752"; a="148536324" X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="148536324" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 06:21:01 -0700 IronPort-SDR: RrOeYneMNxGRx1oRtDH0k7xV9+XCUs84mR9G1Ixu7FmWaEDXG8D1JNxrgdvbWwsd9nuCSey4GK bTFoOmDn+0pA== X-IronPort-AV: E=Sophos;i="5.77,293,1596524400"; d="scan'208";a="486439488" Received: from ichiojdo-mobl.ger.corp.intel.com (HELO localhost) ([10.252.51.82]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2020 06:20:51 -0700 Date: Wed, 23 Sep 2020 16:20:49 +0300 From: Jarkko Sakkinen To: Borislav Petkov Cc: x86@kernel.org, linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, Jethro Beekman , akpm@linux-foundation.org, andriy.shevchenko@linux.intel.com, asapek@google.com, 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, sean.j.christopherson@intel.com, tglx@linutronix.de, yaozhangx@google.com Subject: Re: [PATCH v38 17/24] x86/sgx: ptrace() support for the SGX driver Message-ID: <20200923132037.GA5160@linux.intel.com> References: <20200915112842.897265-1-jarkko.sakkinen@linux.intel.com> <20200915112842.897265-18-jarkko.sakkinen@linux.intel.com> <20200922154424.GL22660@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922154424.GL22660@zn.tnic> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2020 at 05:44:24PM +0200, Borislav Petkov wrote: > > > Subject: Re: [PATCH v38 17/24] x86/sgx: ptrace() support for the SGX driver > ... x86/sgx: Add ptrace() support... > > subject needs a verb. > > On Tue, Sep 15, 2020 at 02:28:35PM +0300, Jarkko Sakkinen wrote: > > Add VMA callbacks for ptrace() that can be used with debug enclaves. > > With debug enclaves data can be read and write the memory word at a time > > I think you wanna say here > > "... data can be read and/or written a memory word at a time by using..." I also fixed the other issues but I'll paste here the rewrite that I did for the commit message: " x86/sgx: Add ptrace() support for the SGX driver Intel Sofware Guard eXtensions (SGX) allows creation of executable blobs called enclaves, which cannot be accessed by default when not executing inside the enclave. Enclaves can be entered by only using predefined memory addresses, which are defined the enclave is loaded. However, enclaves can defined as debug enclaves during the load time. In debug enclaves data can be read and/or written a memory word at a time by using by using ENCLS[EDBGRD] and ENCLS[EDBGWR] leaf instructions. Add 'access' implementation to vm_ops with the help of these functions. This allows to use ptrace() with debug enclaves. " I also think that mm CC would make sense also for this patch. /Jarkko