Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1732444imm; Mon, 3 Sep 2018 08:03:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY3hXYvfeezaHuoOdK3ONuLQXVG9jVdVt1c7g9jkc+yB5sPGK0rdJ6/4OZyCae0Sqvu23CW X-Received: by 2002:a65:6243:: with SMTP id q3-v6mr26455156pgv.273.1535987022400; Mon, 03 Sep 2018 08:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535987022; cv=none; d=google.com; s=arc-20160816; b=IxXdB6IcW5c2ZFJ58Y65uSu37Ve50SLfU4u9W5oierH5q3+cWKQOQhhgB3RxihahK3 FqYkRopFPzK5MB8CQyWQD32czFy1hLI8xEpwWhJxs6H73IuQkSwsocZgSLiJaJsXr6Aw ul/pjJSe+T9PY1CWvZHNKj0Kd2oG25EXc4UL/BI3953NIgDy0VmMLXLG0oP2LB8IMjl0 pBXJP5KNcdPfqQc2nqDb1t+emwV3W6yCR5wwcezIxlzwZ3oErRjaHfoaRbil2swFh0GB M0CjkMldMkOLyYPFSYdNnX464ZlH0bxQGjFg2HWVwVJ+Yd2dUujBnyRzx1BUyCpzjvyo aJIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=2k6gclSInS2Xfft2jU2vh+G5dKtdzJLj0qsf8YjpAPs=; b=o9Tq2bjhySea0yKn1NB582/BzXS7c3cSe7Tr1UZW/mHweUyEphNW9GEocIBt0oA3U8 U5ngiCpODEdZDydNjzAN0Kb9pJIXetLtiXU/z463nA+3/Q/OrGLiP47H4nh6UV+AXHB/ +nKUGA5y79p0tYgE0v3fy5bGmm7h+TMAxh6XOuXTzAGPw2OsjeHx03JHXbCE/+tm2RBm yxNxQTxE1pBTaUKlX4tNXGAeddcCx0X33/aCRm1aF6P9hyzVSESmm/cFUlQwc0PP/Puf jPJXZGodlZ7Tapekb+VEFS5V37nnf3SOFUHE1/4sD2ZMnBtNizUzHAxfG7mgATbfZKNS jALg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Weby2QMJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 144-v6si14566312pge.259.2018.09.03.08.03.27; Mon, 03 Sep 2018 08:03:42 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Weby2QMJ; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727715AbeICTWY (ORCPT + 99 others); Mon, 3 Sep 2018 15:22:24 -0400 Received: from mail-qt0-f176.google.com ([209.85.216.176]:36795 "EHLO mail-qt0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727454AbeICTWY (ORCPT ); Mon, 3 Sep 2018 15:22:24 -0400 Received: by mail-qt0-f176.google.com with SMTP id t5-v6so883703qtn.3; Mon, 03 Sep 2018 08:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2k6gclSInS2Xfft2jU2vh+G5dKtdzJLj0qsf8YjpAPs=; b=Weby2QMJgfAWQW/Z0F7Duw80l3lnF3WbnSvkprOtezxxyfwBeFPrR05lF3YmMV3jQB koJc88hjnUm54nc3SDCHlUSk+AJOuRQd10D5pf6BVhkafaO881SZGRshv/vllZLeTdnC X23rxgCAzvIr+qlksT0J5lbzywbQHtq8UXSGof054OH/SPw6Lak5h02H47AbwIn7u6z1 O39usiwtyGx89Oo0EQLnZG8+paTXnpISNVvjYvXX63awVvelIvrYVGxOAgYmPaVDyvEG a7n8k3K/Z7ovb4aXF2hSYw4PgAF1aYCj9SYag8R3+f1cdDDumj3/g1Aor+dfbkA52V4Y 1pCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2k6gclSInS2Xfft2jU2vh+G5dKtdzJLj0qsf8YjpAPs=; b=J4oiu8vDElZyiQpsSf+kFXv19fyvd+OWa5WQg+AiCMQa7Md6Wo7UkidzopvCq+ZRQf 7q/q5Um1XgyND2svweo1VdUU4zh1+zZPN5O1BcLPMBaAkmXfuIcY36TM8DsxEx+cx7WH CbUmsaEdlaIg203JOutKQkRm1xz3IOKiPEX4I4ll11bjJeX97MQZU7bgSqn5IJdq21vl D6cafNsc6thIb9QY+x11KYZSfxOT2LYaTrAAmUgFabgsqUUKu9yF1BcfOcerG8McAYDG YODareNMM7oegzIq+0KtYcywDiqdg2DLaB47ESu66ovtFgPy4HjiyrdToWj/45k9ZMO2 99HQ== X-Gm-Message-State: APzg51BDvx0c0fR6NEtfF9y19t34rOndz2MXV/7u+eX6aOsGDtHnWHR9 NLnMnP9/jTeH7FTMk/Ll9AgPdcC4mW2Njk4rYk8= X-Received: by 2002:a0c:e985:: with SMTP id z5-v6mr26014450qvn.136.1535986909645; Mon, 03 Sep 2018 08:01:49 -0700 (PDT) MIME-Version: 1.0 References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-9-jarkko.sakkinen@linux.intel.com> In-Reply-To: <20180827185507.17087-9-jarkko.sakkinen@linux.intel.com> From: Andy Shevchenko Date: Mon, 3 Sep 2018 18:01:26 +0300 Message-ID: Subject: Re: [PATCH v13 08/13] x86/sgx: Add wrappers for ENCLS leaf functions To: Jarkko Sakkinen 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > +#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) -- With Best Regards, Andy Shevchenko