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: 12044107 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 F25CAC43381 for ; Mon, 25 Jan 2021 19:19:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7DB342251F for ; Mon, 25 Jan 2021 19:19:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DB342251F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D7EFE8D001C; Mon, 25 Jan 2021 14:19:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CBA258D0001; Mon, 25 Jan 2021 14:19:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA8FD8D001C; Mon, 25 Jan 2021 14:19:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id A16318D0001 for ; Mon, 25 Jan 2021 14:19:28 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 63F1C8249980 for ; Mon, 25 Jan 2021 19:19:28 +0000 (UTC) X-FDA: 77745261216.13.low04_280ac4827588 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 44C5018140B7B for ; Mon, 25 Jan 2021 19:19:28 +0000 (UTC) X-HE-Tag: low04_280ac4827588 X-Filterd-Recvd-Size: 5156 Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 Jan 2021 19:19:27 +0000 (UTC) Received: by mail-qv1-f43.google.com with SMTP id a1so6701131qvd.13 for ; Mon, 25 Jan 2021 11:19:27 -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=foGhWybKF1tMOcF4jiJ1gIPI77Xap0JXDTf+6TGk1PBbPQXdg2CeH8X5q1PF0VpiNm JDKsAcsOkiEKdTYL41fa5WkTIH108zUWtop8KQC+sOR6Jio1unZpzaSb+C/MSPSyBG1g poaC9Xluochk5Fh4peoZjX7kgp6OVEs4ZDLWW2AI0n0sUkwuDGbNFnACrGiYoso1eLMA 8TNrSbVgozFww5GoW9mI8DRJ3jGafN/MDqHJY3OuSzNNRnX6id4mKrVdriCfNyvYVbU5 Y9kvN8IW86lkzu9uBF2KJtAEDOfeZ5RLhwLcuOUlmVUZG8GQX1W5wPIh3//RWHVT0Ut4 3ROQ== X-Gm-Message-State: AOAM532EMhIK7uGm1DB/Ywn6LhCMvIj0xHHDlkw7pbzKZUKSUiqF9D09 ODy2HKus0rcmqqUyK1WYb6A1xw== 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-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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. */ }