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] [day] [month] [year] [list]
Date:   Tue, 16 Oct 2018 14:48:13 +0300
From:   Jani Nikula <jani.nikula@...ux.intel.com>
To:     Chris Wilson <chris@...is-wilson.co.uk>,
        Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        Stephen Boyd <swboyd@...omium.org>
Cc:     Michal Marek <michal.lkml@...kovi.net>,
        intel-gfx@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        dri-devel@...ts.freedesktop.org,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Andrey Ryabinin <aryabinin@...tuozzo.com>
Subject: Re: [PATCH] drm/i915: Silence build error with UBSAN

On Tue, 16 Oct 2018, Chris Wilson <chris@...is-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-10-16 10:59:42)
>> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
>> index f27dbe26bcc1..897d5a557d88 100644
>> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
>> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
>> @@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
>>         i915_gem_batch_pool_init(&engine->batch_pool, engine);
>>  }
>>  
>> +#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
>> +
>>  static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>>  {
>>         struct intel_engine_execlists * const execlists = &engine->execlists;
>>  
>>         execlists->port_mask = 1;
>> -       BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
>> +       GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));
>
> That should be happy with is_power_of_2() from log2.h

D'oh. Thanks. I was sure there was one, I looked for it, but my git
greps were all upper case. :/

I'll spin a new version, along with the other clang build fix.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ