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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 1 Feb 2023 17:22:18 +0000
From:   "Luck, Tony" <tony.luck@...el.com>
To:     Greg KH <gregkh@...uxfoundation.org>,
        "Joseph, Jithu" <jithu.joseph@...el.com>
CC:     "hdegoede@...hat.com" <hdegoede@...hat.com>,
        "markgross@...nel.org" <markgross@...nel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "bp@...en8.de" <bp@...en8.de>,
        "dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>, "hpa@...or.com" <hpa@...or.com>,
        "rostedt@...dmis.org" <rostedt@...dmis.org>,
        "Raj, Ashok" <ashok.raj@...el.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "platform-driver-x86@...r.kernel.org" 
        <platform-driver-x86@...r.kernel.org>,
        "patches@...ts.linux.dev" <patches@...ts.linux.dev>,
        "Shankar, Ravi V" <ravi.v.shankar@...el.com>,
        "Macieira, Thiago" <thiago.macieira@...el.com>,
        "Jimenez Gonzalez, Athenas" <athenas.jimenez.gonzalez@...el.com>,
        "Mehta, Sohil" <sohil.mehta@...el.com>
Subject: RE: [PATCH 4/5] platform/x86/intel/ifs: Implement Array BIST test

> > +/* MSR_ARRAY_BIST bit fields */
> > +union ifs_array {
> > +   u64     data;
> > +   struct {
> > +           u32     array_bitmask           :32;
> > +           u32     array_bank              :16;
> > +           u32     rsvd                    :15;
> > +           u32     ctrl_result             :1;
>
> This isn't going to work well over time, just mask the bits you want off
> properly, don't rely on the compiler to lay them out like this.

What is this "time" issue?  This driver is X86_64 specific (and it seems
incredibly unlikely that some other architecture will copy this h/w
interface so closely that they want to re-use this driver. There's an x86_64
ABI that says how bitfields in C are allocated. So should not break moving
to other C compilers.

Is there going to be a "re-write all drivers in Rust" edict coming soon?

> Note, we have bitmask and bitfield operations, please use them.

We do, but code written using them is not as easy to read (unless
you wrap in even more macros, which has its own maintainability
issues).

There are already thousands of bitfields in Linux kernel source:

$ git grep ':[1-9][0-9]*;' -- include/ | wc -l
2251

Has there been a change in attitude at the kernel maintainers summit?

-Tony

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ