From patchwork Fri Sep 28 06:48:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10619063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC01015A6 for ; Fri, 28 Sep 2018 07:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1DEE2AE9B for ; Fri, 28 Sep 2018 07:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93BF02B005; Fri, 28 Sep 2018 07:07:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D1A802AE9B for ; Fri, 28 Sep 2018 07:07:20 +0000 (UTC) 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=HnPywlVy1aPzgXzMkN+I09mqKNe+fzVRWA5HrA6jAKs=; b=JH0RfPl0EGGcjn 5hM+QcFvxEmtc/01I3iaH2eVNeDpe0XAbTvGt6gbPS2YWsy3SeJE085cDZ74DVGBf56S0B0W4mgIX BbQqyzRleLeekJ03hR7Y008LAtw4gXFwmC+RFq/6OJIioZUm5E6FeK5XqvH0CKkc5+sQZvCS/iLH/ m+I1lP4p1U2HxNOAiZFhPeWgyGLuyKuQoqjxGqepyLNwnk+YLRdDNnQWWcJ1V6Ou4jO/z14no3m6X JCqqQsWixshCN6r2Gug/EVjNRbr4HNG1q515XUGjVi34jtIHsU3SWmyobRgVw5BR8yrkSlqWmbi3A q8gvBjJIg60CUwV+/9PQ==; 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 1g5mri-0007an-6C; Fri, 28 Sep 2018 07:07:06 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5maF-0004lh-7Y for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 06:49:08 +0000 Received: by mail-pf1-x441.google.com with SMTP id a23-v6so3604373pfi.12 for ; Thu, 27 Sep 2018 23:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N8QYerXEaqWdfHlNx6gpLi8IwzqsBwOqOFk9N60B1+Q=; b=Tc7XQ2hZJ6SjS4SXXcKYB/SZbNb8G/jmNJ+1vuqJYd6C/k6BbqE+edQSjeMnGiZs3Y A0VCZ/JHZhiBiB2/7MRSyB7FIRkKBkb47ALkfv9KmfCTbOszUQLURgCsckkyVtuljXOR T63PHJt3JR4e4MvygfII/ddGbUISN86QOFxSg= 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=N8QYerXEaqWdfHlNx6gpLi8IwzqsBwOqOFk9N60B1+Q=; b=q22Yy/tf1X7QOwbdZwebVfkRCV0YPQimfGkfhnu7HxL4h9NiXl0T9G+gvOfKS87blj njJ3k07p5lIimmxc1FEMSvMvfM4bDg/fzG1JMlyZXOvpsHnz4IoPthgCnLdgeFhy3vBK 7AfceZeVUTqbK8X1adokUlnIS7nGFt4R7p/dtw3O9/AWfzfE67LeUibcXwnfnSXYYYTo H28MHyJ9VOqHGCMFUCwZSzN7c2WI2XLnaKYdRq7hvqYk/TM2t0K3UV2aQm1ipgWlVTka M7fyPfbALeGw+fuvujVvCyfe0gE/xva+bQpdc9hpqHjGXez4Zy2Lj1WeRNXaWuUOpsqu D2/Q== X-Gm-Message-State: ABuFfoj0ggFSPz/2v+/rkrPLL9/r3d7Ry6AcZpx2kHhVJHpgH0h+HM/f OrsYN1C/c4MTEofsFutnZ4rADw== X-Google-Smtp-Source: ACcGV60mPmG4AADbz/8T/ORk88Dmpu4qsOFHXgJ2s6jc32zlsjO64PKUhS8nPy+J/BF2GDfcl8kbdQ== X-Received: by 2002:a62:7501:: with SMTP id q1-v6mr15046736pfc.225.1538117320761; Thu, 27 Sep 2018 23:48:40 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id m21-v6sm5869051pgd.6.2018.09.27.23.48.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 23:48:39 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: [PATCH v15 09/16] arm64: enable KEXEC_FILE config Date: Fri, 28 Sep 2018 15:48:34 +0900 Message-Id: <20180928064841.14117-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180928064841.14117-1-takahiro.akashi@linaro.org> References: <20180928064841.14117-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180927_234903_368333_B26DD2AA X-CRM114-Status: GOOD ( 14.72 ) 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: ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Modify arm64/Kconfig to enable kexec_file_load support. Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon Acked-by: James Morse --- arch/arm64/Kconfig | 9 +++++++++ arch/arm64/kernel/Makefile | 3 ++- arch/arm64/kernel/machine_kexec_file.c | 16 ++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/machine_kexec_file.c diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 1b1a0e95c751..5eb18d0cb513 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -843,6 +843,15 @@ config KEXEC but it is independent of the system firmware. And like a reboot you can start any kernel with it, not just Linux. +config KEXEC_FILE + bool "kexec file based system call" + select KEXEC_CORE + help + This is new version of kexec system call. This system call is + file based and takes file descriptors as system call argument + for kernel and initramfs as opposed to list of segments as + accepted by previous system call. + config CRASH_DUMP bool "Build kdump crash kernel" help diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 4c8b13bede80..030a39bff117 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -49,8 +49,9 @@ arm64-obj-$(CONFIG_ARM64_ACPI_PARKING_PROTOCOL) += acpi_parking_protocol.o arm64-obj-$(CONFIG_PARAVIRT) += paravirt.o arm64-obj-$(CONFIG_RANDOMIZE_BASE) += kaslr.o arm64-obj-$(CONFIG_HIBERNATION) += hibernate.o hibernate-asm.o -arm64-obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o \ +arm64-obj-$(CONFIG_KEXEC_CORE) += machine_kexec.o relocate_kernel.o \ cpu-reset.o +arm64-obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o arm64-obj-$(CONFIG_ARM64_RELOC_TEST) += arm64-reloc-test.o arm64-reloc-test-y := reloc_test_core.o reloc_test_syms.o arm64-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o diff --git a/arch/arm64/kernel/machine_kexec_file.c b/arch/arm64/kernel/machine_kexec_file.c new file mode 100644 index 000000000000..c38a8048ed00 --- /dev/null +++ b/arch/arm64/kernel/machine_kexec_file.c @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * kexec_file for arm64 + * + * Copyright (C) 2018 Linaro Limited + * Author: AKASHI Takahiro + * + */ + +#define pr_fmt(fmt) "kexec_file: " fmt + +#include + +const struct kexec_file_ops * const kexec_file_loaders[] = { + NULL +};