From patchwork Mon Jan 25 19:19:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 12044149 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 79F92C433E0 for ; Mon, 25 Jan 2021 19:22:00 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 226EB21D94 for ; Mon, 25 Jan 2021 19:22:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 226EB21D94 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type: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:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TeubOPPDJNGcQUvm6HTY7PAVrMG6VwgxX1YXdNf/fLg=; b=UpDna7lniGV12Djzn3ia2Wj/yv 0PlRXZ97wA5lVixATrzMRT8ZwWy37V5a6UhPONzx+jYjXmN4TuGbRTuefU2sEO69Pm0zu1+XD6WPA KnvKHDWxBhjQqgleWHS8QI8kR68PQTXiDHmNMrIGsO16pJELimROJc150f6sa5msvKxZqFegY9bqR cPz6WLQHI01ehXVpr0uix8U6319LMDAG+DHozqxFobL4XR70Lpxxp+V/+bsCl8xUuPjjAZBWpvB+U hnxHmP8/3KtoKJOQb2p4lnSk697yN7Sx4hBwdhfkhrRVf9tmkZL1wZq2wFtWLLyV6R0LaW6gAeutG 5MIMt0aA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47Op-0007BA-QR; Mon, 25 Jan 2021 19:19:43 +0000 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l47Oa-00073E-OW for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 19:19:31 +0000 Received: by mail-qv1-xf30.google.com with SMTP id j13so1381361qvu.10 for ; Mon, 25 Jan 2021 11:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=etL32FYt+98u1sEnSN2D9m2zEWLuZNtfowf09CYacIU=; b=fd0Lk6UOzO0TicMR5oWXHg+JuTghXP3CauOmv+oga2qmCQO/ZG/IiT8HXfv2U++qqc KbyfcrG5gvFX62FWqf92w2nWIOCis9V5mQX1tQd+Ywe6zBeMa5xAdRflPHcI/Vhb+CB5 ArtjxyEr8hBh7PGYANxNGz7SyV5FeTRqEFDuquVkiK6f2rPEjTV8PU5aIhSSDteWN8nQ cZbAyCVs6sQpDayWlXkRJUoDMIX5pQAeFQZ5a4K8F5nO0isXUUoeNe3znwWYTxHKC6pL EB42Cxu/hu0LdmQdPRypPBrnMU+fYdv0cKqxTUvu29es2XrwE/96x6W4ShlArBm+SW68 /Sog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=etL32FYt+98u1sEnSN2D9m2zEWLuZNtfowf09CYacIU=; b=SOhsvzIrtLwK0K8JSVHhpTZN4Lku7d9Gii3v9fa7QCQjMCDRsQLqpdzxWOzYzzRnhG WcKLlNk2+4THJyIg3ZgnMmksSJsazb+Fpf3n7FQYw2I/iQZmyKE4rmg7nlYb2i1j/3X3 N/jsSxs+6gzPSMQGm+z97ZWtssMzyriUplkWesbqD3SKgoM94Yi7lVjyHrNXRzJ9mHRY ndNOV1kMypUTmodzF9HWeklAOXzvSZDeiWrDm9Fya5Ne2fCoEOU+jKl5mrkmE6zbt26H 8B4fmblqQIXZn17r5+hdKnZpdk5DYxAK41r8I25Qy9/0E42zcvcgBlLALi+Celtasla5 z5DQ== X-Gm-Message-State: AOAM533tY/n5XhWd4ZPd1q8uG2kw2rblvNB+NJ8T3OB8NZmasR+TzFmr EsMkgG5Wbm3RjkTGk69tJoaThQ== X-Google-Smtp-Source: ABdhPJxsUsLk3uypyODw2uSFbzFEEVUFtn5pCaoqujizEArj1agTAVjfzSE4qT7+XYJRN9kW/PJkwQ== X-Received: by 2002:a05:6214:36b:: with SMTP id t11mr2228378qvu.33.1611602367042; Mon, 25 Jan 2021 11:19:27 -0800 (PST) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id s6sm9047638qtx.63.2021.01.25.11.19.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jan 2021 11:19:26 -0800 (PST) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, ebiederm@xmission.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, corbet@lwn.net, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, maz@kernel.org, james.morse@arm.com, vladimir.murzin@arm.com, matthias.bgg@gmail.com, linux-mm@kvack.org, mark.rutland@arm.com, steve.capper@arm.com, rfontana@redhat.com, tglx@linutronix.de, selindag@gmail.com, tyhicks@linux.microsoft.com Subject: [PATCH v10 01/18] arm64: kexec: make dtb_mem always enabled Date: Mon, 25 Jan 2021 14:19:06 -0500 Message-Id: <20210125191923.1060122-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210125191923.1060122-1-pasha.tatashin@soleen.com> References: <20210125191923.1060122-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_141928_823050_6634C2D2 X-CRM114-Status: GOOD ( 12.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, dtb_mem is enabled only when CONFIG_KEXEC_FILE is enabled. This adds ugly ifdefs to c files. Always enabled dtb_mem, when it is not used, it is NULL. Change the dtb_mem to phys_addr_t, as it is a physical address. Signed-off-by: Pavel Tatashin Reviewed-by: James Morse --- arch/arm64/include/asm/kexec.h | 4 ++-- arch/arm64/kernel/machine_kexec.c | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/arm64/include/asm/kexec.h b/arch/arm64/include/asm/kexec.h index d24b527e8c00..61530ec3a9b1 100644 --- a/arch/arm64/include/asm/kexec.h +++ b/arch/arm64/include/asm/kexec.h @@ -90,18 +90,18 @@ static inline void crash_prepare_suspend(void) {} static inline void crash_post_resume(void) {} #endif -#ifdef CONFIG_KEXEC_FILE #define ARCH_HAS_KIMAGE_ARCH struct kimage_arch { void *dtb; - unsigned long dtb_mem; + phys_addr_t dtb_mem; /* Core ELF header buffer */ void *elf_headers; unsigned long elf_headers_mem; unsigned long elf_headers_sz; }; +#ifdef CONFIG_KEXEC_FILE extern const struct kexec_file_ops kexec_image_ops; struct kimage; diff --git a/arch/arm64/kernel/machine_kexec.c b/arch/arm64/kernel/machine_kexec.c index a0b144cfaea7..8096a6aa1d49 100644 --- a/arch/arm64/kernel/machine_kexec.c +++ b/arch/arm64/kernel/machine_kexec.c @@ -204,11 +204,7 @@ void machine_kexec(struct kimage *kimage) * In kexec_file case, the kernel starts directly without purgatory. */ cpu_soft_restart(reboot_code_buffer_phys, kimage->head, kimage->start, -#ifdef CONFIG_KEXEC_FILE - kimage->arch.dtb_mem); -#else - 0); -#endif + kimage->arch.dtb_mem); BUG(); /* Should never get here. */ }