Re: [Xen-devel] [PATCH v2 2/2] x86/mm: fix a potential race condition in modify_xen_mappings().

2017-11-13 Thread Jan Beulich
>>> On 10.11.17 at 15:02, wrote: > On 11/10/2017 5:57 PM, Jan Beulich wrote: > On 10.11.17 at 08:18, wrote: >>> --- a/xen/arch/x86/mm.c >>> +++ b/xen/arch/x86/mm.c >>> @@ -5097,6 +5097,17 @@ int modify_xen_mappings(unsigned long s,

Re: [Xen-devel] [PATCH v2 2/2] x86/mm: fix a potential race condition in modify_xen_mappings().

2017-11-10 Thread Yu Zhang
On 11/10/2017 5:57 PM, Jan Beulich wrote: On 10.11.17 at 08:18, wrote: --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5097,6 +5097,17 @@ int modify_xen_mappings(unsigned long s, unsigned long e, unsigned int nf) */ if ( (nf &

Re: [Xen-devel] [PATCH v2 2/2] x86/mm: fix a potential race condition in modify_xen_mappings().

2017-11-10 Thread Jan Beulich
>>> On 10.11.17 at 08:18, wrote: > --- a/xen/arch/x86/mm.c > +++ b/xen/arch/x86/mm.c > @@ -5097,6 +5097,17 @@ int modify_xen_mappings(unsigned long s, unsigned long > e, unsigned int nf) > */ > if ( (nf & _PAGE_PRESENT) || ((v != e) &&

[Xen-devel] [PATCH v2 2/2] x86/mm: fix a potential race condition in modify_xen_mappings().

2017-11-09 Thread Yu Zhang
In modify_xen_mappings(), a L1/L2 page table may be freed, if all entries of this page table are empty. Corresponding L2/L3 PTE will need be cleared in such scenario. However, logic to enumerate the L1/L2 page table and to reset the corresponding L2/L3 PTE need to be protected with spinlock.