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]
Message-ID: <DBBPR08MB4538F21BA01114A0D30485E0F74E9@DBBPR08MB4538.eurprd08.prod.outlook.com>
Date:   Thu, 22 Sep 2022 08:26:16 +0000
From:   Justin He <Justin.He@....com>
To:     Borislav Petkov <bp@...en8.de>
CC:     Len Brown <lenb@...nel.org>, James Morse <James.Morse@....com>,
        Tony Luck <tony.luck@...el.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Robert Richter <rric@...nel.org>,
        Robert Moore <robert.moore@...el.com>,
        Qiuxu Zhuo <qiuxu.zhuo@...el.com>,
        Yazen Ghannam <yazen.ghannam@....com>,
        Jan Luebbe <jlu@...gutronix.de>,
        Khuong Dinh <khuong@...amperecomputing.com>,
        Kani Toshi <toshi.kani@....com>,
        Ard Biesheuvel <ardb@...nel.org>,
        "linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
        "devel@...ica.org" <devel@...ica.org>,
        "Rafael J . Wysocki" <rafael@...nel.org>,
        Shuai Xue <xueshuai@...ux.alibaba.com>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        "linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
        nd <nd@....com>
Subject: RE: [PATCH v6 5/8] EDAC/ghes: Make ghes_edac a proper module to
 remove the dependency on ghes

Hi Borislav

> -----Original Message-----
> From: Borislav Petkov <bp@...en8.de>
> Sent: Wednesday, September 21, 2022 1:22 AM
> To: Justin He <Justin.He@....com>
> Cc: Len Brown <lenb@...nel.org>; James Morse <James.Morse@....com>;
> Tony Luck <tony.luck@...el.com>; Mauro Carvalho Chehab
> <mchehab@...nel.org>; Robert Richter <rric@...nel.org>; Robert Moore
> <robert.moore@...el.com>; Qiuxu Zhuo <qiuxu.zhuo@...el.com>; Yazen
> Ghannam <yazen.ghannam@....com>; Jan Luebbe <jlu@...gutronix.de>;
> Khuong Dinh <khuong@...amperecomputing.com>; Kani Toshi
> <toshi.kani@....com>; Ard Biesheuvel <ardb@...nel.org>;
> linux-acpi@...r.kernel.org; linux-kernel@...r.kernel.org;
> linux-edac@...r.kernel.org; devel@...ica.org; Rafael J . Wysocki
> <rafael@...nel.org>; Shuai Xue <xueshuai@...ux.alibaba.com>; Jarkko
> Sakkinen <jarkko@...nel.org>; linux-efi@...r.kernel.org; nd <nd@....com>
> Subject: Re: [PATCH v6 5/8] EDAC/ghes: Make ghes_edac a proper module to
> remove the dependency on ghes
> 
> On Mon, Sep 12, 2022 at 02:40:02PM +0000, Jia He wrote:
> > Commit dc4e8c07e9e2 ("ACPI: APEI: explicit init of HEST and GHES in
> > apci_init()") introduced a bug that ghes_edac_register() would be
> > invoked before edac_init(). Because at that time, the bus "edac"
> > hadn't been even registered, this created sysfs /devices/mc0 instead
> > of
> > /sys/devices/system/edac/mc/mc0 on an Ampere eMag server.
> >
> > To remove the dependency of ghes_edac on ghes, make it a proper
> > module. Use a list to save the probing devices in ghes_probe(), and
> > defer the
> > ghes_edac_register() to module_init() of the new ghes_edac module by
> > iterating over the devices list.
> >
> > The ghes_edac_force_enable check is not needed in
> > ghes_edac_unregister() since it has been checked in ghes_edac_init().
> >
> > Co-developed-by: Borislav Petkov <bp@...en8.de>
> > Signed-off-by: Borislav Petkov <bp@...en8.de>
> > Signed-off-by: Jia He <justin.he@....com>
> > Fixes: dc4e8c07e9e2 ("ACPI: APEI: explicit init of HEST and GHES in
> > apci_init()")
> > Cc: Shuai Xue <xueshuai@...ux.alibaba.com>
> > Acked-by: Toshi Kani <toshi.kani@....com>
> > ---
> >  drivers/acpi/apei/ghes.c | 22 +++++++++++++--
> >  drivers/edac/Kconfig     |  4 +--
> >  drivers/edac/ghes_edac.c | 59
> +++++++++++++++++++++++-----------------
> >  include/acpi/ghes.h      | 24 ++++------------
> >  4 files changed, 62 insertions(+), 47 deletions(-)
> 
> So those last three patches look unnecessarily complex. You don't need to
> export ghes_edac_force_enable and you don't need that
> ghes_edac_preferred() thing.
> 
> IOW, I'd like to see the below split into two patches:
> 
> 1. Add ghes_get_devices() to ghes.c along with moving the
> ghes_edac_force_enable param to ghes.c
> 
> 2. Add init() and exit() module functions and fixup Kconfig
> 
> There's no need for ghes_present - ghes.c has either registered devices or
> not.
> 

If there is no ghes_present flag.
What if ghes.disable is passed to kernel boot parameter and then ghes_edac is
loaded by modprobe?
Thus, ghes_edac can be loaded even if ghes is disabled. (ghes_dev list is null)

The ghes_present is to avoid this case.

What do u think of it?

--
Cheers,
Justin (Jia He)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ