Re: [PATCH 3/4] arch: define CONFIG_PAGE_SIZE_*KB on all architectures
On Mon, Feb 26, 2024 at 05:14:13PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Most architectures only support a single hardcoded page size. In order > to ensure that each one of these sets the corresponding Kconfig symbols, > change over the PAGE_SHIFT definition to the common one and allow > only the hardware page size to be selected. > > Signed-off-by: Arnd Bergmann > --- > arch/alpha/Kconfig | 1 + > arch/alpha/include/asm/page.h | 2 +- > arch/arm/Kconfig | 1 + > arch/arm/include/asm/page.h| 2 +- > arch/csky/Kconfig | 1 + > arch/csky/include/asm/page.h | 2 +- > arch/m68k/Kconfig | 3 +++ > arch/m68k/Kconfig.cpu | 2 ++ > arch/m68k/include/asm/page.h | 6 +- > arch/microblaze/Kconfig| 1 + > arch/microblaze/include/asm/page.h | 2 +- > arch/nios2/Kconfig | 1 + > arch/nios2/include/asm/page.h | 2 +- > arch/openrisc/Kconfig | 1 + > arch/openrisc/include/asm/page.h | 2 +- > arch/riscv/Kconfig | 1 + > arch/riscv/include/asm/page.h | 2 +- > arch/s390/Kconfig | 1 + > arch/s390/include/asm/page.h | 2 +- > arch/sparc/Kconfig | 2 ++ > arch/sparc/include/asm/page_32.h | 2 +- > arch/sparc/include/asm/page_64.h | 3 +-- > arch/um/Kconfig| 1 + > arch/um/include/asm/page.h | 2 +- > arch/x86/Kconfig | 1 + > arch/x86/include/asm/page_types.h | 2 +- > arch/xtensa/Kconfig| 1 + > arch/xtensa/include/asm/page.h | 2 +- > 28 files changed, 32 insertions(+), 19 deletions(-) > diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig > index fd9bb76a610b..3586cda55bde 100644 > --- a/arch/openrisc/Kconfig > +++ b/arch/openrisc/Kconfig > @@ -25,6 +25,7 @@ config OPENRISC > select GENERIC_CPU_DEVICES > select HAVE_PCI > select HAVE_UID16 > + select HAVE_PAGE_SIZE_8KB > select GENERIC_ATOMIC64 > select GENERIC_CLOCKEVENTS_BROADCAST > select GENERIC_SMP_IDLE_THREAD > diff --git a/arch/openrisc/include/asm/page.h > b/arch/openrisc/include/asm/page.h > index 44fc1fd56717..7925ce09ab5a 100644 > --- a/arch/openrisc/include/asm/page.h > +++ b/arch/openrisc/include/asm/page.h > @@ -18,7 +18,7 @@ > > /* PAGE_SHIFT determines the page size */ > > -#define PAGE_SHIFT 13 > +#define PAGE_SHIFT CONFIG_PAGE_SHIFT > #ifdef __ASSEMBLY__ > #define PAGE_SIZE (1 << PAGE_SHIFT) > #else For the openrisc bits, Acked-by: Stafford Horne
Re: [PATCH 05/26] openrisc: map as uncached in ioremap
On Fri, Aug 30, 2019 at 06:07:05PM +0200, Christoph Hellwig wrote: > On Fri, Aug 23, 2019 at 10:55:39PM +0900, Stafford Horne wrote: > > On Sat, Aug 17, 2019 at 09:32:32AM +0200, Christoph Hellwig wrote: > > > Openrisc is the only architecture not mapping ioremap as uncached, > > > which has been the default since the Linux 2.6.x days. Switch it > > > over to implement uncached semantics by default. > > > > > > Signed-off-by: Christoph Hellwig > > > --- > > > arch/openrisc/include/asm/io.h | 20 +++- > > > arch/openrisc/include/asm/pgtable.h | 2 +- > > > arch/openrisc/mm/ioremap.c | 8 ++++ > > > 3 files changed, 8 insertions(+), 22 deletions(-) > > > > Acked-by: Stafford Horne > > Can you send this one to Linus for 5.4? That would help with the > possibility to remove ioremap_nocache after that. Sure, I will pick this up. -Stafford
Re: [PATCH 05/26] openrisc: map as uncached in ioremap
On Sat, Aug 17, 2019 at 09:32:32AM +0200, Christoph Hellwig wrote: > Openrisc is the only architecture not mapping ioremap as uncached, > which has been the default since the Linux 2.6.x days. Switch it > over to implement uncached semantics by default. > > Signed-off-by: Christoph Hellwig > --- > arch/openrisc/include/asm/io.h | 20 +++- > arch/openrisc/include/asm/pgtable.h | 2 +- > arch/openrisc/mm/ioremap.c | 8 > 3 files changed, 8 insertions(+), 22 deletions(-) Acked-by: Stafford Horne Thanks, -Stafford
Re: [PATCH v2 01/21] openrisc: prefer memblock APIs returning virtual address
On Mon, Jan 21, 2019 at 10:03:48AM +0200, Mike Rapoport wrote: > The allocation of the page tables memory in openrics uses > memblock_phys_alloc() and then converts the returned physical address to > virtual one. Use memblock_alloc_raw() and add a panic() if the allocation > fails. > > Signed-off-by: Mike Rapoport > --- > arch/openrisc/mm/init.c | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/arch/openrisc/mm/init.c b/arch/openrisc/mm/init.c > index d157310..caeb418 100644 > --- a/arch/openrisc/mm/init.c > +++ b/arch/openrisc/mm/init.c > @@ -105,7 +105,10 @@ static void __init map_ram(void) > } > > /* Alloc one page for holding PTE's... */ > - pte = (pte_t *) __va(memblock_phys_alloc(PAGE_SIZE, > PAGE_SIZE)); > + pte = memblock_alloc_raw(PAGE_SIZE, PAGE_SIZE); > + if (!pte) > + panic("%s: Failed to allocate page for PTEs\n", > + __func__); > set_pmd(pme, __pmd(_KERNPG_TABLE + __pa(pte))); > > /* Fill the newly allocated page with PTE'S */ This seems reasonable to me. Acked-by: Stafford Horne