From patchwork Wed Jan 8 17:24:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Woodhouse X-Patchwork-Id: 11324195 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08FC21395 for ; Wed, 8 Jan 2020 17:25:47 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D97CD205F4 for ; Wed, 8 Jan 2020 17:25:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="25Ow2VaD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D97CD205F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipF4y-0003OZ-2k; Wed, 08 Jan 2020 17:25:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ipF4x-0003OD-1j for xen-devel@lists.xenproject.org; Wed, 08 Jan 2020 17:25:11 +0000 X-Inumbo-ID: ceed300a-323b-11ea-8599-bc764e2007e4 Received: from merlin.infradead.org (unknown [2001:8b0:10b:1231::1]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id ceed300a-323b-11ea-8599-bc764e2007e4; Wed, 08 Jan 2020 17:25:05 +0000 (UTC) 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=UXxkiVeIWuWUN6bod/uMuc68HNLOFFwcnidb1kQMKyw=; b=25Ow2VaDVPakX7nXdurS9edIsy AuOKa8hY0kO0R8mYfps7QUtDUYe8J0p7sSZ7o9uQf7ksgE+AlDGTB5PbR3ZVTPcujddhX9HyNKq76 m7/Pj1zQqEIXkNPdRU6NSvGqPMdax+eGfVBlOMpqgrKcyJMy0bo/D+YyClrVrL1GUXWDBoRHcI56A ZiYopDQRfyBXuFi4fo36cLMH05yRPsTyHaazi5DfpMQ8eULDLuXROkyXj/sEPKdA/aLh5kUGYbzHs lr8Mou2zrpqDEeK8shaappFItltJp7diU2zxxeZWFKG7QJaI9uK3ah+rGgMcskWrDaoPygBmLeSfu Kx64Hc8A==; 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 1ipF4o-0004uu-7W; Wed, 08 Jan 2020 17:25:02 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1ipF4m-005xKV-97; Wed, 08 Jan 2020 17:25:00 +0000 From: David Woodhouse To: Xen-devel Date: Wed, 8 Jan 2020 17:24:58 +0000 Message-Id: <20200108172500.1419665-1-dwmw2@infradead.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: 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] [RFC PATCH 1/3] 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 , paul@xen.org, Ian Jackson , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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. Signed-off-by: David Woodhouse --- xen/arch/x86/setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index 501f3f5e4b..47e065e5fe 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -1077,9 +1077,9 @@ void __init noreturn __start_xen(unsigned long mbi_p) unsigned long pte_update_limit; /* Select relocation address. */ - e = end - reloc_size; - xen_phys_start = e; - bootsym(trampoline_xen_phys_start) = e; + xen_phys_start = end - reloc_size; + e = xen_phys_start + XEN_IMG_OFFSET; + bootsym(trampoline_xen_phys_start) = xen_phys_start; /* * No PTEs pointing above this address are candidates for relocation. @@ -1096,7 +1096,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) * data until after we have switched to the relocated pagetables! */ barrier(); - move_memory(e + XEN_IMG_OFFSET, XEN_IMG_OFFSET, _end - _start, 1); + move_memory(e, XEN_IMG_OFFSET, _end - _start, 1); /* Walk initial pagetables, relocating page directory entries. */ pl4e = __va(__pa(idle_pg_table));