iT邦幫忙

2024 iThome 鐵人賽

DAY 20
1

今日的行程:
辦公室:9:00 - 18:30
讀書室:19:35 - 19:45

晚上有事情,先記錄點上班看的東西

正片開始

#0  local_flush_tlb_all () at arch/riscv/include/asm/tlbflush.h:19
#1  setup_vm_final () at arch/riscv/mm/init.c:1151
#2  paging_init () at arch/riscv/mm/init.c:1238
#3  0xffffffff806604b0 in setup_arch () at arch/riscv/kernel/setup.c:279
#4  0xffffffff8065d7c8 in start_kernel () at init/main.c:960
#5  0xffffffff80001178 in _start_kernel () at arch/riscv/kernel/head.S:328
${linux}/arch/riscv/mm/init.c

paging_init -->
    setup_bootmem            // physical memory allocator
    setup_vm_final -->       // setting up kernel page table
        
        create_pgd_mapping (swapper_pg_dir /* pgd */, FIXADDR_START /* va */, 
                            /*pa*/, PGDIR_SIZE, PAGE_TABLE /* prot */)
        
        /* Map all memory banks in the linear mapping */
        for_each_mem_range(i, &start, &end)
            ...
        
        /* Map Kernel */
        if (IS_ENABLED(CONFIG_64BIT))
            create_kernel_page_table(swapper_pg_dir, false);
           
        // switch to new kernel mapping and sfence.vma to make this modification observable
        csr_write(CSR_SATP, PFN_DOWN(__pa_symbol(swapper_pg_dir)) | satp_mode);
        local_flush_tlb_all();
        ...

總結

  • 踏出了瞭解 RISC-V Kernel Page Table 建置過程 (SV48) 的一小步!

上一篇
[鐵人賽] Day 19 ARM 第 7 章節 A64 常見錯誤
下一篇
[鐵人賽] Day 21 ARM 第 9 章節 Linker & Linker Script
系列文
上班辦公室,下班讀書室:RISC-V / ARM64 體系結構編程與實踐30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言