WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] mem_sharing: fix race condition of nominate and unsh

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH] mem_sharing: fix race condition of nominate and unshare
From: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Date: Fri, 7 Jan 2011 00:11:59 +0800
Cc: tinnycloud <tinnycloud@xxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 06 Jan 2011 08:12:45 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:cc:content-type; bh=qdkWHUzjMc3IBrqDHLYLoPhyyniHxVNOTx561JC42Fg=; b=w4n236taBjo6pY4ouBVEl4Zzz1cToRb504JKet/jRI1szq0soqyUasWKgD3rizGAmJ olSsb0WilcpxmlSI2sFMdOvR7pb7q/sin+2RKHjz4UMx+IkmIWKjDmMJZr5e2s0kdwrk t7jnUH1Ft+g/J1RhpsVczGPEDTr00ut4SLNFQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; b=XX+NEgQexiEadTVvQvDIRTec8ijbdZTninEQeUQOayFsNF00HjaViyD6/v0TjnvHe5 HsqxPJ/KBzXvCvhKBxcpbs6QygJT8GIKH1M58DaFq3QIc6JhciAVxQb9uO8xljEs4+iU jDs5DDthAT0OKB/j8mEvOiqud26iC+aesRyBc=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Hi, this patch does the following
(1) When updating/checking p2m type for mem_sharing, we must hold shr_lock
(2) For nominate operation, if the page is already nominated, return the handle from page_info->shr_handle
(3) For unshare operation, it is possible that multiple users unshare a page via hvm_hap_nested_page_fault() at the same time. If the page is already un-shared by someone else, simply return success.

NOTE: we assume that nobody holds page_alloc_lock/p2m_lock before calling nominate/share/unshare.

Signed-off-by: Jui-Hao Chiang <juihaochiang@xxxxxxxxx>
Signed-off-by: Han-Lin Li <Han-Lin.Li@xxxxxxxxxxx>

Bests,
Jui-Hao

Attachment: mem_sharing_p2mt_race.patch
Description: Text Data

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