[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v7 9/9] xen: retrieve reserved pages on populate_physmap
- To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Penny Zheng <Penny.Zheng@xxxxxxx>
- Date: Mon, 27 Jun 2022 10:11:20 +0000
- Accept-language: en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vhXiTrf3nYEpPapCSFgPB9m1LKse5UuoW5un3Cv9OwM=; b=UVMTA4/P6UCu8iO/JfwOBiDYJI+fPt7DJN84wKAjgAcL5o0BFifmFdKhxPDIVYyKpwl1pZuoNk0Nfk9HDdDGqkWyIjvOH5+UkvCewizj1tnY717AeEUAKU/ovNVPNcsxsQ1piuQxcIUctisHYlgScpiDu4GEWoZJ72fSAfdg5nJ2lev7ZetZtQHIy54z6MQSNHllb69ifUUp3eOdvxTMnj8ZbZ5gIDIcuULtU111U9KBYf/emhBC0/ZBjeldf7oSjDcWFUaD07S4IrmfN8n8PXt3O1L9dyY8ne7aPl+nloKfgyitPcWbyOW7XUNLiN6terXVugAloftm8hZ3mQkwgQ==
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vhXiTrf3nYEpPapCSFgPB9m1LKse5UuoW5un3Cv9OwM=; b=imQNvurhoWysBpKd2F/x79vz3/kp2k7gaZs3m+/LSiBP383LRrmU4Oi/FTP7ut1PmyY3I8Y26lAjmi8Z1EKzJNGehd30QDi9pPN3YftsuDLgG15/kyI4GwFjNZbX2wCaW4JUE310ShfeJ2Z5vJoG0NmmZVqL8DCIivF6JT3V6Th+Fj4SzyAKvMrYHM8SzeVlsXmf/NzmWBp0gKCDRwttKz6IexNMt2w80pK/Hw03zAKMUpCg14GbwkKKOVWdMJ5xmIqpkp2vGgxyZdvWdv1oXXugaEmoRrOFKmCRfkzzPU+LtvCtkmczYZmlIYCxuLOOMUrBlioXv9nMuoVw0E3tGQ==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=njGKSgIP0WfvPDLQNmVqZTwWt5YymAhtq6I/1PoZd+AejGjBDinr6pocUKmBxa3i6dXnl0qJKoSvnasQjVLv2BFy6kpKSa4U8FAPJhx+A48Qc1XTYeU5u1yVppxSQCIAStEsIDrMKpa+PCzbMIAFEHhGm0o9GpyLs6otzgdj/s9ixpVAecilS/qLCGOX3v7cEggaRk6w18b6XwYWPO/3Z7ieD/CNCoslEGU7ql0uNU6yg6YWm5RwlYrGntVlyva2idHhvi/9JCa7AHM6AEqgUt5zKm7suokVvJzAcpKQOykULZtSD6DG23DD0BcDuOevwTIg2exF90KsZoctQ6gW7w==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VqMllXL2D+ogWPEA4yd2387UifqCYavtWBCkvUBF5y+P8Y6LdwHRMOY236lcyGs3H5gFM5FaNp7ankSD0ZLAhMRcKnB2QfbD3kWQ5JisrF4l8bexxSwj8x79+8+xqGg+8UHrnpGUgb349Cr8LuWRiFDaszYb3Vga+skogVg0ihIFU7br2d7WlomLIt4r0vmMVdNq5vS0NCKtgOX8hvoggp13GEjP2r6xifX/whPqT6S/YRHdtZ39kjhVJuA3oXtkiwuKl4ic6ze3MHux/wuzgUD7isShXUPmk26Sce0Vm1GKGTZaKWGAm5gXJ57+VRKi0Ji74JC6epV3Uw3+Jgy0pA==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Wei Chen <Wei.Chen@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
- Delivery-date: Mon, 27 Jun 2022 10:11:42 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYhE/PLzgZAZhohEWBkyQ6CNSVbK1e/rYAgAQAb4A=
- Thread-topic: [PATCH v7 9/9] xen: retrieve reserved pages on populate_physmap
Hi Julien
> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Saturday, June 25, 2022 3:51 AM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
> Jan Beulich <jbeulich@xxxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>;
> Wei Liu <wl@xxxxxxx>
> Subject: Re: [PATCH v7 9/9] xen: retrieve reserved pages on
> populate_physmap
>
> Hi Penny,
>
> On 20/06/2022 03:44, Penny Zheng wrote:
> > When a static domain populates memory through populate_physmap at
> > runtime, it shall retrieve reserved pages from resv_page_list to make
> > sure that guest RAM is still restricted in statically configured memory
> regions.
> > This commit also introduces a new helper acquire_reserved_page to make
> it work.
> >
> > Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
> > ---
> > v7 changes:
> > - remove the lock, since we add the page to rsv_page_list after it has
> > been totally freed.
>
> Hmmm... Adding the page after it has been totally freed doesn't mean you
> can get away with the lock. AFAICT you can still have concurrent free/allocate
> that could modify the list.
>
> Therefore if you add/remove pages without the list, you would end up to
> corrupt the list.
>
> If you disagree, then please point out which lock (or mechanism) will prevent
> concurrent access.
>
Ok. Combined with the last serie comments, actually, you suggest that we need
to add
two locks, right?
One is the lock for concurrent free/allocation on page_info, and we will use
heap_lock, one stays in free_staticmem_pages, one stays in its reversed function
prepare_staticmem_pages.
The other is for concurrent free/allocation on resv_page_list, and we will use
d->page_alloc_lock tp guard it. One stays in put_static_page, and another
stays in reversed function acquire_reserved_page.
> Cheers,
>
> --
> Julien Grall
|