xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: <linux-kernel@vger.kernel.org>
Cc: Juergen Gross <jgross@suse.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v3 3/4] Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE"
Date: Mon, 27 Jul 2020 11:13:41 +0200	[thread overview]
Message-ID: <20200727091342.52325-4-roger.pau@citrix.com> (raw)
In-Reply-To: <20200727091342.52325-1-roger.pau@citrix.com>

This reverts commit dfd74a1edfaba5864276a2859190a8d242d18952.

This has been fixed by commit dca4436d1cf9e0d237c 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>
---
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org
---
 drivers/xen/balloon.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 292413b27575..b1d8b028bf80 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -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;
 }
 
-- 
2.27.0



  parent reply	other threads:[~2020-07-27  9:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27  9:13 [PATCH v3 0/4] xen/balloon: fixes for memory hotplug Roger Pau Monne
2020-07-27  9:13 ` [PATCH v3 1/4] xen/balloon: fix accounting in alloc_xenballooned_pages error path Roger Pau Monne
2020-08-03  6:18   ` Jürgen Groß
2020-07-27  9:13 ` [PATCH v3 2/4] xen/balloon: make the balloon wait interruptible Roger Pau Monne
2020-08-03  6:18   ` Jürgen Groß
2020-07-27  9:13 ` Roger Pau Monne [this message]
2020-08-03  6:19   ` [PATCH v3 3/4] Revert "xen/balloon: Fix crash when ballooning on x86 32 bit PAE" Jürgen Groß
2020-07-27  9:13 ` [PATCH v3 4/4] xen: add helpers to allocate unpopulated memory Roger Pau Monne
2020-07-27 15:09   ` Jürgen Groß
2020-07-28 11:42   ` [PATCH] xen/balloon: add header guard Roger Pau Monne
2020-07-28 13:56     ` Boris Ostrovsky
2020-07-28 16:48   ` [PATCH v3 4/4] xen: add helpers to allocate unpopulated memory Julien Grall
2020-07-28 16:59     ` Roger Pau Monné
2020-07-28 17:06       ` Andrew Cooper
2020-07-28 17:42         ` Roger Pau Monné
2020-07-28 17:12       ` Julien Grall
2020-07-28 17:44         ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200727091342.52325-4-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).