On Thu, Aug 08, 2019 at 09:44:32AM -0700, Rob Clark wrote: > > GFP_HIGHUSER basically just means that this is an allocation that could > > dip into highmem, in which case it would not have a kernel mapping. > > This can happen on arm + LPAE, but not on arm64. > > Just a dumb question, but why is *all* memory in the linear map on > arm64? It would seem useful to have a source of pages that is not in > the linear map. > I guess it is mapped as huge pages (or something larger than 4k pages)?
In general that is just how the Linux kernel always worked, on all architectures - we always had a linear mapping for all memory in the kernel to make accessing it simple. That started to break down a bit with the 32-bit x86 PAE mode that supported more physical addressing that virtual, which required the "high" memory to not be mapped into the kernel direct mapping. Similar schemes later showed up on various other 32-bit architectures. There is a patchset called XPFO that ensures memory is either in the kernel direct map, or in userspace but not both to work around speculation related vulnerabilities, but it has a pretty big performance impact. > Any recommended reading to understand how/why the kernel address space > is setup the way it is (so I can ask fewer dumb questions)? I don't really have a good pointer. But usually there is just dumb answers, not dumb questions.