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: 10519093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 629DB6028E for ; Wed, 11 Jul 2018 07:59:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5111B289FB for ; Wed, 11 Jul 2018 07:59:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42AEA28A0C; Wed, 11 Jul 2018 07:59:42 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable 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 DF8F5289FB for ; Wed, 11 Jul 2018 07:59:41 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=I1KaZ9L5omKdCJuQuLv2qH4souUx9pYYeUI+K59D7DY=; b=MvQZtjN3PsFGlskIhS91t1yyfn YDTflr9GTB/Iupun1GI4BtuDRDYGkCjKwuDOBEtzH/yr5YPybL4wDyQcNMYJKVhjSslelVxDrVRzA oLfN0znT5aTR7rRvjrsKmK771CMpW741iq7jSKDkMHtADNWwQ9VbmV0o0Gwo63dil4NZlgPj+16M8 tqqCcdc8AanQB2vaDpCU44u4zl75BFcr0/GtlD8V4D/yR/oZVj8AiC4gDKffKXZ2lHGMKX3qQlg3h FBTmBpE8fzFt/skpao7V9IQlyKwuno2j/poeXfU2ktAd0GMoEwMnoiglbMe5DXjeyiVmSIXTshPlS a8GtoVIA==; 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 1fdA2C-0008AM-N5; Wed, 11 Jul 2018 07:59:36 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdA1F-0006Dd-Pa for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Jul 2018 07:58:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m0uS1Rp3rP12XbuAKF03IvNckGWO0+g7J4IbvlkBpFw=; b=E2rt8QysmbIrCeJwYli+qPX7G I+fWGQdAmrFVOZhVpaipItpMM0R6uDJdO28lwvdtnenZBwag0YoGJxxKpkQL71Bil9s3qn28eaef3 cWUv2k1Ebb7y5T3TV7KBjTKdUTCHoCJzOyFYacAbMZhqTvaPXrJ3jfrqCrn0uWxY7GDOnMx5+PiqJ NAmmJod6ck8gVuGnRMqVhpUpguCvDFezGmAVOE76CYKp+ahnsEHYhNY/PVp2H6StloqreKgEdfA0Y 2LS13jwYMxKGNJuXxgJvDL8dSG6yfU2yIXO3MlFEJ8SS8q8Y4mOr4A9RytFeRfbttbKFvoFuD8Kom UoT+Frx/A==; Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd9lp-00058U-QT for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 07:42:45 +0000 Received: by mail-pl0-x244.google.com with SMTP id z9-v6so8796141plo.1 for ; Wed, 11 Jul 2018 00:42:31 -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=rbagQJ6AyvQ23KEKZUC5klmzsc3BiPficLeHbA25eWik793H8nIVZz5s43hXM49yIp 0APKdIOjDh79T3Sj7JYolvDHK3b2feGAX2WnCVGa2AA62Ji2CDTkkG+rG0EDyt14JQM1 tSlNU/wPZUeg42Kzhb1cCbd/nPDix6iqRaTrXcqQZPEYaycKDKN4pSY5/U7HQW8XpPVh OM5+tGrCqIgSIZiymPt7BrWSjF/FcT+IoB0tRI3pa1F1iaUmpuA6Xfmfry1toyN1bmbI E7pOPDeS2sOJbigt52c9di4RencK93dsCmvjBEpxP21iD0zU4NNhdqyGI2jhWdZY9Rv+ +i6g== X-Gm-Message-State: APt69E025GWfPZ9tZ2FSTVpUN78UfBTrM/G7zMwGxUsdLxKt1K3f6GjS ApSlFSsJNNujcdpENQybUigmgQ== X-Google-Smtp-Source: AAOMgpfwck91LI5mOBu2An5AvkRM7LXwFZca6gmb9c1FLYlU20cOsTSdlkh/LOvDWVePggXMgbUITw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_084241_909077_4B802B7A X-CRM114-Status: GOOD ( 17.21 ) 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, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 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 +};