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: 151171 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp6594131ljp; Wed, 14 Nov 2018 21:53:20 -0800 (PST) X-Google-Smtp-Source: AJdET5cuVTODJ702RUS2aE4+bGsPnmstaIdsx58qywKhJ8OfM1Jc9nrmFTWU8LxLvXP+l1Ckt/B/ X-Received: by 2002:a63:42c1:: with SMTP id p184mr4545838pga.202.1542261200444; Wed, 14 Nov 2018 21:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542261200; cv=none; d=google.com; s=arc-20160816; b=iCykfWh+WULgtARBdWDhmyVjuqVcNyqthXPITI+dc8MQhVhizpRhRNwl+rluBwIeat 4gYNH7k50ThD+MjBGVspUkA/vwCb01qy/yvPJGl5B4Gld01m289JTCoyuHgrB6N1PlEY bDHSEFPZxwSg3gkh3e/8jG0uFvUw6AmRSaMQ/G6k+sNuQpny3UPquzhGlJhUwyWM+INe EDScgDDe+IheQcJnjt/GcCCM+vwnW/X5lcZZ1LlBJMemtZF/EmTkoFeaEVhLNHDfKogM N8NwAX88jyaCYCVw6GO3rr7wJZQlkDHmmwD161GauSzGAz5oroxuo2fb+ekXLd371FMP UTaQ== 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=v/2g1t2ZiuSybJx6NO3mxBVk7FXFeZVpACxhmjpzZl4=; b=lbx+ZOek5NuOk2A77acfzXxSC71X6cijiAqkatblx1pe0P8MthVYrDa44paCI/5Vhp 5+8jABKO2nytjs4CvlpxyAa8j7afJ+NI0OOx8lbvejQhhWa1NgTOKESGTJUjVZqPuCvs vXY6habMar7ZL1U8osfGCLC2wShjenjaT3XHVikhoqU2eA6DiJ6/vuL1enmvUdVH9roL Qmt6bDviGBEtslfV53Rx5omwjbII5NzKFCntm2B7xMBk8Ju+WWb9rJRmu+MpSSNPgvy2 wSpbeATL+lZsoeWprE9hGbvt6T/j22cI/5q3EDR3aKFd0moHCXU4vOPLlET3fh/urlnU c6/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRM172Hv; 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 p5si6607505pga.352.2018.11.14.21.53.20; Wed, 14 Nov 2018 21:53:20 -0800 (PST) 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=WRM172Hv; 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 S1728946AbeKOP7o (ORCPT + 32 others); Thu, 15 Nov 2018 10:59:44 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:35971 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726943AbeKOP7n (ORCPT ); Thu, 15 Nov 2018 10:59:43 -0500 Received: by mail-yb1-f194.google.com with SMTP id g192-v6so7930726ybf.3 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=R4EEZuY/upUA2pXLL/aNRIt4kVqkYZ1OecgrkuZapUhNJ0WfsK3m7fLNYM6eaZqIPg Lz/RA1SKCHllxWAAzBJh2LOgJB5rhOpyaQEalYlQVfuvTRsk181oBMnd5thbmb6Hzz9a RQavXdRtItvKTgSXaOY7xhzwdbmDuyCuOtbteHAVjnFiGG9EfX/gXYiNBPIl5nCXj6Vr 4ZGUDarl/Ug2riot3Ufuj6vjMc8MSnRgQ97r0TMj0FawGNUgGsvOtg+0n+UKlu3yeQxw iVsPpo6dMVOXN6M3x9dDDY1VPWVcqLTZE++1ZN1p2XwbBXlRBDqxb8RGwMXX+bTu5ODb 19GQ== X-Gm-Message-State: AGRZ1gLIjH5rkjrzJ6tNsd89edyQkDq/aFtgf05YB4HkM0Fyxj/PlISG XA/YIE0KOJAbH1SJECwzuZHBtA== 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 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 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 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 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 +};