Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2872683imm; Tue, 4 Sep 2018 11:20:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQEBhnCMeouXxyNlzlKy63qEH+dx4iMdDCsRPy4I199HzXnsGddPyuUTs25rrt9Hc5W4r9 X-Received: by 2002:a63:de4b:: with SMTP id y11-v6mr8530881pgi.435.1536085218887; Tue, 04 Sep 2018 11:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536085218; cv=none; d=google.com; s=arc-20160816; b=hltCAweWPV/8Rx3kCopFNcqg4XjChM/94r84Bd2t64+6uV3cPzsQVcl5sQOu7ElRCc 9UsPeB6UfyTqXu7v7JajahCNYv2OYTk4R6Lg4fUNT4gUaDDa9vHEIaSaF6zn/E3w932R GszlM0io4DjXYEBC7qxixTEdn6cUoaEDr1hkAzQ+BR5N5FysHT3WXdL+vFk4aBgW+8Xj KyI9PAO0LL0IrEzc2Eav5n5plQK7JxGsBI94mLAnnKOmQ8AYmvis07SkauB9XTzG9mPV QayTh2+nw0UKgKGW/sYEWl9hxLsZOpU66L3JMwMrWMKC93Blnf8SDdFYyLXI73XRWml8 e3IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=HbZg5AFviFVRYznLXYMkTqY78aWaN7+zeSOyZtzRn8I=; b=Xbf+PvmC7gH2NckDUZfO5xyhQ1m1Am+mdZlCL68uQhJxWxnG+A8jhe0Fkfm0bQO/fU 6XaAjUfZruZFAcOsuutk+2t4Ir3zU37RPGg04D7mtnEBO8Xv4QVIew0J/iQf9zvvojMB qKjozzDQGL/XBhIukrWRZ8X+bMzsPza/EKToFmYXYR+xO6KJaph2F3Wq4O/kiVO7cHnc L4zHQ1qKmVKX9hrZ2ho/bKhtkcW60g7t4RP20BP/Lw9o8Aha/tLsg0eO6lseWC9BGc9A r0/dnzWuVjRrfsjG3lki9eJ0LE9FgTcGNHsBFOXWjii71kyIQ2c0y+9938VrfHmXYxNi Djzw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23-v6si22284467pgj.543.2018.09.04.11.20.02; Tue, 04 Sep 2018 11:20:18 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727718AbeIDWor (ORCPT + 99 others); Tue, 4 Sep 2018 18:44:47 -0400 Received: from mga05.intel.com ([192.55.52.43]:60916 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbeIDWor (ORCPT ); Tue, 4 Sep 2018 18:44:47 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 11:18:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,330,1531810800"; d="scan'208";a="260655353" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.20]) by fmsmga006.fm.intel.com with ESMTP; 04 Sep 2018 11:17:35 -0700 Date: Tue, 4 Sep 2018 11:17:35 -0700 From: Sean Christopherson To: Andy Shevchenko Cc: Jarkko Sakkinen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , Dave Hansen , nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, serge.ayoun@intel.com, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , suresh.b.siddha@intel.com, Linux Kernel Mailing List Subject: Re: [PATCH v13 07/13] x86/sgx: Add data structures for tracking the EPC pages Message-ID: <20180904181735.GA5820@linux.intel.com> References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-8-jarkko.sakkinen@linux.intel.com> <20180904174914.GA5690@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 04, 2018 at 09:01:15PM +0300, Andy Shevchenko wrote: > On Tue, Sep 4, 2018 a> +/** > > > > > + va = ioremap_cache(addr, size); > > > > + if (!va) > > > > + return -ENOMEM; > > > > > > I'm not sure this is a right API. Do we operate with memory? Does it > > > have I/O side effects? > > > If no, memremap() would be better to use. > > > > Preserving __iomem is desirable. There aren't side effects per se, > > but direct non-enclave accesses to the EPC get abort page semantics so > > the kernel shouldn't be directly dereferencing a pointer to the EPC. > > Though by that argument, sgx_epc_bank.va, sgx_epc_addr's return and > > all ENCLS helpers should be tagged __iomem. > > Why? > Does it related to *any* I/O? No, hence my other comment that __private or a new tag altogether may be more appropriate. The noderef attribute is what we truly care about.