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:   Wed, 31 Oct 2018 07:29:47 -0500
From:   Rob Herring <robh+dt@...nel.org>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Frank Rowand <frowand.list@...il.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Marc Zyngier <marc.zyngier@....com>,
        Russell King <rmk+kernel@...linux.org.uk>,
        aryabinin@...tuozzo.com, Andrey Konovalov <andreyknvl@...gle.com>,
        Masahiro Yamada <yamada.masahiro@...ionext.com>,
        Robin Murphy <robin.murphy@....com>,
        Laura Abbott <labbott@...hat.com>,
        Stefan Agner <stefan@...er.ch>,
        Johannes Weiner <hannes@...xchg.org>, ghackmann@...roid.com,
        Kristina Martsenko <kristina.martsenko@....com>,
        chandan.vn@...sung.com,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>, devicetree@...r.kernel.org,
        rppt@...ux.ibm.com, Russell King <linux@...linux.org.uk>,
        Greentime Hu <green.hu@...il.com>, deanbo422@...il.com,
        gxt@....edu.cn, Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        arcml <linux-snps-arc@...ts.infradead.org>,
        Vineet Gupta <vgupta@...opsys.com>
Subject: Re: [PATCH v2 5/6] of/fdt: Remove custom __early_init_dt_declare_initrd()
 implementation

On Tue, Oct 30, 2018 at 6:07 PM Florian Fainelli <f.fainelli@...il.com> wrote:
>
> Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid
> of its custom __early_init_dt_declare_initrd() which causes a fair
> amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order
> to make sure ARM64 does not produce a BUG() when VM debugging is turned
> on though, we must avoid early calls to __va() which is what
> __early_init_dt_declare_initrd() does and wrap this around to avoid
> running that code on ARM64.
>
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>  arch/arm64/include/asm/memory.h | 8 --------
>  drivers/of/fdt.c                | 9 +++++++--
>  2 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h
> index b96442960aea..dc3ca21ba240 100644
> --- a/arch/arm64/include/asm/memory.h
> +++ b/arch/arm64/include/asm/memory.h
> @@ -168,14 +168,6 @@
>  #define IOREMAP_MAX_ORDER      (PMD_SHIFT)
>  #endif
>
> -#ifdef CONFIG_BLK_DEV_INITRD
> -#define __early_init_dt_declare_initrd(__start, __end)                 \
> -       do {                                                            \
> -               initrd_start = (__start);                               \
> -               initrd_end = (__end);                                   \
> -       } while (0)
> -#endif
> -
>  #ifndef __ASSEMBLY__
>
>  #include <linux/bitops.h>
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index e34cb49231b5..f2b5becae96a 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -892,15 +892,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match,
>  }
>
>  #ifdef CONFIG_BLK_DEV_INITRD
> -#ifndef __early_init_dt_declare_initrd
>  static void __early_init_dt_declare_initrd(unsigned long start,
>                                            unsigned long end)
>  {
> +       /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is
> +        * enabled since __va() is called too early. ARM64 does make use
> +        * of phys_initrd_start/phys_initrd_size so we can skip this
> +        * conversion.
> +        */
> +#if (!IS_ENABLED(CONFIG_ARM64))

Use 'if' not '#if'. Use C code rather than preprocessor whenever possible.

>         initrd_start = (unsigned long)__va(start);
>         initrd_end = (unsigned long)__va(end);
>         initrd_below_start_ok = 1;
> -}
>  #endif
> +}
>
>  /**
>   * early_init_dt_check_for_initrd - Decode initrd location from flat tree
> --
> 2.17.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ