]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE"
authorRoger Pau Monne <roger.pau@citrix.com>
Mon, 27 Jul 2020 09:13:41 +0000 (11:13 +0200)
committerJuergen Gross <jgross@suse.com>
Mon, 3 Aug 2020 06:16:18 +0000 (08:16 +0200)
This reverts commit 57b02af32dbea7944f3ac502d3625ed5039ba71a.

This has been fixed by commit b8216e73070d6589f71 which added the out
of bounds check to __add_memory, so that trying to add blocks past
MAX_PHYSMEM_BITS will fail.

Note the check in the Xen balloon driver was bogus anyway, as it
checked the start address of the resource, but it should instead test
the end address to assert the whole resource falls below
MAX_PHYSMEM_BITS.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20200727091342.52325-4-roger.pau@citrix.com
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/xen/balloon.c

index 292413b27575415597af01f2da427cfc608d201d..b1d8b028bf804ac4cc02574dc102f00cd56ec0bd 100644 (file)
@@ -266,20 +266,6 @@ static struct resource *additional_memory_resource(phys_addr_t size)
                return NULL;
        }
 
-#ifdef CONFIG_SPARSEMEM
-       {
-               unsigned long limit = 1UL << (MAX_PHYSMEM_BITS - PAGE_SHIFT);
-               unsigned long pfn = res->start >> PAGE_SHIFT;
-
-               if (pfn > limit) {
-                       pr_err("New System RAM resource outside addressable RAM (%lu > %lu)\n",
-                              pfn, limit);
-                       release_memory_resource(res);
-                       return NULL;
-               }
-       }
-#endif
-
        return res;
 }