All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nai Xia <nai.xia@gmail.com>
To: Andres Lagar-Cavilla <andreslc@gridcentric.ca>
Cc: Tim Deegan <tim@xen.org>, xen-devel@lists.xen.org
Subject: Re: mem_sharing_nominate_page: p2mt should never change before p2m_change_type()
Date: Wed, 07 Aug 2013 00:25:48 +0800	[thread overview]
Message-ID: <5201238C.4080903@gmail.com> (raw)
In-Reply-To: <478510A8-3B0C-41DA-B863-3F9CD210A479@gridcentric.ca>

[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

Thanks. Please append the following line to the change log:
Signed-off-by: Nai Xia <nai.xia@gmail.com>

BR,
Nai Xia

On 2013年08月06日 23:38, Andres Lagar-Cavilla wrote:
>> The p2mt change check for p2m_change_type() was first introduced when this code path was not protected by p2m_lock().
>> Now this code path is protected by p2m_lock. So p2mt should never change before p2m_change_type().
> 
> Makes sense. You need to put a proper Signed-off-by line. In any case:
> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
> 
> Andres
>>
>> ---
>> diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
>> index 0364bb0..b3940cb 100644
>> --- a/xen/arch/x86/mm/mem_sharing.c
>> +++ b/xen/arch/x86/mm/mem_sharing.c
>> @@ -900,20 +900,8 @@ int mem_sharing_nominate_page(struct domain *d,
>>         goto out;
>>     }
>>
>> -    /* Change the p2m type */
>> -    if ( p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt )
>> -    {
>> -        /* This is unlikely, as the type must have changed since we've checked
>> -         * it a few lines above.
>> -         * The mfn needs to revert back to rw type. This should never fail,
>> -         * since no-one knew that the mfn was temporarily sharable */
>> -        mem_sharing_gfn_destroy(page, d, gfn_info);
>> -        xfree(page->sharing);
>> -        page->sharing = NULL;
>> -        /* NOTE: We haven't yet added this to the audit list. */
>> -        BUG_ON(page_make_private(d, page) != 0);
>> -        goto out;
>> -    }
>> +    /* Change the p2m type, should never fail with p2m locked. */
>> +    BUG_ON(p2m_change_type(d, gfn, p2mt, p2m_ram_shared) != p2mt);
>>
>>     /* Account for this page. */
>>     atomic_inc(&nr_shared_mfns);
>>
>>
>>
> 

[-- Attachment #2: 0xE6BAA6F9.asc --]
[-- Type: application/pgp-keys, Size: 1674 bytes --]

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2013-08-06 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.5805.1375627201.32487.xen-devel@lists.xen.org>
2013-08-06 15:38 ` mem_sharing_nominate_page: p2mt should never change before p2m_change_type() Andres Lagar-Cavilla
2013-08-06 16:25   ` Nai Xia [this message]
2013-08-08  9:49     ` Tim Deegan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5201238C.4080903@gmail.com \
    --to=nai.xia@gmail.com \
    --cc=andreslc@gridcentric.ca \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.