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: <CAKv+Gu_OMs12qBxvZGnrUnMD782yYPpcvBDqRGug2YDhhvcfSw@mail.gmail.com>
Date:   Thu, 27 Feb 2020 21:00:54 +0100
From:   Ard Biesheuvel <ardb@...nel.org>
To:     Atish Patra <Atish.Patra@....com>
Cc:     "alexios.zavras@...el.com" <alexios.zavras@...el.com>,
        "tglx@...utronix.de" <tglx@...utronix.de>,
        "mchehab+samsung@...nel.org" <mchehab+samsung@...nel.org>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "michal.simek@...inx.com" <michal.simek@...inx.com>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "abner.chang@....com" <abner.chang@....com>,
        "linux-riscv@...ts.infradead.org" <linux-riscv@...ts.infradead.org>,
        "catalin.marinas@....com" <catalin.marinas@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "daniel.schaefer@....com" <daniel.schaefer@....com>,
        Anup Patel <Anup.Patel@....com>,
        "kstewart@...uxfoundation.org" <kstewart@...uxfoundation.org>,
        "palmer@...belt.com" <palmer@...belt.com>,
        "aou@...s.berkeley.edu" <aou@...s.berkeley.edu>,
        "arnd@...db.de" <arnd@...db.de>,
        "rppt@...ux.ibm.com" <rppt@...ux.ibm.com>,
        "linux-efi@...r.kernel.org" <linux-efi@...r.kernel.org>,
        "bp@...e.de" <bp@...e.de>,
        "greentime.hu@...ive.com" <greentime.hu@...ive.com>,
        "keescook@...omium.org" <keescook@...omium.org>,
        "agraf@...raf.de" <agraf@...raf.de>,
        "will@...nel.org" <will@...nel.org>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
        "mingo@...nel.org" <mingo@...nel.org>,
        "allison@...utok.net" <allison@...utok.net>,
        "paul.walmsley@...ive.com" <paul.walmsley@...ive.com>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "leif@...iainc.com" <leif@...iainc.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
Subject: Re: [RFC PATCH 3/5] RISC-V: Define fixmap bindings for generic early
 ioremap support

On Thu, 27 Feb 2020 at 20:58, Atish Patra <Atish.Patra@....com> wrote:
>
> On Wed, 2020-02-26 at 08:08 +0100, Ard Biesheuvel wrote:
> > On Wed, 26 Feb 2020 at 02:10, Atish Patra <atish.patra@....com>
> > wrote:
> > > UEFI uses early IO or memory mappings for runtime services before
> > > normal ioremap() is usable. This patch only adds minimum necessary
> > > fixmap bindings and headers for generic ioremap support to work.
> > >
> > > Signed-off-by: Atish Patra <atish.patra@....com>
> >
> > Looks reasonable to me,
> >
> > Acked-by: Ard Biesheuvel <ardb@...nel.org>
> >
> > although I wonder why it is part of this series?
> >
>
> because of CONFIG_EFI. With CONFIG_EFI enabled, all the run time
> service memory mapping code is compiled for RISC-V. I could have
> createa a separate config for only boot time services or used EFI_STUB
> at places where CONFI_EFI. But it seems redundant as we will support
> runtime services soon. Let me know if that's a wrong approach.
>

No that's fine



> > > ---
> > >  arch/riscv/Kconfig              |  1 +
> > >  arch/riscv/include/asm/Kbuild   |  1 +
> > >  arch/riscv/include/asm/fixmap.h | 21 ++++++++++++++++++++-
> > >  arch/riscv/include/asm/io.h     |  1 +
> > >  4 files changed, 23 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > > index 27bfc7947e44..42c122170cfd 100644
> > > --- a/arch/riscv/Kconfig
> > > +++ b/arch/riscv/Kconfig
> > > @@ -65,6 +65,7 @@ config RISCV
> > >         select ARCH_HAS_GCOV_PROFILE_ALL
> > >         select HAVE_COPY_THREAD_TLS
> > >         select HAVE_ARCH_KASAN if MMU && 64BIT
> > > +       select GENERIC_EARLY_IOREMAP
> > >
> > >  config ARCH_MMAP_RND_BITS_MIN
> > >         default 18 if 64BIT
> > > diff --git a/arch/riscv/include/asm/Kbuild
> > > b/arch/riscv/include/asm/Kbuild
> > > index ec0ca8c6ab64..517394390106 100644
> > > --- a/arch/riscv/include/asm/Kbuild
> > > +++ b/arch/riscv/include/asm/Kbuild
> > > @@ -4,6 +4,7 @@ generic-y += checksum.h
> > >  generic-y += compat.h
> > >  generic-y += device.h
> > >  generic-y += div64.h
> > > +generic-y += early_ioremap.h
> > >  generic-y += extable.h
> > >  generic-y += flat.h
> > >  generic-y += dma.h
> > > diff --git a/arch/riscv/include/asm/fixmap.h
> > > b/arch/riscv/include/asm/fixmap.h
> > > index 42d2c42f3cc9..7a4beb7e29a3 100644
> > > --- a/arch/riscv/include/asm/fixmap.h
> > > +++ b/arch/riscv/include/asm/fixmap.h
> > > @@ -25,9 +25,28 @@ enum fixed_addresses {
> > >  #define FIX_FDT_SIZE   SZ_1M
> > >         FIX_FDT_END,
> > >         FIX_FDT = FIX_FDT_END + FIX_FDT_SIZE / PAGE_SIZE - 1,
> > > +       FIX_EARLYCON_MEM_BASE,
> > > +
> > >         FIX_PTE,
> > >         FIX_PMD,
> > > -       FIX_EARLYCON_MEM_BASE,
> > > +       /*
> > > +        * Make sure that it is 2MB aligned.
> > > +        */
> > > +#define NR_FIX_SZ_2M   (SZ_2M / PAGE_SIZE)
> > > +       FIX_THOLE = NR_FIX_SZ_2M - FIX_PMD - 1,
> > > +
> > > +       __end_of_permanent_fixed_addresses,
> > > +       /*
> > > +        * Temporary boot-time mappings, used by early_ioremap(),
> > > +        * before ioremap() is functional.
> > > +        */
> > > +#define NR_FIX_BTMAPS          (SZ_256K / PAGE_SIZE)
> > > +#define FIX_BTMAPS_SLOTS       7
> > > +#define TOTAL_FIX_BTMAPS       (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS)
> > > +
> > > +       FIX_BTMAP_END = __end_of_permanent_fixed_addresses,
> > > +       FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1,
> > > +
> > >         __end_of_fixed_addresses
> > >  };
> > >
> > > diff --git a/arch/riscv/include/asm/io.h
> > > b/arch/riscv/include/asm/io.h
> > > index 0f477206a4ed..047f414b6948 100644
> > > --- a/arch/riscv/include/asm/io.h
> > > +++ b/arch/riscv/include/asm/io.h
> > > @@ -14,6 +14,7 @@
> > >  #include <linux/types.h>
> > >  #include <asm/mmiowb.h>
> > >  #include <asm/pgtable.h>
> > > +#include <asm/early_ioremap.h>
> > >
> > >  /*
> > >   * MMIO access functions are separated out to break dependency
> > > cycles
> > > --
> > > 2.24.0
> > >
>
> --
> Regards,
> Atish

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ