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

Re: [Xen-devel] [PATCH 2 of 2] x86/mm: New mem access type to log access


  • To: "Tim Deegan" <tim@xxxxxxx>
  • From: "Andres Lagar-Cavilla" <andres@xxxxxxxxxxxxxxxx>
  • Date: Thu, 1 Dec 2011 08:33:45 -0800
  • Cc: andres@xxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, keir.xen@xxxxxxxxx, jbeulich@xxxxxxxx, adin@xxxxxxxxxxxxxx
  • Delivery-date: Thu, 01 Dec 2011 16:34:38 +0000
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=lagarcavilla.org; h=message-id :in-reply-to:references:date:subject:from:to:cc:reply-to :mime-version:content-type:content-transfer-encoding; q=dns; s= lagarcavilla.org; b=tgfLH8t/Ye7pQdDU4+460UdGE5KNhYYHQAb6QUSQ58vv IM8SfbGSSKWLCO/G2RzGSK2JJJy3OA3+JkZbNp+o3j32M2v9QVBULTDji/paa9lB Av9XhyiAn7CnKsCu8C1LjM40btW8hcaR3t+V+91iW7QDmg5XxBvjmTs6wsGboIE=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

> At 16:58 -0500 on 29 Nov (1322585905), Andres Lagar-Cavilla wrote:
>> @@ -1162,10 +1167,13 @@ int p2m_mem_access_check(unsigned long g
>>          }
>>          else
>>          {
>> -            /* A listener is not required, so clear the access
>> restrictions */
>> -            p2m_lock(p2m);
>> -            p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt,
>> p2m_access_rwx);
>> -            p2m_unlock(p2m);
>> +            if ( p2ma != p2m_access_n2rwx )
>> +            {
>> +                /* A listener is not required, so clear the access
>> restrictions */
>> +                p2m_lock(p2m);
>> +                p2m->set_entry(p2m, gfn, mfn, PAGE_ORDER_4K, p2mt,
>> p2m_access_rwx);
>> +                p2m_unlock(p2m);
>> +            }
>>              return 1;
>>          }
>
> This logic is getting a bit convoluted, and I'm not sure it's correct.
> If a page is marked n2rwx and there's no listener, it looks like this
> will cause it to spin forever re-taking the fault rather than pausing it
> waiting for the listener to attach.

The entry is set to p2m_access_rwx, so no additional faults will be
generated. In the n2rwx case, the entry was promoted to rwx previously, in
 a p2m_lock protected section. We're avoiding a repeat here.

Andres

>
> Cheers,
>
> Tim.
>



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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