[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 02/22] x86/setup: move vm_init() before acpi calls
- To: Julien Grall <julien@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 20 Dec 2022 16:08:46 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=f0zqbx8KuSk5ZlN32x2thqPAFk5deW1dN7LHdDCeExY=; b=EFWowL2dmr43JgBhV0obLESMVv/jlzrOi85lb1O9B2GhpTYHjvIT6/pUGB4Wqny1pWL62f54SYC/ruXg1WqgWReOlCSbO8jt6IMPLxtMdHNyMVJq6Qtc2r/00pIq+cxltj+fpyb4eadD8aSArM1UFHtdLelV5ZhCBMTz0WwvAtp0D9A4GFwv0K5zjUhkQ+ub5e9GFv8vlp2fSQ1Iw5Riryep+sXP8PXsSL0c5bZ1qSo8zG/pDBtJoo1jwPyzI28Sx3p27zFE+YaOee+RQJA328k+yIndw4tjM4+28duTrdO25WNkcBRv1z/lk6Q6lfd1z5boaAuTAxD+zLnfYESKYg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UlK2NwNiiWNumktXhQdutJPhbpUbhUABIkOJp8z3x39oeJEvcxnQ78u6/tP36OUVxHYxG/azO9g3+XEp+whG0PHYrXTnFQLSu1dMF61ArBGyxTOSgGbSKMJ5Jjr6ZY/4pz9ZdTKikhQUuAQQ5QckZSvhlQj0a9izTTdCUQdN+HMDaMLNuyQO4edtH8c/jFhxf0BMne0nshfJaXVm25CNK9lGEFzWKjOwsJCTnfYiO6azhjbUMLT0bE2iflSVEho4uOaPantyFQ1dYUvAi8/n+CwUBjgkt7cgLRB8t3yhu98CC9RF8SnvV3cmDB+4OQAqk7mdIUBdTpCadNobVp8GEg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Wei Liu <wei.liu2@xxxxxxxxxx>, 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>, David Woodhouse <dwmw2@xxxxxxxxxx>, Hongyan Xia <hongyxia@xxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 20 Dec 2022 15:09:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 16.12.2022 12:48, Julien Grall wrote:
> From: Wei Liu <wei.liu2@xxxxxxxxxx>
>
> After the direct map removal, pages from the boot allocator are not
> mapped at all in the direct map. Although we have map_domain_page, they
Nit: "will not be mapped" or "are not going to be mapped", or else this
sounds like there's a bug somewhere.
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -870,6 +870,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> unsigned long eb_start, eb_end;
> bool acpi_boot_table_init_done = false, relocated = false;
> int ret;
> + bool vm_init_done = false;
Can this please be grouped with the other bool-s (even visible in context)?
> --- a/xen/common/vmap.c
> +++ b/xen/common/vmap.c
> @@ -34,9 +34,20 @@ void __init vm_init_type(enum vmap_region type, void
> *start, void *end)
>
> for ( i = 0, va = (unsigned long)vm_bitmap(type); i < nr; ++i, va +=
> PAGE_SIZE )
> {
> - struct page_info *pg = alloc_domheap_page(NULL, 0);
> + mfn_t mfn;
> + int rc;
>
> - map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR);
> + if ( system_state == SYS_STATE_early_boot )
> + mfn = alloc_boot_pages(1, 1);
> + else
> + {
> + struct page_info *pg = alloc_domheap_page(NULL, 0);
> +
> + BUG_ON(!pg);
> + mfn = page_to_mfn(pg);
> + }
> + rc = map_pages_to_xen(va, mfn, 1, PAGE_HYPERVISOR);
> + BUG_ON(rc);
The adding of a return value check is unrelated and not overly useful:
> clear_page((void *)va);
This will fault anyway if the mapping attempt failed.
Jan
|