From owner-svn-src-all@freebsd.org Mon Sep 28 09:16:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 091E43FC799; Mon, 28 Sep 2020 09:16:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0H2M6XLZz46NB; Mon, 28 Sep 2020 09:16:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C39AB1B6DA; Mon, 28 Sep 2020 09:16:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08S9GRI5058569; Mon, 28 Sep 2020 09:16:27 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08S9GRWg058568; Mon, 28 Sep 2020 09:16:27 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <202009280916.08S9GRWg058568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Mon, 28 Sep 2020 09:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366219 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 366219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2020 09:16:28 -0000 Author: mmel Date: Mon Sep 28 09:16:27 2020 New Revision: 366219 URL: https://svnweb.freebsd.org/changeset/base/366219 Log: Fix booting arm64 EFI with LINUX_BOOT_ABI enabled. Use address of the pointer passed to kernel to determine whether the pointer is a FDT block (physical address) or a module pointer (virtual kernel address). This fragment was supposed to be committed before r366196, but I accidentally skipped it in a patch series. Reported by: bz Modified: head/sys/arm64/arm64/locore.S Modified: head/sys/arm64/arm64/locore.S ============================================================================== --- head/sys/arm64/arm64/locore.S Mon Sep 28 07:59:50 2020 (r366218) +++ head/sys/arm64/arm64/locore.S Mon Sep 28 09:16:27 2020 (r366219) @@ -46,8 +46,6 @@ /* U-Boot booti related constants. */ #if defined(LINUX_BOOT_ABI) -#define FDT_MAGIC 0xEDFE0DD0 /* FDT blob Magic */ - #ifndef UBOOT_IMAGE_OFFSET #define UBOOT_IMAGE_OFFSET 0 /* Image offset from start of */ #endif /* 2 MiB page */ @@ -408,11 +406,12 @@ create_pagetables: /* No modules or FDT pointer ? */ cbz x0, booti_no_fdt - /* Test if modulep points to modules descriptor or to FDT */ - ldr w8, [x0] - ldr w7, =FDT_MAGIC - cmp w7, w8 - b.eq booti_fdt + /* + * Test if x0 points to modules descriptor(virtual address) or + * to FDT (physical address) + */ + cmp x0, x6 /* x6 is #(KERNBASE) */ + b.lo booti_fdt #endif /* Booted with modules pointer */