All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][HVM] HVM guest creation crashing with 1 MB of guest memory
@ 2007-05-04 13:47 Andre Przywara
  2007-05-04 13:57 ` Keir Fraser
  0 siblings, 1 reply; 2+ messages in thread
From: Andre Przywara @ 2007-05-04 13:47 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1059 bytes --]

Hi,

When an HVM guest is started and assigned exactly one Megabyte of RAM, 
XEN will crash due to a overflow in building the E820 map in line 90 of 
tools/libxc/xc_hvm_build.c:
e820entry[nr_map].size = mem_size - 0x100000 - PAGE_SIZE * 3;
If memsize is one MB, the result will be negative (and the member is 
unsigned). As I don't think this is worth fixing here, I simply 
increased the minimal required memory for guest from zero to one 
Megabyte. Could someone check the effect on paravirtualized guests?

Regards,
Andre.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>

--
Andre Przywara
AMD-Operating System Research Center (OSRC), Dresden, Germany

----to satisfy European Law for business letters:
AMD Saxony Limited Liability Company & Co. KG
Sitz (Geschäftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, 
Deutschland
Registergericht Dresden: HRA 4896
vertretungsberechtigter Komplementär: AMD Saxony LLC (Sitz Wilmington, 
Delaware, USA)
Geschäftsführer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy

[-- Attachment #2: xen_hvm_one_megabyte_required_patch.txt --]
[-- Type: text/plain, Size: 909 bytes --]

diff -r 3a5722420de7 tools/python/xen/xend/XendConfig.py
--- a/tools/python/xen/xend/XendConfig.py	Thu May 03 19:25:47 2007 +0100
+++ b/tools/python/xen/xend/XendConfig.py	Fri May 04 15:41:15 2007 +0200
@@ -360,9 +360,9 @@ class XendConfig(dict):
         if not self["memory_dynamic_max"] <= self["memory_static_max"]:
             raise XendConfigError("memory_dynamic_max must be less " \
                                   "than or equal to memory_static_max")
-        if not self["memory_dynamic_max"] > 0:
+        if not self["memory_dynamic_max"] > 1048576:
             raise XendConfigError("memory_dynamic_max must be greater " \
-                                  "than zero")
+                                  "than one MB")
         if not self["memory_static_max"] > 0:
             raise XendConfigError("memory_static_max must be greater " \
                                   "than zero")

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][HVM] HVM guest creation crashing with 1 MB of guest memory
  2007-05-04 13:47 [PATCH][HVM] HVM guest creation crashing with 1 MB of guest memory Andre Przywara
@ 2007-05-04 13:57 ` Keir Fraser
  0 siblings, 0 replies; 2+ messages in thread
From: Keir Fraser @ 2007-05-04 13:57 UTC (permalink / raw)
  To: Andre Przywara, xen-devel




On 4/5/07 14:47, "Andre Przywara" <andre.przywara@amd.com> wrote:

> When an HVM guest is started and assigned exactly one Megabyte of RAM,
> XEN will crash due to a overflow in building the E820 map in line 90 of
> tools/libxc/xc_hvm_build.c:
> e820entry[nr_map].size = mem_size - 0x100000 - PAGE_SIZE * 3;
> If memsize is one MB, the result will be negative (and the member is
> unsigned). As I don't think this is worth fixing here, I simply
> increased the minimal required memory for guest from zero to one
> Megabyte. Could someone check the effect on paravirtualized guests?

Better to check and reject the memory size in xc_hvm_build() itself. I'll
make a patch to do this.

 -- Keir

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-05-04 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-04 13:47 [PATCH][HVM] HVM guest creation crashing with 1 MB of guest memory Andre Przywara
2007-05-04 13:57 ` Keir Fraser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.