[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 2/5] xen/grants: update initialization order of xen grant table
- To: Huang Rui <ray.huang@xxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Wed, 15 Mar 2023 13:31:14 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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=mUFi3aCD1p4P3JI7yrknjj3N6t2foQ+yzm3wY06sJ3A=; b=YP7ALnOD8XDuYz+mpFoG9AHyBvniVg2h2WZ+gQW5f3yUS0xtfOYBYSOPW+eX45zLVtHQwKoyGHgTTwKp4JhM/XumM6lzXvvVzbX3Zj9fz/RW6OwT9fRWuzLr2x1e+sUKd+Kymkw+3kr+2Nlwlm6T2HMTP2nkh2kb8YumNaBoTiaywRAsnFThFoBzaw9VrK+7/xvr0Zo4W680OfxZ2VXXzCIRuFlKETYsbLsPkQKlOfcHO90GhfswMeG1ns/c3snvkx1oVJpXcLjgexFL8k+m6nC6GLY8gDl4pCzaFCNsVKFdxItQiwHj2Vu4CZ3pBj9o56OG6fYn9FPHZLoxeNDL4A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KEaJSVVyfoM66MIFGWvvrmrX5Ds2Ej3qBabO18I7tNpWU8Pp4fGGkFXknxmwfZnEq8adMH+avKH3AYqhuWfYyleVM1b9T1wngOZEhMDKe+WDL9+XucBHK8EBIaCeJujEKKTgvnW/0IQ+2M9CuARVDHEyUD3TX9I/vfqJYiM3rMHPZ4hvn58jfpaQC9auKAP7fPT39whmIhJ5bicUiDhzUBGnEDO577RTnlEN8Al4cuno5pBuUPOO7v7BA8n/VxgAxEXNl4xqsFhSdWyMjDm3/GuDXPbDvJ+DeiT7keZKJYNsiPjuj7OnMnYGFBj+4smzmAvagTcYV30GyxZPG8l09Q==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, 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>
- Delivery-date: Wed, 15 Mar 2023 12:31:55 +0000
- Ironport-data: A9a23:bHsJL6hUHwnHAJ1YtkuBzBsgX1615hAKZh0ujC45NGQN5FlHY01je htvWjiDb/uIYGKned1+a4jioUMDuJTXxtRgTwJk+3owQSgb9cadCdqndUqhZCn6wu8v7q5Ex 55HNoSfdpBcolv0/ErF3m3J9CEkvU2wbuOgTrWCYmYpHlUMpB4J0XpLg/Q+jpNjne+3CgaMv cKai8DEMRqu1iUc3lg8sspvkzsy+qWi0N8klgZmP6sT5waDzyB94K83fsldEVOpGuG4IcbiL wrz5OnR1n/U+R4rFuSknt7TGqHdauePVeQmoiM+t5mK2nCulARrukoIHKN0hXNsoyeIh7hMJ OBl7vRcf+uL0prkw4zxWzEAe8130DYvFLXveRBTuuTLp6HKnueFL1yDwyjaMKVB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WPH9Xg3cL1XYJNu6ZeHcGNDWvHfACZe OhDlIsnUvcRZwQBP7LfkUtbqz4iPDgsonpWhICDw5P0njzsdv5gISKaCRxx30lIkly/Ys=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Sun, Mar 12, 2023 at 08:01:54PM +0800, Huang Rui wrote:
> 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.
Has this been tested on a domU to make sure the late grant table init
doesn't interfere with PV devices getting setup?
> 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();
> #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. */
Comment need to be updated, but I was thinking whether it won't be
best to simply call xen_pvh_gnttab_setup() from __gnttab_init() itself
when running as a PVH guest?
Thanks, Roger.
|