From nobody Mon Feb 9 18:45:16 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1580517240990840.5125987866489; Fri, 31 Jan 2020 16:34:00 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ixgj1-0006Ht-Mk; Sat, 01 Feb 2020 00:33:27 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ixgj0-0006Gw-35 for xen-devel@lists.xenproject.org; Sat, 01 Feb 2020 00:33:26 +0000 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 6aebf134-448a-11ea-ad98-bc764e2007e4; Sat, 01 Feb 2020 00:33:08 +0000 (UTC) Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ixgie-0007ny-26; Sat, 01 Feb 2020 00:33:04 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1ixgid-009ul6-8J; Sat, 01 Feb 2020 00:33:03 +0000 X-Inumbo-ID: 6aebf134-448a-11ea-ad98-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=L2O922a9WZmlPredpfqcFeznyIaN0AM+ucM06nCll7Q=; b=No0A83rVbOVV5rEeJzoNIyXz3A Rcgg05mHipCfPSnQWuhaKEDyVDOH9ha7+kiGdycMjUMIj6UdNZhIeYOZUb8HEOSOhuc4fxOL3MLHT VXEdEZg/z6EL6FqQKqH/5PKps9MWqPF/MQ3m/tTkiF2oliajcDjn25p/OFX09lmuywhSUtAgOShJC H/Z39RMrAwvLipmeSPnUOYyduJYY3hXwQfXSZXFk54iozykrOrsIbE81gks6O11dLAZ09Dqfm9HNr PDxp0ms//Pht0aKPcqD3WKNxkjxKf472NwXL3jO18TWhjHL+9nBtWMKjEgW90s3sA2A8TcMQiBbdX p0gBhh7g==; From: David Woodhouse To: xen-devel@lists.xenproject.org Date: Sat, 1 Feb 2020 00:32:59 +0000 Message-Id: <20200201003303.2363081-4-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <8a95f787ca93b23ee8d8c0b55fcc63d22a75c5f3.camel@infradead.org> References: <8a95f787ca93b23ee8d8c0b55fcc63d22a75c5f3.camel@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by merlin.infradead.org. See http://www.infradead.org/rpr.html Subject: [Xen-devel] [PATCH 4/8] xen/vmap: allow vm_init_type to be called during early_boot X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Julien Grall , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Varad Gautam , Ian Jackson , Hongyan Xia , Paul Durrant , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Wei Liu We want to move vm_init, which calls vm_init_type under the hood, to early boot stage. Add a path to get page from boot allocator instead. Add an emacs block to that file while I was there. Signed-off-by: Wei Liu Reviewed-by: Jan Beulich --- xen/common/vmap.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/xen/common/vmap.c b/xen/common/vmap.c index faebc1ddf1..37922f735b 100644 --- a/xen/common/vmap.c +++ b/xen/common/vmap.c @@ -34,9 +34,15 @@ void __init vm_init_type(enum vmap_region type, void *st= art, void *end) =20 for ( i =3D 0, va =3D (unsigned long)vm_bitmap(type); i < nr; ++i, va = +=3D PAGE_SIZE ) { - struct page_info *pg =3D alloc_domheap_page(NULL, 0); - - map_pages_to_xen(va, page_to_mfn(pg), 1, PAGE_HYPERVISOR); + mfn_t mfn; + int rc; + + if ( system_state =3D=3D SYS_STATE_early_boot ) + mfn =3D alloc_boot_pages(1, 1); + else + mfn =3D page_to_mfn(alloc_domheap_page(NULL, 0)); + rc =3D map_pages_to_xen(va, mfn, 1, PAGE_HYPERVISOR); + BUG_ON(rc); clear_page((void *)va); } bitmap_fill(vm_bitmap(type), vm_low[type]); @@ -330,3 +336,13 @@ void vfree(void *va) free_domheap_page(pg); } #endif + +/* + * Local variables: + * mode: C + * c-file-style: "BSD" + * c-basic-offset: 4 + * tab-width: 4 + * indent-tabs-mode: nil + * End: + */ --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel