On Wed, May 29, 2019 at 07:58:57PM +0200, Rolf Eike Beer wrote: > Sven Schnelle wrote: > > On Tue, May 28, 2019 at 10:19:11AM +0200, Rolf Eike Beer wrote: > > > Another nitpick: the "+4" and "-sizeof(u32)" are just the same at the end, > > > but why do they use entirely different wording? What do we need "addr" for > > > anyway, one could just look at "p" which would cross a page boundary at > > > the > > > same time, no? > > > > You can't, because of the patch_map() call below which updates the fixed > > mapping. That call needs the real virtual address, while *p holds the > > virtual address of the fixed mapping for patching. > > Can that remapping really place it at a non-zero offset regarding to the > underlying page? That it moves the page descriptor around is normal, but it > will keep the low order bits intact, so the page boundary crossing will be > still the same, no? For the page crossing check it doesn't make a difference whether you check p or addr, but for the patch_map() you can only use addr. So we have to update both variables. Regards Sven