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: 147775 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp371388lji; Thu, 27 Sep 2018 23:48:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV63h/wiFGqFqWd6y2MtDmIYv7J6UwMKaYLDQyYreigQW71GSM9MpKm2o70IUK67cQY8aAFHw X-Received: by 2002:a62:13cb:: with SMTP id 72-v6mr10325711pft.34.1538117324556; Thu, 27 Sep 2018 23:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538117324; cv=none; d=google.com; s=arc-20160816; b=0hpoQy3H3yNpeVJJHygiXOkpY1Ok908UCz/kEke0sZvbPMMT4KxHGBxVLNPqVCRwpY z97cWMEgPgImlPVuJWuPc9yil4mUSIGLaDc+ELO+UA/jkvZkmsrvkTLXfb7uGuQ8ztXM /zNmEgfPQZ+FtbXIt9FwrMHT4nGkj/plsWWjz7OqvIopXX8p9YsSHOX/SUzLYMXG75Mu +CdDK5FLrUsJzPQ4Vos7MzvXuLn9py7YJYZafa8oHKev9yigwdxmS/NVJWvEOXgU+Lm3 ni/MTuAJXiCfeAOQB71vLXVuDQy23L/zhbRrCwiib2wC3M9ZRyoecud8GjUO7t4egr5B ldAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=N8QYerXEaqWdfHlNx6gpLi8IwzqsBwOqOFk9N60B1+Q=; b=NHeLyHWavouOQJjXHN87uBBPupRt5Zx8hez176b1S3eHOB4Dtw8IwCKOjK4+kaGzSy GQUdKSwU3+LJVPusDRRqbkpgcZJzfwNcbEUI5se1ZiyUpcVAgQ74E5Zx4E+/0tVv9pB3 EPcOmYXt8/jZ6ktrRJnWcZnlcMlgiBU55hTQaYarVxjy1+e2J4yonzAc/Ca2cNkEZxtq 5OO1m7M9YQhNOQNwn4z5BJ0vxrwTv43AWTED72KRiZdonKArr2DlQM+9iiud6CRu+5H9 oCviMw+yRv1KiJFPWDKNh7pUSK5K5rhL5azjw5OzS7ccU0Lb4TuL02edRAbcBp/ct4YL 05Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tc7XQ2hZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si3987407plo.418.2018.09.27.23.48.44; Thu, 27 Sep 2018 23:48:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tc7XQ2hZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729136AbeI1NK4 (ORCPT + 32 others); Fri, 28 Sep 2018 09:10:56 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34580 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeI1NKz (ORCPT ); Fri, 28 Sep 2018 09:10:55 -0400 Received: by mail-pf1-f196.google.com with SMTP id k19-v6so3645416pfi.1 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=hx0BVY/PEpOAJBtEuJJdTg6Xox86AgDCeLml834TvYtmUCEjpZO4i475NDXp8i+1hp 4OItzELdTHBf1y0GpWE9XropsJZKy01wfBoaWRJZx0f4t1ag4tpbL3feTmpaAyxURLaC t98RhAyqAiwax1lKHkv7nG32ylbGixC+qlYztdMBdh82a/2zPooOEKRhEbINpibA1nDV 49Fp5eCIw0Yu5nKzUf4PQ+zFL+Aqymu3zTueR0keTaZOfqQCg5aSqjWGb00R+wvuVhhy fxDNlSVvP6xGH9tbqlrcDwGXhgRKaGiyuTz1eSD2S4RqYm5U9WRT2bB3n8TJ3fQcA0UA BdRg== X-Gm-Message-State: ABuFfoin4wdhox5DVEiVoaG44VF0eVwaa5n0RBJ2qlzbb1seIJyOMV3F 9u6p7HH7Kj3CxiJoUHYp3QRIkQ== 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 Cc: prudo@linux.ibm.com, ard.biesheuvel@linaro.org, james.morse@arm.com, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.19.0 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 +};