[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/domain: adjust limitation on shared_info allocation below 4G


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Tue, 3 Feb 2026 11:10:17 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2z21zLrbzck0YRU7xZ1+yXNuRUMs/p6MNAGGLBgZmPw=; b=KK2DFT3znGsAfJdt06IMlMekcRTEVnOgwqfzw6XE4xH0ZGK+HwBqM/JjagOqclw62f58XcvGMuuFM9AurLWHLx83VE2CEw6rPfcHguDxJetv4vYg2NgcNoY0rJxPs8RThX45UAwZ8dbO/F4+S+Hb5mQAIN9/7wXRafwCmWW7pEC0czjbrKTfk/jThcoMefFc66e95gcheAKo9msEPDDJTJxcTIP2n7jdOS/h3LQ8q6MBfXti8cVEssELam+Xm9Na+4IX0WZ0tP9R2CAe9sqMCjVSHqLl9y5JnnI+MvyGAk7/BJsJGk7AELxGDml1tH5MheAGYjR5dhhHe+No7i9xaQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nz5e8mHYXGashbY6AgTdDY0eaTLL+aeZhQq40YkbJN/NkpMOtVL31in+N4s0jaxrPQy+mx3fxJ2gfjIrOwgfbXfE00zGvyEmjOosT6Ubr/WHoXAg3WEWUqEYGr2wDVOOId2Qra1YMbeFIN1PSij9t4MmWKGdVTi9q2NJZu5eZVEx8tyaX87J4xQA8a4hBOF7X/RDkqvjP6FPl378f+l5MbDoWIzykeiPwHjFUuLEhle24cQHAaY7HtUDF2NvA+C4hJyxVDKgCD4gSlXTA/RpKCYQU3kpuu9BZm9E4qgDvAKzXwRzQ7zNtlLwYENYykubaRF8GlU+OsKvgq0iytU6Pw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Tue, 03 Feb 2026 10:15:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The limitation of shared_info being allocated below 4G to fit in the
start_info field only applies to 32bit PV guests.  On 64bit PV guests the
start_info field is 64bits wide.  HVM guests don't use start_info at all.

Limit the allocation address restriction to 32bit PV guests only.

Fixes: 3cadc0469d5c ("x86_64: shared_info must be allocated below 4GB as it is 
advertised to 32-bit guests via a 32-bit machine address field in start_info.")
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/domain.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index edb76366b596..4163568043b1 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -882,10 +882,13 @@ int arch_domain_create(struct domain *d,
         goto fail;
 
     /*
-     * The shared_info machine address must fit in a 32-bit field within a
-     * 32-bit guest's start_info structure. Hence we specify MEMF_bits(32).
+     * For 32bit PV guests the shared_info machine address must fit in a 32-bit
+     * field within the guest's start_info structure. Hence we specify
+     * MEMF_bits(32).
      */
-    if ( (d->shared_info = alloc_xenheap_pages(0, MEMF_bits(32))) == NULL )
+    if ( (d->shared_info =
+          alloc_xenheap_pages(0, is_pv_32bit_domain(d) ? MEMF_bits(32)
+                                                       : 0)) == NULL )
         goto fail;
 
     clear_page(d->shared_info);
-- 
2.51.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.