lkml.org 
[lkml]   [2023]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [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@amd.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.

    \
     
     \ /
      Last update: 2023-03-27 01:01    [W:3.165 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site