From: Ian Campbell Subject: Re: [PATCH RFC v2 8/9] xen/arm: Implement hypercall for dirty page tracing (shadow op) Date: Thu, 4 Jul 2013 09:42:57 +0100 Message-ID: <1372927377.7184.7.camel@kazak.uk.xensource.com> References: <1372842943-27482-1-git-send-email-jaeyong.yoo@samsung.com> <1372842943-27482-9-git-send-email-jaeyong.yoo@samsung.com> <003a01ce7855$6a6dd820$3f498860$%yoo@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <003a01ce7855$6a6dd820$3f498860$%yoo@samsung.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jaeyong Yoo Cc: 'Elena Pyatunina' , xen-devel@lists.xen.org, 'Stefano Stabellini' List-Id: xen-devel@lists.xenproject.org On Thu, 2013-07-04 at 10:25 +0900, Jaeyong Yoo wrote: > > > @@ -496,6 +496,221 @@ void mark_dirty(struct domain *d, paddr_t addr) > > > spin_unlock(&d->arch.dirty.lock); } > > > > > > +static void free_dirty_bitmap(struct domain *d) { > > > + struct page_info *pg; > > > + > > > + spin_lock(&d->arch.dirty.lock); > > > + > > > + if(d->arch.dirty.top) > > > + { > > > + while ( (pg = page_list_remove_head(&d->arch.dirty.pages)) ) > > > + free_domheap_page(pg); > > > + } > > > + d->arch.dirty.top = NULL; > > > + d->arch.dirty.count = 0; > > > + > > > + spin_unlock(&d->arch.dirty.lock); } > > > + > > > +/* Change types across all p2m entries in a domain */ static void > > > +p2m_change_entry_type_global(struct domain *d, enum mg ot, enum mg > > > +nt) { > > > + struct p2m_domain *p2m = &d->arch.p2m; > > > + int i1, i2, i3; > > > + int first_index = first_table_offset(GUEST_RAM_BASE); > > > + int second_index = second_table_offset(GUEST_RAM_BASE); > > > + int third_index = third_table_offset(GUEST_RAM_BASE); > > > > you shouldn't assume GUEST_RAM_BASE is static anywhere > > Yes, you are right. Since there is no way to figure out this value at > the moment, we use this static value here. I think we need to parse dtb > of domu guest and get this value from there. Do you have any suggestion? The hypervisor should never be parsing (or even seeing) the domU DTB. Instead the toolstack should poke this sort of information down via a (presumably new) DOMCTL. Ian.