Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2415957imm; Tue, 4 Sep 2018 04:12:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVYDnk03UaxakifSF5JhONpwkaWx8B5P/KRHZ7SHr5x4IuLKRU/j5eBQLiYxkb1mctHBS9 X-Received: by 2002:a63:6243:: with SMTP id w64-v6mr31080065pgb.145.1536059538030; Tue, 04 Sep 2018 04:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536059538; cv=none; d=google.com; s=arc-20160816; b=eb70aTO5XaF8TGP4zEpUxMIRdjyPNEaMjgNqniQ5PCZNo33w5bi7haCHzncyyPAdcw FXxMDkqTBXRhr3u1DVgE2ySBHcREFDZXYm5ZVU6kCy9+MfZ5CPo2EYcnx2bsVKemej3h +EihP9D9nZQth+4cJIZNLOQK4bEKqUU/+m5jrUDuO02WQpeQqn7lkTvLvCCUzl/tKo3R igj/0Df3qa7R29K33CXdkfPmi1fGnbYgQCCe8MfkLj7hL+zAlgHfrZ3s6P4tVpRGl6qP IdVHFXxIbCO0+7QUHrC2ubSKF5dJNmT2ZfmokY/GNTjNJY/sPLY9iwI+tRffxPMFu5F8 mdPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8e+Og9tELu/jpiXEveBCBQP0QL2TSi6z7EPVd5bu4iw=; b=XhD6gBKzNFrMZO1x1TIN4LGEBUSpndWzCMT6mltLMxNWlw0Ve6nvhsuhqK+FqcqTBi yAnKqeFrtf/vifnWAeKi2j7u9E3qXEFk/G58mcUaZj76Vim4Dk5GlM6WGNgNXf3RHK8H YWoToSiCkpBmEHBLdtaBUu5Km4GmBsiESVlgqmjSgphc/GQCuETXudDWNJCZcJTT8JzG b09tFrWeyXV2Tt/dFS2+MzyvxAmIHLoy86zVPVBecewtS3IU2ptNGGe07dnOGHFzorM0 1Gl+tKxr8XSHNu4xUoKEnaLE5vu8zU6yTYnomKF3JvMfrA2n6R6bzFsi6pK6WZpZAOb9 CIxw== 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 d11-v6si15902266plo.91.2018.09.04.04.12.02; Tue, 04 Sep 2018 04:12:17 -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 S1727330AbeIDPeg (ORCPT + 99 others); Tue, 4 Sep 2018 11:34:36 -0400 Received: from mga09.intel.com ([134.134.136.24]:22835 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbeIDPeg (ORCPT ); Tue, 4 Sep 2018 11:34:36 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 04:09:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,329,1531810800"; d="scan'208";a="87002770" Received: from jsakkine-mobl1.tm.intel.com (HELO localhost) ([10.237.50.32]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2018 04:09:54 -0700 Date: Tue, 4 Sep 2018 14:09:52 +0300 From: Jarkko Sakkinen To: Andy Shevchenko Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , Dave Hansen , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , serge.ayoun@intel.com, suresh.b.siddha@intel.com, Linux Kernel Mailing List Subject: Re: [PATCH v13 08/13] x86/sgx: Add wrappers for ENCLS leaf functions Message-ID: <20180904110952.GD5423@linux.intel.com> References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-9-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 06:01:26PM +0300, Andy Shevchenko wrote: > On Mon, Aug 27, 2018 at 9:58 PM Jarkko Sakkinen > wrote: > > > > Add wrappers for Intel(R) SGX ENCLS opcode leaf functions except > > ENCLS(EINIT). ENCLS invokes privileged functions for managing (creation, > > initialization and swapping) and debugging enclaves. > > > +#define ENCLS_FAULT_FLAG 0x40000000UL > > +#define ENCLS_FAULT_FLAG_ASM "$0x40000000" > > Hmm... Why it can't have same name? > > See, how _AC() macro is defined and being used. Thanks, we'll migrate this to use _AC(). > > +#define ENCLS_TRAPNR(r) ((r) & ~ENCLS_FAULT_FLAG) > > If result of macro is assigned to some variable and (r) by some reason > is 32-bit type > and you compile as 64-bit object, compiler will warn here. > Please, check this is not the case in any of use of this macro. > Otherwise you need a type casting, like > > foo = bar & (u32)~BAR; > > (or using typeof() might work) Thanks for spotting this. I will check the use of this macro. > > -- > With Best Regards, > Andy Shevchenko /Jarkko