[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 15/52] xen: make VMAP only support in MMU system
- To: Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
- From: Penny Zheng <penny.zheng@xxxxxxx>
- Date: Wed, 28 Jun 2023 16:41:00 +0800
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=xen.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
- 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=kec2iNBqSnaFv2sP0scr0R1i3SyFtLZVqLlXqhqnukg=; b=LkcSO9T9B/aYJRBamjNypXKP9qy9+n+AntncHnjhvSwhYF3GOkD/MDQlYlJbebVr2ZS3IDSiyzfxmXyCL/wUc46pn643ashyLr1q6cedR9ZMT4fjYqEmzTSNlk/PVQlotJUIbSEU4BGuEen3ezPUdKXlC5SAVW1ATkEHRULGNZ6GgFLLXOmYIAXgpVVVzlCjlxy0D+mnTwK/GZn31/SgykGaK04RjO8sH3rN3F6Ct8NlVns5Oow9mo1G2CtZNY68bytuHZ3LbEq1/aqkSP1PElKe6eb+PAfAH9oPL1VaHyw8MW9AwIXddQRp08MoB89/zzVexu0YjZlszU21peFHzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aImCt8MNa2qoS7ss/oVkMlSgMUemBGHOOhGNrK//DGNvgSz3LJCrljaT7ApS1Dbxb2xc/B4DBiPyMJ9iqB2k7gGLCndSRPjJpgO9SYFr8TAnwpUd39RiZEW+bFFnguMOseZwWMY/OVQEKBh77NSqXQIizrxFLkJuIYKzgmjwjcE87XTkrZT5FItqyMkxJXfTP/3n4bU1+42qQQpl4rgdlnAJVUSWByznhwq1AHx873UvhGRyF6mTl/9L424vWr9Bsb2q73QZ1q13gzV2EvyoAeuu2/0rYYb/AcG0Grarl5bQMNqRXkbCHkfDZVWvbnGH5OgG9YZ2I63VfDgiuQ7gxg==
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Chen <wei.chen@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 28 Jun 2023 08:41:36 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
Hi Julien
On 2023/6/28 15:59, Julien Grall wrote:
Hi,
On 28/06/2023 06:38, Penny Zheng wrote:
On 2023/6/26 14:00, Jan Beulich wrote:
On 26.06.2023 05:34, Penny Zheng wrote:
--- a/xen/common/vmap.c
+++ b/xen/common/vmap.c
@@ -331,4 +331,11 @@ void vfree(void *va)
while ( (pg = page_list_remove_head(&pg_list)) != NULL )
free_domheap_page(pg);
}
+
+void iounmap(void __iomem *va)
+{
+ unsigned long addr = (unsigned long)(void __force *)va;
+
+ vunmap((void *)(addr & PAGE_MASK));
+}
Why does this move here?
ioremap/iounmap is using vmap, at least in ARM. So for this more
generic interface, I was intending to implement it on MPU system.
In commit "[PATCH v3 19/52] xen/arm: switch to use ioremap_xxx in
common file", I'm trying to replace all direct vmap interface with
ioremap_xxx in common files.
While the implementation of ioremap() is based on vmap(), the intended
usage is not the same. ioremap() is for MMIO regions while vmap() is for
RAM.
So I don't think this is correct to replace vmap() with ioremap().
Sure, understood now.
So then the current usage of ioremap_xxx in xen/arch/arm/kernel.c, like
```
kernel_zimage_load()
...
kernel = ioremap_wc(paddr, len);
...
```
ioremap_wc() is used for remapping and then copying guest kernel image
to guest memory. Since ioremap_xxx is for MMIO regions, maybe we shall
provide a new pair of interfaces for RAM, like ramremap_xxx, to replace
the ioremap_xxx here?
Cheers,
|