From patchwork Wed Jul 11 07:41:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 141674 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4800393ljj; Wed, 11 Jul 2018 00:42:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdhearHNokJYtAEC0k0jkr97hN44MAR/NUMW+o0deCbAcsxiqykHOaId2C/S2xR8W8K/X28 X-Received: by 2002:a63:2e81:: with SMTP id u123-v6mr25411448pgu.225.1531294954049; Wed, 11 Jul 2018 00:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531294954; cv=none; d=google.com; s=arc-20160816; b=DN+1p4D5d19CFAk5bKEtZyLt2MX1sSYszs4sY9jXvHpUSGWG5BbV0B55qJbNzZ0KbH viABkhf5TTPflUUAXLZwfg0Rn5ItgofFk/0cmLJ9BpgQ3gHWWcUeenP0TjSTYcgdCt1W aiFTavmLTGGCaGxUGP/AjhWl/28rfR0hWgiMObOYKfWQDxXF0mP9CUcB9PTqwuUj1aVm VGlab7+JI5MRcP72LY+Ci+YyBBBa9O7gI3xBbTMlpzRCdsSvQJl19jQ9fySVyVn1XMBa p/BC+gYCwoLLrVFQN9gJVHnCp6tVYyN1PAYAxhzmHpZB1fqpasqve3crZC1F1l7utCqb Ngjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=m0uS1Rp3rP12XbuAKF03IvNckGWO0+g7J4IbvlkBpFw=; b=OOninNmoj2jkev0PJVVgEXal95HyYNNR2ndt/d1T09kJ/poOJm9XOSvjvbpS4dGIma itY5JFdx/xzMIoImslExQwQ6JIUf2s/AyEv4JakLmvTzF666o33G+S3zlKAPe44KHRZG DNsHGvsraqXoe8YgAOhmJLLlDWscv+s5IFnYAP+FN6aEasc/gGPs4zhDRJN4GWuo/NJe 7jYs6OLJpN/qR6Y5QHpAC+jmTiF1XKe/NH7yrvyB6NJXu06OoPow1QOmYnhzZI7FMwFL tCoKpaQt3wmWN3Q9g1NnIov+u6+cTurjRrRl3x88Pq0HcQLn3vJOfaxIpANRRJolfVvW n41Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DAtkP1oK; 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 x24-v6si18481546pln.22.2018.07.11.00.42.33; Wed, 11 Jul 2018 00:42:34 -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=DAtkP1oK; 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 S1732297AbeGKHp1 (ORCPT + 22 others); Wed, 11 Jul 2018 03:45:27 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:39218 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbeGKHp0 (ORCPT ); Wed, 11 Jul 2018 03:45:26 -0400 Received: by mail-pl0-f67.google.com with SMTP id s24-v6so8804002plq.6 for ; Wed, 11 Jul 2018 00:42:30 -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=m0uS1Rp3rP12XbuAKF03IvNckGWO0+g7J4IbvlkBpFw=; b=DAtkP1oKxpQjbcHAbqs5+uhJHnYUcHpsgvA+27+mYwaNTRzCrIP3RBnKmgW28nyiFw 6Z+WDvy/lycFtAtdGfYARQhsgqyhw5tI6AXEuqlOP2Hpl4obXGNhFV0FwK4H4HMOSBHU oyC3XohhZN3/aTZyPy/u5B8LbY808r5t+QEjw= 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=m0uS1Rp3rP12XbuAKF03IvNckGWO0+g7J4IbvlkBpFw=; b=MO31GpAkelPY8gaxXeVG83NwjTNVjB4TsbkJIIRLZTWCczRNxGNa5HnlJSEwnA2LD/ 8uf55rfCB7UtoynEHmlZ2buz7i7nfQQtfMT8oaK0mHJgTeIplvnkhmFAkhZT5jSxto0D jJq7txDobLuVMab7dsjQMRjt+pxN84BXkFn19kxiPsx3yDzg72YWlO8rV6jxaHOV+nZr 68w5OMtGmnJnsMHqDDF0D8PP/T9asYSUVUOUfZqJeTgIzHy0uWYxVijBtQbZeIhFH5/2 UzfYaCQjkZh1ESgWYGAuiVWsjMdMTmXkEpE2l+fRnFGjkjma+Quk4vHGs/LRFTccNbYm 7Gaw== X-Gm-Message-State: APt69E0xT2v5alyjJrq6PvCKHL2pGvCVk2LMD2lBQCT0KRVeLOlhm2if mQbnBN4GhyiYG60Kxc0TvGRM3g== X-Received: by 2002:a17:902:b693:: with SMTP id c19-v6mr12412743pls.114.1531294950292; Wed, 11 Jul 2018 00:42:30 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id h2-v6sm24520504pgc.90.2018.07.11.00.42.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 00:42:29 -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 Cc: 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 v11 08/15] arm64: enable KEXEC_FILE config Date: Wed, 11 Jul 2018 16:41:56 +0900 Message-Id: <20180711074203.3019-9-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711074203.3019-1-takahiro.akashi@linaro.org> References: <20180711074203.3019-1-takahiro.akashi@linaro.org> 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.17.0 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 +};