lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e2a5726f-1ddf-f95b-a3c3-b9d41a79579d@infradead.org>
Date:   Mon, 10 Feb 2020 08:59:34 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Stephen Rothwell <sfr@...b.auug.org.au>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: linux-next: Tree for Feb 7 (objtool warning)

On 2/10/20 2:29 AM, Peter Zijlstra wrote:
> On Fri, Feb 07, 2020 at 08:17:25AM -0800, Randy Dunlap wrote:
>> on x86_64:
>>
>> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.o: warning: objtool: i915_gem_execbuffer2_ioctl()+0x6c7: call to gen8_canonical_addr() with UACCESS enabled
> 
>> CONFIG_CC_OPTIMIZE_FOR_SIZE=y
>> CONFIG_64BIT=y
> 
> That's just really sad, stupid compiler.
> 
> Something like so I suppose...

Yes, that works.  Thanks.

Acked-by: Randy Dunlap <rdunlap@...radead.org> # build-tested


> diff --git a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> index 51b8718513bc..db6b75d4572f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> +++ b/drivers/gpu/drm/i915/gt/intel_gpu_commands.h
> @@ -330,12 +330,12 @@
>   * canonical form [63:48] == [47]."
>   */
>  #define GEN8_HIGH_ADDRESS_BIT 47
> -static inline u64 gen8_canonical_addr(u64 address)
> +static __always_inline u64 gen8_canonical_addr(u64 address)
>  {
>  	return sign_extend64(address, GEN8_HIGH_ADDRESS_BIT);
>  }
>  
> -static inline u64 gen8_noncanonical_addr(u64 address)
> +static __always_inline u64 gen8_noncanonical_addr(u64 address)
>  {
>  	return address & GENMASK_ULL(GEN8_HIGH_ADDRESS_BIT, 0);
>  }
> diff --git a/include/linux/bitops.h b/include/linux/bitops.h
> index 47f54b459c26..9acf654f0b19 100644
> --- a/include/linux/bitops.h
> +++ b/include/linux/bitops.h
> @@ -162,7 +162,7 @@ static inline __u8 ror8(__u8 word, unsigned int shift)
>   *
>   * This is safe to use for 16- and 8-bit types as well.
>   */
> -static inline __s32 sign_extend32(__u32 value, int index)
> +static __always_inline __s32 sign_extend32(__u32 value, int index)
>  {
>  	__u8 shift = 31 - index;
>  	return (__s32)(value << shift) >> shift;
> @@ -173,7 +173,7 @@ static inline __s32 sign_extend32(__u32 value, int index)
>   * @value: value to sign extend
>   * @index: 0 based bit index (0<=index<64) to sign bit
>   */
> -static inline __s64 sign_extend64(__u64 value, int index)
> +static __always_inline __s64 sign_extend64(__u64 value, int index)
>  {
>  	__u8 shift = 63 - index;
>  	return (__s64)(value << shift) >> shift;
> 


-- 
~Randy
Reported-by: Randy Dunlap <rdunlap@...radead.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ