From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Andre Przywara" Subject: [PATCH][HVM] HVM guest creation crashing with 1 MB of guest memory Date: Fri, 04 May 2007 15:47:26 +0200 Message-ID: <463B396E.5030606@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=------------040402010900090706090700 Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------040402010900090706090700 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Hi, When an HVM guest is started and assigned exactly one Megabyte of RAM,=20 XEN will crash due to a overflow in building the E820 map in line 90 of=20 tools/libxc/xc_hvm_build.c: e820entry[nr_map].size =3D mem_size - 0x100000 - PAGE_SIZE * 3; If memsize is one MB, the result will be negative (and the member is=20 unsigned). As I don't think this is worth fixing here, I simply=20 increased the minimal required memory for guest from zero to one=20 Megabyte. Could someone check the effect on paravirtualized guests? Regards, Andre. Signed-off-by: Andre Przywara -- 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=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden,=20 Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington,=20 Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy --------------040402010900090706090700 Content-Type: text/plain; name=xen_hvm_one_megabyte_required_patch.txt Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename=xen_hvm_one_megabyte_required_patch.txt 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") --------------040402010900090706090700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------040402010900090706090700--