If not, how does the kernel build a page table when creating a new process, and modify a page table entry when swapping in/out a page of a process?
I think that instructions, running in either user mode or kernel mode, can only use a virtual address (which is then converted to a physical address by the CPU internal hardware) to access anywhere in the RAM (and memory-mapping peripherals), unless MMU is disabled.
I know that the kernel is responsible for creating and maintaining page tables while the CPU's internal hardware logic looks up in the page table(CR3 in x86 stores the base address of the page table of the current process, which is a physical address) to convert a virtual address to a physical address.
My question is: when the instructions in the kernel code that try to modify the content of a page table entry are executing, how is the virtual address (if any) of the page table itself converted to a physical address? Must MMU be disabled during that time so that no address-translation is needed?