From nobody Tue Nov 11 02:23:50 2025 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 ARC-Seal: i=1; a=rsa-sha256; t=1579683280; cv=none; d=zohomail.com; s=zohoarc; b=czpITIxSSE9ibxYdcKM6GvBO8wPNn3RNa/RX1k4hvfklffxswQ2nX/gXOHBuQxNKrXC8Fx9jN81kUD+20NzcND3fooxklEYvur5IN8pSlqYKEql05uzLnk5xXivdmEaqQ7gAZu/Z2J22Ld6TkTyU+jlZsfR0cJiZZVqqSIevfM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1579683280; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DDzdZBgXISMvS1YZBQ3EKRYRfmwrE8VEcNRzNW5ju9c=; b=maWyCEjeJNEURYqmWWyYyZWJ5qrace3aj5MT72T91i029pIWdCn+ZfR5DDYdaEwVmTAm3rRfe67NDixQNanX+BXwOeH/kdVRCU/m4LLnDFbcjCtOSmyuSGaD+LbCxj8RZtAzohKP1xZLrc0mP9Xmvji6zr41VJ8YtWHU4FA1p34= ARC-Authentication-Results: i=1; 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 1579683280222422.09763356805354; Wed, 22 Jan 2020 00:54:40 -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 1iuBm6-0000oV-Co; Wed, 22 Jan 2020 08:54:10 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iuBm5-0000oI-So for xen-devel@lists.xenproject.org; Wed, 22 Jan 2020 08:54:09 +0000 Received: from bombadil.infradead.org (unknown [2607:7c80:54:e::133]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id baa781c2-3cf4-11ea-8e9a-bc764e2007e4; Wed, 22 Jan 2020 08:53:59 +0000 (UTC) Received: from i7.infradead.org ([2001:8b0:10b:1:21e:67ff:fecb:7a92]) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuBlu-0001yA-EW; Wed, 22 Jan 2020 08:53:58 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1iuBlt-008mRA-6y; Wed, 22 Jan 2020 08:53:57 +0000 X-Inumbo-ID: baa781c2-3cf4-11ea-8e9a-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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=nomD+Gv8dJiIbPvpWMfuujdVDfv/pDuaZ7kWfwN+3EU=; b=dOdgykW4tyC+jVWLudNrBsu52Y pggBBrIwUVTEW3Uy8iRymVi5f/rUxNQLwL+gT4kujmqjg0ZFab9JHROUSQ5hyw6GovIpS0XGOryxw 3a60GVNRCW1rLfX2MP64n0k68KeGTQl3FP8lKQ3GYFr+rDvytx8Jeem0IC9iY/IdaJHx1nhy77jy0 77TTTxxv06zQS503/eo3ZaByeWM0VwPLBJtr0nz1axYKa3vOZ/44lqmpLg3faROSZQM6WRKdWyiL5 7cuzFSWJUc4r+zc8lvxVTjdOx3PNFs3N7ubEB61ivAMArOD6si6I1jHlKjuBXoyjpHw89NvqmHDuD vwclYk3Q==; From: David Woodhouse To: Xen-devel Date: Wed, 22 Jan 2020 08:53:44 +0000 Message-Id: <20200122085357.2092778-1-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <6cbe16ae42ab806df513d359220212d4f01ce43d.camel@infradead.org> References: <6cbe16ae42ab806df513d359220212d4f01ce43d.camel@infradead.org> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Subject: [Xen-devel] [RFC PATCH v2 01/14] x86/setup: Don't skip 2MiB underneath relocated Xen image 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 , paul@xen.org, Ian Jackson , Hongyan Xia , Amit Shah , =?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: David Woodhouse Set 'e' correctly to reflect the location that Xen is actually relocated to from its default 2MiB location. Not 2MiB below that. This is only vaguely a bug fix. The "missing" 2MiB would have been used in the end, and fed to the allocator. It's just that other things don't get to sit right up *next* to the Xen image, and it isn't very tidy. For live update, I'd quite like a single contiguous region for the reserved bootmem and Xen, allowing the 'slack' in the former to be used when Xen itself grows larger. Let's not allow 2MiB of random heap pages to get in the way... Signed-off-by: David Woodhouse --- xen/arch/x86/setup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 1b6ca4a47d..3c6d0a5b35 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1080,9 +1080,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) unsigned long pte_update_limit; =20 /* Select relocation address. */ - e =3D end - reloc_size; - xen_phys_start =3D e; - bootsym(trampoline_xen_phys_start) =3D e; + xen_phys_start =3D end - reloc_size; + e =3D xen_phys_start + XEN_IMG_OFFSET; + bootsym(trampoline_xen_phys_start) =3D xen_phys_start; =20 /* * No PTEs pointing above this address are candidates for relo= cation. @@ -1090,7 +1090,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) * and the beginning of region for destination image some PTEs= may * point to addresses in range [e, e + XEN_IMG_OFFSET). */ - pte_update_limit =3D PFN_DOWN(e + XEN_IMG_OFFSET); + pte_update_limit =3D PFN_DOWN(e); =20 /* * Perform relocation to new physical address. @@ -1099,7 +1099,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) * data until after we have switched to the relocated pagetabl= es! */ barrier(); - move_memory(e + XEN_IMG_OFFSET, XEN_IMG_OFFSET, _end - _start,= 1); + move_memory(e, XEN_IMG_OFFSET, _end - _start, 1); =20 /* Walk initial pagetables, relocating page directory entries.= */ pl4e =3D __va(__pa(idle_pg_table)); --=20 2.21.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel