From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] x86: add locking to map_pages_to_xen() Date: Mon, 15 Jul 2013 13:12:16 +0100 Message-ID: References: <51E3E64002000078000E4E08@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Uyhdg-0002vo-MT for xen-devel@lists.xenproject.org; Mon, 15 Jul 2013 12:12:24 +0000 Received: by mail-we0-f180.google.com with SMTP id w56so9819941wes.25 for ; Mon, 15 Jul 2013 05:12:22 -0700 (PDT) In-Reply-To: <51E3E64002000078000E4E08@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel List-Id: xen-devel@lists.xenproject.org On 15/07/2013 11:08, "Jan Beulich" wrote: > While boot time calls don't need this, run time uses of the function > which may result in L2 page tables getting populated need to be > serialized to avoid two CPUs populating the same L2 (or L3) entry, > overwriting each other's results. > > This is expected to fix what would seem to be a regression from commit > b0581b92 ("x86: make map_domain_page_global() a simple wrapper around > vmap()"), albeit that change only made more readily visible the already > existing issue. > > This patch intentionally does not > - add locking to the page table de-allocation logic in > destroy_xen_mappings() (the only user having potential races here, > msix_put_fixmap(), gets converted to use __set_fixmap() instead) > - avoid races between super page splitting and reconstruction in > map_pages_to_xen() (no such uses exist; races between multiple > splitting attempts or between multiple reconstruction attempts are > being taken care of) > If we wanted to take care of these, we'd need to alter the behavior > of virt_to_xen_l?e() - they would need to return with the lock held > then. > > Signed-off-by: Jan Beulich Acked-by: Keir Fraser