From: "Mike Sun" Subject: is_mapped() in xc_domain_save() Date: Sat, 27 Sep 2008 23:31:53 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline 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 Hi all, I think I have a pretty good grasp on domain save/migration code in xc_domain_save() in Xen 3.2.x, except for the what the is_mapped() macro is doing in following: /* Hypercall interfaces operate in PFNs for HVM guests * and MFNs for PV guests */ if ( hvm ) pfn_type[batch] = n; else pfn_type[batch] = pfn_to_mfn(n); if ( !is_mapped(pfn_type[batch]) ) { /* ** not currently in psuedo-physical map -- set bit ** in to_fix since we must send this page in last_iter ** unless its sent sooner anyhow, or it never enters ** pseudo-physical map (e.g. for ballooned down doms) */ set_bit(n, to_fix); continue; } This chunk of code makes sense for saving PV domains. The is_mapped() function checks the MSB of the mfn returned by pfn_to_mfn() to make sure the pfn is actually a part of the pseudo-physical map. And if it's not, we mark that pfn as to_fix for later in case it later becomes part of the pseudo-physical map. But for HVM domains, it doesn't make any sense to me. The is_mapped() is being called on a pfn, not mfn, and it doesn't seem like it would ever return false. Is it just a piece of irrelevant code for HVM domains? Thanks, Mike