On 09/19/2018 01:15 PM, George Dunlap wrote:
> On 09/03/2018 09:25 AM, Razvan Cojocaru wrote:
>> When an new altp2m view is created very early on guest boot, the
>> display will freeze (although the guest will run normally). This
>> may also happen on resizing the display. The reason is the way
>> Xen currently (mis)handles logdirty VGA: it intentionally
>> misconfigures VGA pages so that they will fault.
>>
>> The problem is that it only does this in the host p2m. Once we
>> switch to a new altp2m, the misconfigured entries will no longer
>> fault, so the display will not be updated.
> 
> Hey Razvan, thanks for doing this, and sorry it's taken so long to respond.
> 
>> This patch:
>>
>> * updates ept_handle_misconfig() to use the active altp2m instead
>>   of the hostp2m;
> 
> This is probably necessary.
> 
>> * has p2m_init_altp2m_ept() copy over max_mapped_pfn,
>>   logdirty_ranges, global_logdirty, ept.ad and default_access
>>   from the hostp2m (the latter more for completeness than for any
>>   other reason).
> 
> I think this is probably the right approach.  These values change
> rarely, but after a misconfig are read repeatedly.  So it's probably a
> lot more efficient to propagate changes when they happen, rather than
> trying to keep a single master copy.  However...
> 
>> We should discuss if just copying over
>>   logdirty_ranges (which is a pointer) is sufficient, or if
>>   this code requires more synchronization).
> 
> It's clearly not sufficient. :-)  The logdirty_ranges struct is
> protected by the lock of the p2m structure that contains it; if you
> point to it from a different p2m structure, then you'll have
> inconsistent logging, and you'll have problems if one vcpu is reading
> the structure while another is modifying it.

...and therefore, if we believe that it's more efficient to duplicate
structures than to share it and use a lock, we need to do a deep copy of
the data structure on altp2m creation, and propagate changes as we do
for the other "synced" data.

 -George

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to