From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ACC20C04A6B for ; Mon, 13 May 2019 00:39:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7DE9220989 for ; Mon, 13 May 2019 00:39:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u2Nv4NpB"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="ahcAC2+7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DE9220989 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=W1W2Lfbr+rit67uZEu4KtldofwgYisAsCHlQGH+XUIE=; b=u2Nv4NpBHyUjDJ H0otfc2dP3J9kmq1gVeJyBFq3Rcnm9EGeqR3HJYJNQVWPKwXrinzM6FCoDn4b4opKxrCfNf5Pe0Cm AbT9/l+yxiPLV7NrkurdQeIvSB8n5AcgFIHviC4ZqTTFGXW4hxPDZVeim0rO09cLcdusKjj8GuxSo rgOp7Eerg2//T4hwezQ1jY0E88xRBJX4tL5xvc+Bz3E+CETNQT7CAvvWa12EBAfisYa/WPqeVisso cDK2yJFFIt2tQr47aWZhhFGFh0LhjxPzPmWRWreeRHUtV+HJMf81Do5iGF0J0zs8KYjCO2mJxHVd+ HT/THPwVEWFymloiVUJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPyzx-0007lt-4m; Mon, 13 May 2019 00:39:21 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPyzt-0007hE-Qw for linux-arm-kernel@lists.infradead.org; Mon, 13 May 2019 00:39:19 +0000 Received: by mail-pf1-x444.google.com with SMTP id y11so6195929pfm.13 for ; Sun, 12 May 2019 17:39:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jbMbvlKHRDKPF33fkDdqZosCX8TlLi6L2lIp8AEgfEI=; b=ahcAC2+7tRqSmf9Sq99vuJtmBgerjrkeU5hvbO9VJcojV+ouWXEK2WeqLWILjwlbdt Wi53Y/OQI6YLkTJgy3lPLJJPk5CF8eddpc9pRhuK7JQ+wEabCM8KLJhCp5aFSUa4RvWI Qlz1Lwoz3OiB7nRfGUHgjdqktnzFo+efzXEbk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jbMbvlKHRDKPF33fkDdqZosCX8TlLi6L2lIp8AEgfEI=; b=HDZWJhj0/ythqbyTZ7GZp1l5Lf9INR4VL47w28Lvh6ebQT4pwgDq1ZtnX2x4fdcFuv 5SPLzCaWH2ALbMFld4SI8qfYnhPpZT3DO8WHnC/6CK1/Wf8TBFSvyzv+u+7qS0mkoC5p V6vwE3h+0O8kAr9Zkpm9GrfX+8aFuKhMchdI5Xcdz6J4FmSdAtwj4He1d8aAL/7KXz/e I7gTROGsTtEMQNHWDnJJbRy9/4lPRqsIBSC1+BBIbChOb5jMSBRAmR8YIY5VobQ6+bJL /4+VSxq9CUVur3OGnorPe3Icf58RpANW2eV3xmf/fptL62ZXN2wstB5l0IMDgWqWT8u6 lxFw== X-Gm-Message-State: APjAAAXohlDrXrAby5sruuK+bNLR0jF+ZoU2JIEDc/jcptRAYpY2zdez tLfk5+A7Rw+oHagGs9TCNyJFhe3D1Ws= X-Google-Smtp-Source: APXvYqwvJ+s42h/ZoVPUfChayYtwKVcwlby7x/lX5fwmShnyI1xrkZYSHRWHIJyOpTadffshc3b6qg== X-Received: by 2002:a63:3dcf:: with SMTP id k198mr28317089pga.60.1557707956264; Sun, 12 May 2019 17:39:16 -0700 (PDT) Received: from hsinyi-z840.tpe.corp.google.com ([2401:fa00:1:10:b852:bd51:9305:4261]) by smtp.gmail.com with ESMTPSA id a9sm14619577pgw.72.2019.05.12.17.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 May 2019 17:39:15 -0700 (PDT) From: Hsin-Yi Wang To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/2] amr64: map FDT as RW for early_init_dt_scan() Date: Mon, 13 May 2019 08:38:19 +0800 Message-Id: <20190513003819.356-2-hsinyi@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190513003819.356-1-hsinyi@chromium.org> References: <20190513003819.356-1-hsinyi@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190512_173917_902258_D3A4D344 X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, boot-architecture@lists.linaro.org, Michal Hocko , Kees Cook , Ard Biesheuvel , Catalin Marinas , Rasmus Villemoes , linux-kernel@vger.kernel.org, Will Deacon , Stephen Boyd , Miles Chen , Rob Herring , James Morse , Hsin-Yi Wang , Andrew Murray , Andrew Morton , Mike Rapoport , Frank Rowand Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently in arm64, FDT is mapped to RO before it's passed to early_init_dt_scan(). However, there might be some code that needs to modify FDT during init. Map FDT to RW until unflatten DT. Signed-off-by: Hsin-Yi Wang --- arch/arm64/kernel/setup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 413d566405d1..08b22c1e72a9 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -179,9 +179,13 @@ static void __init smp_build_mpidr_hash(void) pr_warn("Large number of MPIDR hash buckets detected\n"); } +extern void *__init __fixmap_remap_fdt(phys_addr_t dt_phys, int *size, + pgprot_t prot); + static void __init setup_machine_fdt(phys_addr_t dt_phys) { - void *dt_virt = fixmap_remap_fdt(dt_phys); + int size; + void *dt_virt = __fixmap_remap_fdt(dt_phys, &size, PAGE_KERNEL); const char *name; if (!dt_virt || !early_init_dt_scan(dt_virt)) { @@ -320,6 +324,9 @@ void __init setup_arch(char **cmdline_p) /* Parse the ACPI tables for possible boot-time configuration */ acpi_boot_table_init(); + /* remap fdt to RO */ + fixmap_remap_fdt(__fdt_pointer); + if (acpi_disabled) unflatten_device_tree(); -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel