Coder Social home page Coder Social logo

Comments (3)

aswaterman avatar aswaterman commented on July 28, 2024

Thanks, Sebastian. Can you verify that 26e4369 works correctly for RV32?

from riscv-linux.

s-macke avatar s-macke commented on July 28, 2024

The patch is almost fine except that the PMD_SIZE is defined in asm-generic/pgtable-nopmd.h if no pmd is present. That was the main problem with the code. The code compiled and ran on 32-Bit but lead to a corrupt pagetable. The correct way is to use __PAGETABLE_PMD_FOLDED. This define is also used in arch/riscv/include/asm/pgalloc.h

index b7981d7065ea..2a6ce882081a 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -91,7 +91,7 @@ asmlinkage void __init setup_vm(void)
        BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0);
        BUG_ON((pa % (PAGE_SIZE * PTRS_PER_PTE)) != 0);

-#ifdef PMD_SIZE
+#ifndef __PAGETABLE_PMD_FOLDED
        trampoline_pg_dir[(PAGE_OFFSET >> PGDIR_SHIFT) % PTRS_PER_PGD] =
                pfn_pgd(PFN_DOWN((uintptr_t)trampoline_pmd),
                        __pgprot(_PAGE_TABLE));

from riscv-linux.

aswaterman avatar aswaterman commented on July 28, 2024

Ah, thanks, fixed in 8fa2c8f.

from riscv-linux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.