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]
Message-ID: <20200611174605.11fb6e84@xps13>
Date:   Thu, 11 Jun 2020 17:46:05 +0200
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Álvaro Fernández Rojas <noltari@...il.com>,
        tsbogend@...ha.franken.de, bcm-kernel-feedback-list@...adcom.com,
        richard@....at, vigneshr@...com,
        Jonas Gorski <jonas.gorski@...il.com>,
        linus.walleij@...aro.org, linux-mips@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-mtd@...ts.infradead.org
Subject: Re: [PATCH v2] mtd: parsers: bcm63xx: simplify CFE detection


Florian Fainelli <f.fainelli@...il.com> wrote on Thu, 11 Jun 2020
08:42:42 -0700:

> On 6/11/2020 8:16 AM, Álvaro Fernández Rojas wrote:
> > Hi Miquel,
> >   
> >> El 11 jun 2020, a las 9:55, Miquel Raynal <miquel.raynal@...tlin.com> escribió:
> >>
> >> Hi Álvaro,
> >>
> >> Álvaro Fernández Rojas <noltari@...il.com> wrote on Mon,  8 Jun 2020
> >> 18:06:49 +0200:
> >>  
> >>> Instead of trying to parse CFE version string, which is customized by some
> >>> vendors, let's just check that "CFE1" was passed on argument 3.
> >>>
> >>> Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
> >>> Signed-off-by: Jonas Gorski <jonas.gorski@...il.com>
> >>> ---
> >>> v2: use CFE_EPTSEAL definition and avoid using an additional funtion.
> >>>
> >>> drivers/mtd/parsers/bcm63xxpart.c | 29 ++++-------------------------
> >>> 1 file changed, 4 insertions(+), 25 deletions(-)
> >>>
> >>> diff --git a/drivers/mtd/parsers/bcm63xxpart.c b/drivers/mtd/parsers/bcm63xxpart.c
> >>> index 78f90c6c18fd..493a75b2f266 100644
> >>> --- a/drivers/mtd/parsers/bcm63xxpart.c
> >>> +++ b/drivers/mtd/parsers/bcm63xxpart.c
> >>> @@ -22,6 +22,9 @@
> >>> #include <linux/mtd/partitions.h>
> >>> #include <linux/of.h>
> >>>
> >>> +#include <asm/bootinfo.h>
> >>> +#include <asm/fw/cfe/cfe_api.h>  
> >>
> >> Are you sure both includes are needed?  
> > 
> > asm/bootinfo.h is needed for fw_arg3 and asm/fw/cfe/cfe_api.h is needed for CFE_EPTSEAL.
> >   
> >>
> >> I don't think it is a good habit to include asm/ headers, are you sure
> >> there is not another header doing it just fine?  
> > 
> > Both are needed unless you want to add another definition of CFE_EPTSEAL value.
> > There are currently two CFE magic definitions, the one in asm/fw/cfe/cfe_api.h and another one in bcm47xxpart.c:
> > https://github.com/torvalds/linux/blob/master/arch/mips/include/asm/fw/cfe/cfe_api.h#L28
> > https://github.com/torvalds/linux/blob/master/drivers/mtd/parsers/bcm47xxpart.c#L33  
> 
> The caveat with that approach is that this reduces the compilation
> surface to MIPS and BMIPS_GENERIC and BCM63XX only, which is a bit
> small. If we could move the CFE definitions to a shared header, and
> consolidate the value used by bcm47xxpart.c as well, that would allow us
> to build the bcm63xxpart.c file with COMPILE_TEST on other
> architectures. This does not really have functional value, but for
> maintainers like Miquel, it allows them to quickly test their entire
> drivers/mtd/ directory.

Absolutely!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ