From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 17/18 V2]: PVH xen: PVH dom0 creation... Date: Tue, 26 Mar 2013 16:25:03 -0700 Message-ID: <20130326162503.0378155f@mantra.us.oracle.com> References: <20130315180645.59f8618e@mantra.us.oracle.com> <20130318200602.GH27433@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20130318200602.GH27433@phenom.dumpdata.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: Konrad Rzeszutek Wilk Cc: "Xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 18 Mar 2013 16:06:02 -0400 Konrad Rzeszutek Wilk wrote: > On Fri, Mar 15, 2013 at 06:06:45PM -0700, Mukesh Rathor wrote: > > +static __init void copy_pvh(char *dest, char *src, int bytes) > > +{ > > + /* raw_copy_to_guest() -> copy_to_user_hvm -> __hvm_copy needs > > curr > > + * to point to the hvm/pvh vcpu. Hence for PVH dom0 we can't > > use that. > > + * So we just use dbg_rw_mem(). > > + */ > > + int rem = dbg_rw_mem((dbgva_t)dest, (unsigned char *)src, > > bytes, 0, 1, 0); > > + if (rem) { > > + printk("PVH: Failed to copy to dom0. len:%d rem:%d\n", > > bytes, rem); > > + BUG(); > > Wait a minute? This is debug code but you use for copying?! Why not > __copy_to_user? No, it's not debug code, I wrote the function to work for all guests under all conditions, but it was only for debugger, so called it dbg_*. Looking at alternatives.