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  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:   Mon, 23 Jan 2017 15:48:22 -0500
From:   Jason Baron <jbaron@...mai.com>
To:     Ingo Molnar <mingo@...nel.org>
Cc:     peterz@...radead.org, rostedt@...dmis.org,
        linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v2] jump_label: reduce the size of struct static_key



On 01/21/2017 02:07 AM, Ingo Molnar wrote:
>
> * Jason Baron <jbaron@...mai.com> wrote:
>
>>> For example the last line could sure be written as:
>>>
>>> 			key->entries = jlm->entries;
>>> 			key->type |= static_key_type(key);
>>>
>>> right?
>>
>> Hi,
>>
>> So that is going to over-write the static_key_type(key) in the first
>> assignment. If the order is reversed we can't just |= in the pointer type.
>
> Indeed, I missed that.
>
>> How about:
>>
>> static void jump_key_set_entries(struct static_key *key, struct jump_entry *entries)
>> {
>>        unsigned long type;
>>
>>        type = static_key_type(key);
>>        key->entries = entries;
>>        key->type |= type;
>> }
>>
>> and then we can also add:
>>
>> void jump_key_set_mod(struct static_key *key, struct static_key_mod *mod)
>>
>> doing basically the same thing. That will avoid the casts that you called
>> out.
>>
>> better?
>
> Yeah - and it should generate the exact same code, right?

yes, looks identical.

>
> I'd also add a short comment to the helper function that points out the
> union/aliasing, in case anyone is wondering.
>

Ok, I'll add that to v3.

Thanks,

-Jason

Powered by blists - more mailing lists