[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdHmfx70=4jZnGZcgk5HTegDtizo7Uauk_bH43RpDXCfg@mail.gmail.com>
Date: Mon, 3 Sep 2018 18:01:26 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Dave Hansen <dave.hansen@...el.com>,
sean.j.christopherson@...el.com, nhorman@...hat.com,
npmccallum@...hat.com, linux-sgx@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, serge.ayoun@...el.com,
suresh.b.siddha@...el.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v13 08/13] x86/sgx: Add wrappers for ENCLS leaf functions
On Mon, Aug 27, 2018 at 9:58 PM Jarkko Sakkinen
<jarkko.sakkinen@...ux.intel.com> 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
Powered by blists - more mailing lists