From patchwork Tue Jul 24 06:57:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10541499 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 DC60014E2 for ; Tue, 24 Jul 2018 07:53:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CED1228773 for ; Tue, 24 Jul 2018 07:53:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C24DA28777; Tue, 24 Jul 2018 07:53:58 +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 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 6423B28773 for ; Tue, 24 Jul 2018 07:53:58 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=vYR1uo2/pEv4Br8jnXfGeFFuxJOX9Rf8/VUAXaSl4VE=; b=X+LImFbCXe5A6EDIaMu5zYQ1ps sggfsLz9wK+Mniobm6FozUKMpip5Nsx6xA7wnfpBvpYEoPyB3b4GdeGtr94mjNAgQ1kI2LgmLuxTK 3SGlAEp6LvciVJ0A5HDCaNTuuNivJZX4u2M5ChE2lrg2GJ8FVno26rmENFsw5fkihYuZ11BMZhR7+ cxUL+UlMiEuJYPkA7wSQW/6CXbQ3cSThMrzz6OlLMqswNvI5cOz2s5bZHBYbMsD/Q6CO/7NAJic7a d0rHtxvji3KKa+wRbUaobrPyGJjtgEN41Sofcg1+tNHCH3xY6euU9mmqgA1XRZpPwd+tb2U3sg8Zp qUxmNosw==; 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 1fhs8m-00018b-Lf; Tue, 24 Jul 2018 07:53:52 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhs8E-0000PI-CJ for linux-arm-kernel@bombadil.infradead.org; Tue, 24 Jul 2018 07:53:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=KpsdpYdK4Ysd+TV+/RS+nNDg3tlVVRvIVtSFn8+W9VY=; b=zWvRVdorVR4X0fChXaoXVwDBY cI6VX0c24vjL6dGzZw7JDoS0AbtZbbLmsrUYli6X9N4bSBvxna8Rz16pguF3FY8kgrQoI/YK9Sww4 mfsYP+Hw9MCoJ69D05dKhs/Y3sK9l9WIoGSXHPol2IeSV8VYhuxsRtt6mp1RgpCyMsrYWjIQd5aaZ Ngvr2zDEx1qk57dkO86Zzna3qF7U2H/nfiGxToRZN4Eb/pL0T5JpPMhQa2m1tNNeM7IFSLxONjFWl lcZb3+MnN8MovDGWSLt7yQ/fFuKmAC8Dc9dN3BkIeZj/UAFG29cGmVAdOSZOF1wi76Fx5dEvkYFBC 6lfWDkRGA==; Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhrHA-0005dM-C1 for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2018 06:58:29 +0000 Received: by mail-pg1-x543.google.com with SMTP id y4-v6so2180945pgp.9 for ; Mon, 23 Jul 2018 23:58:28 -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; bh=KpsdpYdK4Ysd+TV+/RS+nNDg3tlVVRvIVtSFn8+W9VY=; b=C0Z5IsxhlehoOj3yXB1+CXNGBevv2cwHj7x6AgVewoFkRY3kQ0tSRABz0nl9YCj1A7 dbVu0OsP4aLNOXDh73SV6cSH77OT6r6hfArvF0igrHylRoHNskMCSZJexXxcwKkK5zAa kiZ1NzeNxhvYrXTjlM3PLcerbGCrlh2W7MtMw= 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; bh=KpsdpYdK4Ysd+TV+/RS+nNDg3tlVVRvIVtSFn8+W9VY=; b=NSGHhE1rkCY0sLI01vBB9r3W4YIAlKd30RB/Xn4L64RQTrjQU72f3mDqoAqMw/Xgu3 4e43kPYOqhVvAQIjNDeRJvHBnDc2NmBu66E/car0ti8sdO/J8ygRCiKva8phBHcmxn1l OEUWZdtrZdScHWkaKr5lzMG6ZWmecfRQT73I6XlHu2oY/hWIipm/s/55aqWKcU8vlf/W WbPzU2d+Tt/8Ntt60blz6Uo2b5kkpI/NvjcOMqPjERvcg5ZbJPzkulNNY9FlQ1ZCOLSD n/KQ10SQF9vgjRnzDN07p9zS9Cwvbxj1EyTE31fdN3DoEb9pPjP2juENogmBCEWKG8J/ Mdbw== X-Gm-Message-State: AOUpUlF4BtXwBAx8PwoEW83r5T9fy1ve6y8GLY9ZGoP782U6W7KFMgYN LP+vGf84fPtkK6K36wZMz66fmA== X-Google-Smtp-Source: AAOMgpcULG9DUtF4Qj8tlxJwCcwKkpHAlGxDMh0oI9A/casaKsk54s8umNVVMPZ/tQO+WOGeKQZ2Lw== X-Received: by 2002:a62:aa02:: with SMTP id e2-v6mr16287521pff.211.1532415506173; Mon, 23 Jul 2018 23:58:26 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id u1-v6sm21299425pgk.25.2018.07.23.23.58.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 23:58:25 -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 v12 09/16] arm64: enable KEXEC_FILE config Date: Tue, 24 Jul 2018 15:57:52 +0900 Message-Id: <20180724065759.19186-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724065759.19186-1-takahiro.akashi@linaro.org> References: <20180724065759.19186-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180724_025828_489171_6B3EDD31 X-CRM114-Status: GOOD ( 17.84 ) 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, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 42c090cf0292..a9a3a5583c8b 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -835,6 +835,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 0025f8691046..06281e1ad7ed 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -48,8 +48,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 +};