From: Wei Liu Subject: Balloon driver bug in increase_reservation Date: Mon, 2 Sep 2013 15:43:33 +0100 Message-ID: <20130902144333.GA14104@zion.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: wei.liu2@citrix.com, david.vrabel@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Hi, Stefano I found another bug in the balloon scratch page code. As I didn't follow the discussion on scratch page so I cannot propose a proper fix at the moment. The problem is that in balloon.c:increase_reservation, when a ballooned page is resued, it can have a valid P2M entry pointing to the scratch, hitting the BUG_ON BUG_ON(!xen_feature(XENFEAT_auto_translated_physmap) && phys_to_machine_mapping_valid(pfn)); As balloon worker might run by a CPU other then the one that returns the page, checking pfn_to_mfn(pfn) == local_cpu_scratch_page_mfn wouldn't work. Checking pfn_to_mfn(pfn) belongs to the set of all scratch page mfns is not desirable. My thoughts so far: 1. remove that BUG_ON (looks like a wrong fix though) 2. make balloon scratch page global Other thoughts? Wei.