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: 142695 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp6918717ljj; Mon, 23 Jul 2018 23:58:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcc1g0PoXR1vtDCOVGDI0Gyn0YcJcs/1K+sr0Cgpccf2XbGhQfROhFh+8TZ5DRL37o6FSBN X-Received: by 2002:a63:b349:: with SMTP id x9-v6mr15068546pgt.337.1532415509196; Mon, 23 Jul 2018 23:58:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532415509; cv=none; d=google.com; s=arc-20160816; b=bBR3HqqIKD+1re5XLpPY/9OvFob0C1bs0t/yen8v1s3wAhzJ1qksNJ71e8LztdFEtB /Y3agepbtk0kbmXMOGe3vxL+XkPV+m3K2oNXfRzqwU2HvmlKoK9TVW9e26F2cvBMoYr6 Vh4fbGcVNlaAm+YLdy50Fk201Bxl6fDQSYe7WboOvz3mc3kTdd2m2hS1rF6K8YrVaRmU UPzjPM8TOLpYagzqoHgo21o1vsJLmdqrEPiBI6sLuG6DyEs5fULMml0iwRp0Qsvq49hg 1pzoGYcdNrKT4HmgbvZcihRzmgLQljsYWW/rTYnSe2eeHLzFvkaULCZbGnPqiJ+NmU2j 7c0w== 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=KpsdpYdK4Ysd+TV+/RS+nNDg3tlVVRvIVtSFn8+W9VY=; b=hc687RVChPZ0wBjk/jNkomAyj86ju6p9R+Lam/eNZ7PiJcS3zIJSMnWSSAG02e/PYJ aMYAUm4VVa0vA3vz1rlw0krYhYsUbtx0q39mVbd7h6AXJCJUDUQAizLIpjyV8oqb9iVu +46N76GvBTJey6i0nteQQKBa3HOC5W28yUTuUf360MfhI+nXaZ+hcWmHPAHfkBVLCXR/ vhDS/ongpIR/qLtC71YcnlTFpHATxBaFIB+bd4iccndVqvd+On67fKrictBY1SE5vmUJ Rlr9tgC/nLW/OP3hP0k8+P+Z/BXxK1Wnc+pLSxKCQizcW8mWTvDDJbJY6obywLu1n1JB 7DJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C0Z5Isxh; 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 x1-v6si11215656pgx.60.2018.07.23.23.58.28; Mon, 23 Jul 2018 23:58:29 -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=C0Z5Isxh; 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 S2388527AbeGXIDY (ORCPT + 31 others); Tue, 24 Jul 2018 04:03:24 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46715 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388301AbeGXIDY (ORCPT ); Tue, 24 Jul 2018 04:03:24 -0400 Received: by mail-pg1-f193.google.com with SMTP id p23-v6so2176044pgv.13 for ; Mon, 23 Jul 2018 23:58:26 -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=V5i/4V7g8NdZJxfID8lmdKarPE38qwnY/u7P11AHiDKODUxDRy3wn3nwjCzgH3R2cU J3gHY/GRaCtMKOPsG6pyLvzaqUhm2G/Yhc/XQmsqyGXn3EeIIFnVayFIxZQxXDIgEY2J CcMWwpzG/LS14vn6ER+Hwp0SIsvbsjZWU6fMkBwizqfjjHUxVXX+9LQ93DYI1pQkzPjN hPAZLmmxGQhaZ14/XOVhRaY3DwHtikHe+9EVYiDv9dJAqmbeoakcLa6FMc8iQpcISs8D LAzV1yf+gNU0K6AdqEcztGK2NFsTanOG8WOoy/ltZ3mLgMTxNzso9R+LHSTNVK9PE+YK M85Q== X-Gm-Message-State: AOUpUlHeLOQVp86uE1Hlg6OKp3Q0/pS47YiS2CriYqn3rd2cptZ/upuo 66GMM6RciJ5BLOABjmCQGS6sSw== 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 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 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> 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.18.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 +};