From owner-svn-src-all@FreeBSD.ORG Tue Sep 30 17:38:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B0DAF81; Tue, 30 Sep 2014 17:38:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27CDBE89; Tue, 30 Sep 2014 17:38:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8UHcM6Y017353; Tue, 30 Sep 2014 17:38:22 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8UHcMmB017352; Tue, 30 Sep 2014 17:38:22 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201409301738.s8UHcMmB017352@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: Roger Pau Monné Date: Tue, 30 Sep 2014 17:38:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r272320 - head/sys/dev/xen/balloon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Sep 2014 17:38:22 -0000 Author: royger Date: Tue Sep 30 17:38:21 2014 New Revision: 272320 URL: http://svnweb.freebsd.org/changeset/base/272320 Log: xen/balloon: fix accounting of current memory pages on PVH Using realmem on PVH is not realiable, since in this case the realmem value is computed from Maxmem, which contains the higher memory address found. Use HYPERVISOR_start_info->nr_pages instead, which is set by the hypervisor and contains the exact number of memory pages assigned to the domain. Sponsored by: Citrix Systems R&D Modified: head/sys/dev/xen/balloon/balloon.c Modified: head/sys/dev/xen/balloon/balloon.c ============================================================================== --- head/sys/dev/xen/balloon/balloon.c Tue Sep 30 17:37:26 2014 (r272319) +++ head/sys/dev/xen/balloon/balloon.c Tue Sep 30 17:38:21 2014 (r272320) @@ -405,7 +405,8 @@ xenballoon_attach(device_t dev) #ifndef XENHVM bs.current_pages = min(xen_start_info->nr_pages, max_pfn); #else - bs.current_pages = realmem; + bs.current_pages = xen_pv_domain() ? + HYPERVISOR_start_info->nr_pages : realmem; #endif bs.target_pages = bs.current_pages; bs.balloon_low = 0;