[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v8 08/11] xen: arch-specific hooks for domain_soft_reset()



Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> writes:

> On Tue, Jul 14, 2015 at 05:52:44PM +0200, Vitaly Kuznetsov wrote:
>> Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> 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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.