From patchwork Thu Nov 15 05:52:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10683551 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 7789914D6 for ; Thu, 15 Nov 2018 05:55:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61EAD2C140 for ; Thu, 15 Nov 2018 05:55:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5550E2C15A; Thu, 15 Nov 2018 05:55:59 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW 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 CD7F42C140 for ; Thu, 15 Nov 2018 05:55: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: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=R9Awwh/WsbEet+9nG1UtGVwQ8wLSDi6Zsd+KnajvKlk=; b=TMaqjEmqlA9ymX ldfuIzyJGKMvhVTKwrYAuTGG4uEeSltRRN5GauyXrcBK9yidpjhQOGjZaTtMK8eHuWz9qNAqApI11 cuaFMzJUOMSNZdhxn2DUQKFQGaEWcnyhfPT9+X9K4JpcqfAhehwJJponIR1OPP5q0Ci1pLrbazyCv +p+Hblf2tK2L226nMNzgRzXLe3v0gXh3oQQk5KrfKwwkG+Lz64z3ZZ7VGHN2a6vBZBLT2YAqKwTjW aVHhJZnQuwg/3XrHkl44FTEivUzRAAnTCLg5Y6upbqRy7e8TRzc+wGLT4SQAKyFqwESv47jXtCb2O kNRZ4CfwpXMwqyXHLkFQ==; 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 1gNAd7-0001L0-Hu; Thu, 15 Nov 2018 05:55:53 +0000 Received: from mail-yb1-xb43.google.com ([2607:f8b0:4864:20::b43]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gNAam-0006GJ-RD for linux-arm-kernel@lists.infradead.org; Thu, 15 Nov 2018 05:53:35 +0000 Received: by mail-yb1-xb43.google.com with SMTP id h187-v6so7903251ybg.10 for ; Wed, 14 Nov 2018 21:53:18 -0800 (PST) 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=v/2g1t2ZiuSybJx6NO3mxBVk7FXFeZVpACxhmjpzZl4=; b=WRM172Hvt4U1KKJWpGr+jhsdTHlND6n0dqnf7rnB7KR/ez937GBqOmCQCx1s21rU0p ujsZeGL5rIRXhbwM/XGgrEUm8q1RE20jG14eR764S9DPpUM1XDNxeOD3x8y8GSTl1UVZ 1rt2/niMdKhX5PvrZYLdimEpAHH7VSWUy5rNM= 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=v/2g1t2ZiuSybJx6NO3mxBVk7FXFeZVpACxhmjpzZl4=; b=JPzsAJIL5oR7iCh/zHa8odzp4Ih62wlrb3OiPx5l1DJS1NkhQm6vTouQRjo9ZvaYtP LhEE+dyCTHGt3XABpXmLZwtxfwGd+dQg9B0jwUBzF8bxxY7OkKKPktNtemE39YiPjbM7 SXYycHGlxVpRNMOJf4B94+FdLjYiulBwm5BoTomEraKgByMJSZFPFjtGik9n8Zg6l7If xLDREqEh/ai8JDTqrE3c0ZV/16J9SN71P1+oAmT7uJOPwgNzCJdYRP1i+lquPpb8u3is baXUzb9JnzRPSORXDB3q3se1seC3Cgtlglf1b0u0pOcBxozlM7Gac59vPySHTeaBGazR pv+A== X-Gm-Message-State: AGRZ1gJe3D6+EWehZhJTn5utcWYoe19n+GqbTJehgCEJ8x2RPFPSqIiJ PkQgJ4jlQ3yYlpNQ/04m6yQ85A== X-Google-Smtp-Source: AJdET5eL4UvzIiUqLTSwJlF/faDVYgAhj41qDVfZC9x7FDJJIszpXTG+cTHyextEIIGCfJdne+plig== X-Received: by 2002:a25:2d16:: with SMTP id t22-v6mr4345342ybt.352.1542261197591; Wed, 14 Nov 2018 21:53:17 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id r5-v6sm8102379ywr.80.2018.11.14.21.53.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Nov 2018 21:53:17 -0800 (PST) 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 v16 09/16] arm64: enable KEXEC_FILE config Date: Thu, 15 Nov 2018 14:52:48 +0900 Message-Id: <20181115055254.2812-10-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181115055254.2812-1-takahiro.akashi@linaro.org> References: <20181115055254.2812-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-20181114_215328_914772_9D0847FC X-CRM114-Status: GOOD ( 14.33 ) 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 787d7850e064..93dc4d36d6db 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -858,6 +858,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 +};