[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[RFC PATCH 2/5] xen/grants: update initialization order of xen grant table


  • To: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>
  • From: Huang Rui <ray.huang@xxxxxxx>
  • Date: Sun, 12 Mar 2023 20:01:54 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=suse.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.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=vERtBQZO4btnLGfti3VSOefpivXiYTBUA9KHiM91onM=; b=mRUHowUkoibA+y3yuIucX9n/NuJ61VNiLm0wYNyJR2ZstnGN+xH/115+zj7Gh2v6/kZIWpMIM5osniFHhpBYjrLs+/JHaUR2oRtrE8K/wo6o8lLBqYthnTSXB2q6fxxocrVAPPy+F9ezhPml37Ct/KC5Ht2xupOUy77TjwR0jvosLlty9FYbm3ByTPNJ3sYNOS9RYG7O45WB0GSrG1aEOFlBoExDrYkES4qOgQ3YyIJrIWjgVMIMBwruQCqTVqMQb6RCO8jdQ+ix86Lcqb6lIjOgVrz0li+U/KmzINg4110ROG9cfMT36A8Npp7CkZRteWCKRIwOGuTciE8atv8SCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mLcG1DCf0wfu/lrin0oRaqN6QBNtywb+IplYk9O4zik25QQgD30bnT5J4gjZWzvYBeLG49mPrz1LTj0f0RQa84KkzSfkB+tSel4fFySSbClAr0nebZ6zoPY//DsoOU5Nv7LnrE+tcAH6wqq5rn+rHBZsjLfXpS8uR7EZ0/NnvccV2sqsFwOt0cY1IwXZUaB3qwLUvLGHbuWEU0DJNEDCcyxLt1o9uaECxJZuFXizlCHc9UtKQBwxPNVDcM+NtEOza92oxHxW1YGrqMA6bGjciChqBrZ/iFp4+osnHEpZ3f1mrawA9TwZzg31/LcvgGObBePO2mTTtwtqoVCtRPCOKQ==
  • Cc: Alex Deucher <alexander.deucher@xxxxxxx>, Christian König <christian.koenig@xxxxxxx>, "Stewart Hildebrand" <Stewart.Hildebrand@xxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, Honglei Huang <honglei1.huang@xxxxxxx>, Julia Zhang <julia.zhang@xxxxxxx>, Chen Jiqian <Jiqian.Chen@xxxxxxx>, Huang Rui <ray.huang@xxxxxxx>
  • Delivery-date: Sun, 12 Mar 2023 12:02:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The xen grant table will be initialied before parsing the PCI resources,
so xen_alloc_unpopulated_pages() ends up using a range from the PCI
window because Linux hasn't parsed the PCI information yet.

So modify the initialization order to make sure the real PCI resources
are parsed before.

Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
---
 arch/x86/xen/grant-table.c | 2 +-
 drivers/xen/grant-table.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/xen/grant-table.c b/arch/x86/xen/grant-table.c
index 1e681bf62561..64a04d1e70f5 100644
--- a/arch/x86/xen/grant-table.c
+++ b/arch/x86/xen/grant-table.c
@@ -165,5 +165,5 @@ static int __init xen_pvh_gnttab_setup(void)
 }
 /* Call it _before_ __gnttab_init as we need to initialize the
  * xen_auto_xlat_grant_frames first. */
-core_initcall(xen_pvh_gnttab_setup);
+fs_initcall_sync(xen_pvh_gnttab_setup);
 #endif
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index e1ec725c2819..6382112f3473 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1680,4 +1680,4 @@ static int __gnttab_init(void)
 }
 /* Starts after core_initcall so that xen_pvh_gnttab_setup can be called
  * beforehand to initialize xen_auto_xlat_grant_frames. */
-core_initcall_sync(__gnttab_init);
+rootfs_initcall(__gnttab_init);
-- 
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.