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:   Fri, 15 Jul 2022 10:03:17 +0200
From:   Hendrik Brueckner <brueckner@...ux.ibm.com>
To:     Heiko Carstens <hca@...ux.ibm.com>
Cc:     Steffen Eiden <seiden@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Janosch Frank <frankja@...ux.ibm.com>,
        Claudio Imbrenda <imbrenda@...ux.ibm.com>,
        Vasily Gorbik <gor@...ux.ibm.com>, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org, nrb@...ux.ibm.com
Subject: Re: [PATCH 1/3] s390/cpufeature: rework to allow more than only
 hwcap bits

On Thu, Jul 14, 2022 at 12:52:25PM +0200, Heiko Carstens wrote:
> > > > +static struct s390_cpu_feature s390_cpu_features[MAX_CPU_FEATURES] = {
> > > > +	[S390_CPU_FEATURE_ESAN3]	= {.type = TYPE_HWCAP, .num = HWCAP_NR_ESAN3},
> > > > +	[S390_CPU_FEATURE_ZARCH]	= {.type = TYPE_HWCAP, .num = HWCAP_NR_ZARCH},
> ...
> > > I only realized now that you added all HWCAP bits here. It was
> > > intentional that I added only the two bits which are currently used
> > > for several reasons:
> > > 
> > > - Keep the array as small as possible.
> > > - No need to keep this array in sync with HWCAPs, if new ones are added.
> > > - There is a for loop in print_cpu_modalias() which iterates over all
> > >    MAX_CPU_FEATURES entries; this should be as fast as possible. Adding
> > >    extra entries burns cycles for no added value.
> > The loop in print_cpu_modalias() was the reason why I added all
> > current HWCAPs. The current implementation runs through all HWCAPs
> > using cpu_have_feature() and I feared that reducing to just MSA and
> > VXRS has effects in the reporting of CPU-features to userspace.
> > 
> > I double checked the output of 'grep features /proc/cpuinfo' and it
> > stays the same, for 5.19-rc6, 5.19-rc6+this series, 5.19-rc6+this series
> > with just the two S390_CPU_FEATUREs. I might have misunderstood what happens
> > in that loop in print_cpu_modalias().
> 
> It is used on cpu hotplug to generate a MODALIAS environment
> variable. You can check that by running "udevadm monitor -p"
> and then switching a cpu off/on.
> 
> This environment variable is then used by systemd/udev to load
> feature matching modules via kmod.

See also some notes on the cpu feature in KRN1305 spec (introduced w/ VX
support).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ