Merge branch 'stable/128gb.v5.1' into stable/for-linus-3.7
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / x86 / xen / setup.c
index d11ca11d14fc094379e989a6b06fe2e5b2bc72e6..3edb320d508f83dee738dd08e3fe539438f08f07 100644 (file)
@@ -431,6 +431,24 @@ char * __init xen_memory_setup(void)
         *  - mfn_list
         *  - xen_start_info
         * See comment above "struct start_info" in <xen/interface/xen.h>
+        * We tried to make the the memblock_reserve more selective so
+        * that it would be clear what region is reserved. Sadly we ran
+        * in the problem wherein on a 64-bit hypervisor with a 32-bit
+        * initial domain, the pt_base has the cr3 value which is not
+        * neccessarily where the pagetable starts! As Jan put it: "
+        * Actually, the adjustment turns out to be correct: The page
+        * tables for a 32-on-64 dom0 get allocated in the order "first L1",
+        * "first L2", "first L3", so the offset to the page table base is
+        * indeed 2. When reading xen/include/public/xen.h's comment
+        * very strictly, this is not a violation (since there nothing is said
+        * that the first thing in the page table space is pointed to by
+        * pt_base; I admit that this seems to be implied though, namely
+        * do I think that it is implied that the page table space is the
+        * range [pt_base, pt_base + nt_pt_frames), whereas that
+        * range here indeed is [pt_base - 2, pt_base - 2 + nt_pt_frames),
+        * which - without a priori knowledge - the kernel would have
+        * difficulty to figure out)." - so lets just fall back to the
+        * easy way and reserve the whole region.
         */
        memblock_reserve(__pa(xen_start_info->mfn_list),
                         xen_start_info->pt_base - xen_start_info->mfn_list);