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]
Date:   Mon, 11 Oct 2021 19:32:38 +0000
From:   "Winiarska, Iwona" <iwona.winiarska@...el.com>
To:     "bp@...en8.de" <bp@...en8.de>
CC:     "corbet@....net" <corbet@....net>,
        "jae.hyun.yoo@...ux.intel.com" <jae.hyun.yoo@...ux.intel.com>,
        "d.mueller@...oft.ch" <d.mueller@...oft.ch>,
        "linux-hwmon@...r.kernel.org" <linux-hwmon@...r.kernel.org>,
        "andrew@...id.au" <andrew@...id.au>,
        "Luck, Tony" <tony.luck@...el.com>,
        "Lutomirski, Andy" <luto@...nel.org>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>,
        "mchehab@...nel.org" <mchehab@...nel.org>,
        "jdelvare@...e.com" <jdelvare@...e.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "olof@...om.net" <olof@...om.net>,
        "mingo@...hat.com" <mingo@...hat.com>,
        "rdunlap@...radead.org" <rdunlap@...radead.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "linux-aspeed@...ts.ozlabs.org" <linux-aspeed@...ts.ozlabs.org>,
        "arnd@...db.de" <arnd@...db.de>,
        "linux-doc@...r.kernel.org" <linux-doc@...r.kernel.org>,
        "linux@...ck-us.net" <linux@...ck-us.net>,
        "zweiss@...inix.com" <zweiss@...inix.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "openbmc@...ts.ozlabs.org" <openbmc@...ts.ozlabs.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "joel@....id.au" <joel@....id.au>,
        "yazen.ghannam@....com" <yazen.ghannam@....com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "pierre-louis.bossart@...ux.intel.com" 
        <pierre-louis.bossart@...ux.intel.com>,
        "x86@...nel.org" <x86@...nel.org>,
        "Williams, Dan J" <dan.j.williams@...el.com>
Subject: Re: [PATCH v2 02/15] x86/cpu: Extract cpuid helpers to
 arch-independent

On Mon, 2021-10-04 at 21:08 +0200, Borislav Petkov wrote:
> On Tue, Aug 03, 2021 at 01:31:21PM +0200, Iwona Winiarska wrote:
> > Baseboard management controllers (BMC) often run Linux but are usually
> > implemented with non-X86 processors. They can use PECI to access package
> > config space (PCS) registers on the host CPU and since some information,
> > e.g. figuring out the core count, can be obtained using different
> > registers on different CPU generations, they need to decode the family
> > and model.
> > 
> > The format of Package Identifier PCS register that describes CPUID
> > information has the same layout as CPUID_1.EAX, so let's allow to reuse
> > cpuid helpers by making it available for other architectures as well.
> > 
> > Signed-off-by: Iwona Winiarska <iwona.winiarska@...el.com>
> > Reviewed-by: Tony Luck <tony.luck@...el.com>
> > Reviewed-by: Dan Williams <dan.j.williams@...el.com>
> > ---
> >  MAINTAINERS                      | 1 +
> >  arch/x86/Kconfig                 | 1 +
> >  arch/x86/include/asm/cpu.h       | 3 ---
> >  arch/x86/include/asm/microcode.h | 2 +-
> >  arch/x86/kvm/cpuid.h             | 3 ++-
> >  arch/x86/lib/Makefile            | 2 +-
> >  drivers/edac/mce_amd.c           | 3 +--
> >  include/linux/x86/cpu.h          | 9 +++++++++
> >  lib/Kconfig                      | 4 ++++
> >  lib/Makefile                     | 2 ++
> >  lib/x86/Makefile                 | 3 +++
> >  {arch/x86/lib => lib/x86}/cpu.c  | 2 +-
> >  12 files changed, 26 insertions(+), 9 deletions(-)
> >  create mode 100644 include/linux/x86/cpu.h
> >  create mode 100644 lib/x86/Makefile
> >  rename {arch/x86/lib => lib/x86}/cpu.c (95%)
> 
> AFAICT, all that churn is done for x86_family() and x86_model() which
> are used *exactly* *once* and which are almost trivial anyway.

Correct.

> What's wrong with simply computing the family and model "by hand", so to
> speak, in peci_device_info_init() and do away with that diffstat
> 
>  12 files changed, 26 insertions(+), 9 deletions(-)
> 
> ?

Nothing wrong - just a trade-off between churn and keeping things tidy and not
duplicated, similar to patch 1.
And just like in patch 1, if you have a strong opinion against it - we can
duplicate. 

Thanks
-Iwona

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ