[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZBG6kthkEMo4qmo6@Air-de-Roger>
Date: Wed, 15 Mar 2023 13:31:14 +0100
From: Roger Pau Monné <roger.pau@...rix.com>
To: Huang Rui <ray.huang@....com>
Cc: Juergen Gross <jgross@...e.com>,
Stefano Stabellini <sstabellini@...nel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@...m.com>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Stewart Hildebrand <Stewart.Hildebrand@....com>,
Xenia Ragiadakou <burzalodowa@...il.com>,
Honglei Huang <honglei1.huang@....com>,
Julia Zhang <julia.zhang@....com>,
Chen Jiqian <Jiqian.Chen@....com>
Subject: Re: [RFC PATCH 2/5] xen/grants: update initialization order of xen
grant table
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@....com>
> ---
> 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.
Powered by blists - more mailing lists