mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.52k stars 2.37k forks source link

Questions about vm.c #238

Closed TroyMitchell911 closed 2 months ago

TroyMitchell911 commented 2 months ago

image If alloc of this walk function is 1, it will always be set from level 2 pte to level 0 pte, and the V flag will be set. image But in the mappages function, after calling walk, it is required that the V bit cannot exist. I know it is to prevent remapping, but why does walk set the V bit?

TroyMitchell911 commented 2 months ago

I think the lowest level pte does not need to set the V bit, but it appears in the for

TroyMitchell911 commented 2 months ago

Sorry, I made a stupid mistake, I think I ignored the parameter of for, level won't be 0