linux - after setting the cr3 register, why does the machine reboot? -
to understand memory management, implement new page table. insert module kernel(this module creates new page table according orignal page table), through ioctl syscall, can control process use new page table, when kernel module execute mov %rdi,%cr3, machine reboot, have spent time find why, can't solve problem. maybe there understand wrong.
i user qemu's command check pte of page table. i'm sure virtual address 0xffffffffc04bca42 can translate physical address. when use gdb debug, after vm execute 0xffffffffc04bca3f, vm reboot.
when address the next instruction can right translate, why machine reboot? , should solve problem?
i'm going crazy problem.
0xffffffffc04bca2d <ioctl_switchpgd+79>: callq 0xffffffff810cb7a4 <printk> 0xffffffffc04bca32 <ioctl_switchpgd+84>: movabs $0xffffffffffffff,%rdi 0xffffffffc04bca3c <ioctl_switchpgd+94>: , %rbx,%rdi 0xffffffffc04bca3f <ioctl_switchpgd+97>: mov %rdi,%cr3 **0xffffffffc04bca42 <ioctl_switchpgd+100>: nopl 0x0(%rax)** 0xffffffffc04bca46 <ioctl_switchpgd+104>: mov $0xffffffffc04bd13a,%rdi i upload code github, https://github.com/peasentspring/replace_pgd.git. can me?
Comments
Post a Comment