From patchwork Tue Feb 27 04:48:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 129732 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp972438lja; Mon, 26 Feb 2018 20:48:35 -0800 (PST) X-Google-Smtp-Source: AH8x226IfaPe1AxUt+WDvvqOwVn/XK7G7EkNtiKM+km4BCRUJ41Jq4MQqDxZLrVqJc+Clj0KZ3q3 X-Received: by 10.99.171.70 with SMTP id k6mr10567102pgp.355.1519706915181; Mon, 26 Feb 2018 20:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519706915; cv=none; d=google.com; s=arc-20160816; b=Ku88zKXsx8q0eXKC4c+KWJksUB0VNvR3a50gMZ5WvzcgJtChnIGZ1kHQX8ZJFz5ydJ Q+ZREKlhczS9B5+zfHqaOAWG+a6uPqku80bE1958UYsswo6Vcv0xdSosCag5g0N8U9HH 2ch07k6C5p5N7L0afTKb29U4LIuU/V09H6oHePQiKYrW6S/jmCgrn9o9Rp/Nh+onuG+j Rb56H9u/bzkMRiVOTmEPSTWVmgrf0zmXnGSRUduw6oL6MNlBYtpKg2toCQbFQKa4glfw UpwWuTnFITE56o1oGAVVfQibzKnnomu2uxfVvqbpmLRt5sKaSz95aNiDTFEj52sN3Rjc yiwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=W9+hVVkDuVR4fEHwdM/ELfjEBSXWSZO0bisT/O/SVI4=; b=xcCh31oLnsoOCK2Qmkgf8Cph23m3TrziVDuGTPkq4hhTyE7/giGgd+6pkzG/mOiEI6 r8pJbXtQmymWcqz5Pa20PcSUe4JfFuTVWWhseLC3TbknUODHo95x2tPqXuGD/LcrF9pQ 3ShiUZNn8cFKkzPlq3F+jBmlUUmIeRh8OqyqA9l2VQ2GX+EVWAJ1qRsArCcbZSoCUi5n f1PHLhX19Np5AiMkmsESV+3NciUkfO6DurXsLkcrOtzIE88WSavrqY+rnz+pVYJ3M5lT kf08mhxWzj3g6wtuaX1zhQVFA1ntXQ7PjWxYzxKnRA4lAaNbxZ1eSDiKHE68miS1qZDD acoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eZToXM/O; 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 68-v6si7884696pla.767.2018.02.26.20.48.34; Mon, 26 Feb 2018 20:48:35 -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=eZToXM/O; 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 S1751952AbeB0Esb (ORCPT + 28 others); Mon, 26 Feb 2018 23:48:31 -0500 Received: from mail-pg0-f65.google.com ([74.125.83.65]:43352 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751668AbeB0Es3 (ORCPT ); Mon, 26 Feb 2018 23:48:29 -0500 Received: by mail-pg0-f65.google.com with SMTP id e9so2773283pgs.10 for ; Mon, 26 Feb 2018 20:48:29 -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; bh=W9+hVVkDuVR4fEHwdM/ELfjEBSXWSZO0bisT/O/SVI4=; b=eZToXM/O/VFuyXhEcqB7S0meuXUrIBQ7RrP7Epmt38Gif9eYYAtfyBYXeHI1KtKNuc w4F7NmDUEXIBdWkmnk+wh3sNFp0sHts4R4XPT8IoK8aQ732sOqZZ1oQN/PKxDtyzczUK T2GCL//LIfzbqLncLYAkWpE7zTMnnTGTxy+EQ= 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; bh=W9+hVVkDuVR4fEHwdM/ELfjEBSXWSZO0bisT/O/SVI4=; b=PikRlLK2ledg6fKPvYuEFJcGZQcDKpTGIrC9RxbaIU52Jk/04Ws60EHkp3dENV6Uy6 TGpJNdHV1+KeyO/d0I6y+EzlCx1ExYQC/MRJb4N201IzR6sacv+myTRRWJ1njAR3xmyo Os0VfFfx/m4zt3scx/5my71dNPfsRnAVDbyRb6II99QTYxPtoPNACjt+Ilr2mdb83qpK fFx1CNFra2/MsCZL7CHMkL0i+hS8D6ZT3x9aSorNcUo/ZFnrtbFpAuUxQf0wABn9ETyW f7UxgMOHwbHQXi4yk/6STbQVbHX55wHoGzgvP2zDx7VDSWrpzrk9xaLUbAzBHHOP/yia SCtw== X-Gm-Message-State: APf1xPDZddycr5qJtQOr5Sq3sBIgEf/ej3sPQCD/43bNxQSI/WZM2JAi zUCi/bhFyTIGhO6xaLoa1Wi6Xw== X-Received: by 10.101.80.193 with SMTP id s1mr10250977pgp.254.1519706909229; Mon, 26 Feb 2018 20:48:29 -0800 (PST) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id n79sm22398692pfa.55.2018.02.26.20.48.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Feb 2018 20:48:28 -0800 (PST) From: AKASHI Takahiro To: dyoung@redhat.com, vgoyal@redhat.com, bhe@redhat.com, mpe@ellerman.id.au, bauerman@linux.vnet.ibm.com, prudo@linux.vnet.ibm.com Cc: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, AKASHI Takahiro Subject: [PATCH 0/7] kexec_file: refactoring for other architecutres Date: Tue, 27 Feb 2018 13:48:07 +0900 Message-Id: <20180227044814.24808-1-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org subject: This is a preparatory patch set for adding kexec_file support on arm64. It was originally included in a arm64 patch set[1], but Philipp is also working on their kexec_file support on s390[2] and some changes are now conflicting. So these common part was extracted and put into a separate patch set for better integration. What's more, my original patch#4 was split into a few small chunks for easier review after Dave's comment. As such, the resulting code is basically identical with my original, and the only difference is that kexec_file_loaders[] is now declared in kexec.h after Phillipp's comment[3]. Other than that, this patch set doesn't require any changes on the rest of my original patch set(#1, #6 to #13). Patch#1 allows making a use of purgatory optional, particularly useful for arm64. Patch#2 commonalizes arch_kexec_kernel_{image_probe, image_load, verify_sig}() and arch_kimage_file_post_load_cleanup() across architectures. Patch#3-#7 is also intended to generalize parse_elf64_headers(), along with exclude_mem_range(), to be made best re-use of. [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/561182.html [2] http://lkml.iu.edu//hypermail/linux/kernel/1802.1/02596.html [3] http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/562041.html AKASHI Takahiro (7): kexec_file: make an use of purgatory optional kexec_file,x86,powerpc: factor out kexec_file_ops functions x86: kexec_file: purge system-ram walking from prepare_elf64_headers() x86: kexec_file: remove X86_64 dependency from prepare_elf64_headers() x86: kexec_file: lift CRASH_MAX_RANGES limit on crash_mem buffer x86: kexec_file: clean up prepare_elf64_headers() kexec_file, x86: move re-factored code to generic side arch/powerpc/Kconfig | 3 + arch/powerpc/include/asm/kexec.h | 2 +- arch/powerpc/kernel/kexec_elf_64.c | 2 +- arch/powerpc/kernel/machine_kexec_file_64.c | 39 +--- arch/x86/Kconfig | 3 + arch/x86/include/asm/kexec-bzimage64.h | 2 +- arch/x86/kernel/crash.c | 332 +++++----------------------- arch/x86/kernel/kexec-bzimage64.c | 2 +- arch/x86/kernel/machine_kexec_64.c | 45 +--- include/linux/kexec.h | 36 ++- kernel/kexec_file.c | 236 +++++++++++++++++++- 11 files changed, 336 insertions(+), 366 deletions(-) -- 2.16.2