From: Vitaly Kuznetsov Subject: Re: [PATCH v8 08/11] xen: arch-specific hooks for domain_soft_reset() Date: Tue, 14 Jul 2015 18:07:48 +0200 Message-ID: <87h9p6yb6z.fsf@vitty.brq.redhat.com> References: <1435075913-335-1-git-send-email-vkuznets@redhat.com> <1435075913-335-9-git-send-email-vkuznets@redhat.com> <20150710165442.GD24518@l.oracle.com> <87pp3uybw3.fsf@vitty.brq.redhat.com> <20150714155703.GA11081@l.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZF2kR-0007tX-4C for xen-devel@lists.xenproject.org; Tue, 14 Jul 2015 16:07:59 +0000 In-Reply-To: <20150714155703.GA11081@l.oracle.com> (Konrad Rzeszutek Wilk's message of "Tue, 14 Jul 2015 11:57:03 -0400") 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: Wei Liu , Andrew Jones , Keir Fraser , Ian Campbell , Stefano Stabellini , Andrew Cooper , Julien Grall , Ian Jackson , Olaf Hering , Tim Deegan , David Vrabel , Jan Beulich , xen-devel@lists.xenproject.org, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org Konrad Rzeszutek Wilk writes: > On Tue, Jul 14, 2015 at 05:52:44PM +0200, Vitaly Kuznetsov wrote: >> Konrad Rzeszutek Wilk writes: >> >> > On Tue, Jun 23, 2015 at 06:11:50PM +0200, Vitaly Kuznetsov wrote: >> >> ... >> >> >> >> +int arch_domain_soft_reset(struct domain *d) >> >> +{ >> >> + struct page_info *page = virt_to_page(d->shared_info), *new_page; >> >> + int ret = 0; >> >> + struct domain *owner; >> >> + unsigned long mfn, mfn_new, gfn; >> >> + p2m_type_t p2mt; >> >> + unsigned int i; >> >> + >> >> ... >> >> + /* Soft reset is supported for HVM domains only */ >> >> + if ( owner != d ) >> >> + goto exit_put_page; >> >> + >> >> + mfn = page_to_mfn(page); >> >> + if ( !mfn_valid(mfn) ) >> >> + { >> >> + printk(XENLOG_G_ERR "Dom%d's shared_info page points to invalid MFN\n", >> >> + d->domain_id); >> > >> > Would it be good to print out the PFN of the shared page to help narrow the cause? >> > >> >> I think this case is impossibe under normal circumstances and it's not >> clear to me how to get the PFN (did you mean GFN?) in such case. > > Yes. >> >> shared_info is always allocated in arch_domain_create() from Xen heap >> and page_to_mfn() will never return INVALID_MFN here. In case we'll ever >> see this printed we'll have examine why this is not true anymore. This >> piece of code will have to be updated. > > Ok, One way it could be if the guest decided to expunge this GFN fro > the guest (I think). Thought I am not sure why it would do such a thing :-) > I'm not sure as we do page_to_mfn(virt_to_page(d->shared_info)) here and d->shared_info is a hypervisor-s va, guest domain can't do anything to it. -- Vitaly