Received: by 10.223.185.116 with SMTP id b49csp2000381wrg; Mon, 12 Feb 2018 02:33:06 -0800 (PST) X-Google-Smtp-Source: AH8x2262i/4zeYZniMZen9ezCDemseIHzKvSACjsiVNTA63+TKCWc/3yhsmCiFNETq3SyEPGMCAD X-Received: by 10.101.74.132 with SMTP id b4mr9257976pgu.355.1518431586238; Mon, 12 Feb 2018 02:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518431586; cv=none; d=google.com; s=arc-20160816; b=a86BQQGWNlvfk3mbnrwjuuicasgjMCihtce4IO5Z/nAhGkUgIdttUNgcKtEqYAt9b+ aMtv5PVfzlf7gtW+56p/UgieD+BZOUucdTvKO7hIW0pF4UIvmc8jiBUNY/MmjVd5oHee zG5kzMtPpqziPRLAmpPS9jZsZeHB8hCPBOVpHUNa7bNBL7/LwHX9zZeFejDfrUFo4wl6 +esxbovF34kGG7mD/i/Y/m2ZKQyg8UhEysVssKRIO0tG8Ngb4+CHI3NEiLKsSadbqd/K 9T87LQ0LkvsY0Cqdgq05iPJ3gOrzsi+f1XwFmPhK/EoVjzTJMQ/Wxkvcazt1ETstZoc7 l8aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from:arc-authentication-results; bh=IXlOGB0Le2Wmrjr9wz7Rqio7GAW+u5QKbbABp8tu0Ic=; b=LX5K0O5V3R36GjIx0Mbm6JKWmz/JurcuRjH9Pvehs4T6J8zPeVaqwxTz6bkEp/x+wM 7giDWKkZEdo4LLaIMzapFluZfZOo3OEcOB95Hi+sB2GK4g8C8tJ/UZ3DQtoIPY7TmvD0 Vtm4/fDFExoMpahNSH79Uk1SzUhHLihfvi3dJQcJJZm+0Bma756WJtenJ9Et6Nw8sqD/ Oh7G3DGn530foShPgqTGuFZlZ46R4rRck9TkPx5NgI37bQl0n2wI68MZc5IFmkPFjm0q uiinJAoVKz461w/0wrYi4MTS2dhIg7Ag8tBAICl2N+QVkpn1ub3WOWW396mtJEF3wDqQ bapw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si5004797pgn.782.2018.02.12.02.32.51; Mon, 12 Feb 2018 02:33:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933068AbeBLKIE (ORCPT + 99 others); Mon, 12 Feb 2018 05:08:04 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43204 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932558AbeBLKIB (ORCPT ); Mon, 12 Feb 2018 05:08:01 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1CA4BHh088166 for ; Mon, 12 Feb 2018 05:08:01 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 2g377am34c-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 12 Feb 2018 05:08:00 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 12 Feb 2018 10:07:58 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 12 Feb 2018 10:07:55 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1CA7s5355705618; Mon, 12 Feb 2018 10:07:54 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A8BDCAE056; Mon, 12 Feb 2018 09:59:00 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 53333AE045; Mon, 12 Feb 2018 09:59:00 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 12 Feb 2018 09:59:00 +0000 (GMT) From: Philipp Rudo To: kexec@lists.infradead.org, linux-s390@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Eric Biederman , Vivek Goyal , Michael Ellerman , Thiago Jung Bauermann , Martin Schwidefsky , Heiko Carstens , Andrew Morton , x86@kernel.org Subject: [PATCH 00/17] Add kexec_file_load support to s390 Date: Mon, 12 Feb 2018 11:07:37 +0100 X-Mailer: git-send-email 2.13.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18021210-0008-0000-0000-000004CBD609 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18021210-0009-0000-0000-00001E5F927A Message-Id: <20180212100754.55121-1-prudo@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-12_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802120131 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everybody resending the series as there was no reaction, yet. Furthermore i was told that Andrew and the x86 list should also be CCed, so welcome. No changes made to the patches since first time i sent them. The patches apply to the current master (v4.16-rc1). Thanks Philipp --- this series adds the kexec_file_load system call to s390. Before the system call is added there are some preparations/clean ups to common kexec_file_load. In detail this series contains: Patch #1&2: Minor cleanups/fixes. Patch #3-9: Clean up the purgatory load/relocation code. Especially remove the mis-use of the purgatory_info->sechdrs->sh_offset field, currently holding a pointer into either kexec_purgatory (ro) or purgatory_buf (rw) depending on the section. With these patches the section address will be calculated verbosely and sh_offset will contain the offset of the section in the stripped purgatory binary (purgatory_buf). Patch #10: Allows architectures to set the purgaory load address. This patch is important for s390 as the kernel and purgatory have to be loaded to fixed addresses. In current code this is impossible as the purgatory load is opaque to the architecture. Patch #11: Moves x86 purgatories sha implementation to common lib/ directory. Patches #12-17 finally adds the kexec_file_load system call to s390. Please note that I had to touch arch code for x86 and power a little. In theory this should not change the behavior but I don't have a way to test it. Cross-compiling with defconfig(*) works fine for both. Thanks Philipp (*) On x86 with the orc unwinder turned off. objtool SEGFAULTs on s390... Philipp Rudo (17): kexec_file: Silence compile warnings kexec_file: Remove checks in kexec_purgatory_load kexec_file: Make purgatory_info->ehdr const kexec_file: Search symbols in read-only kexec_purgatory kexec_file: Use read-only sections in arch_kexec_apply_relocations* kexec_file: Split up __kexec_load_puragory kexec_file: Simplify kexec_purgatory_setup_sechdrs 1 kexec_file: Simplify kexec_purgatory_setup_sechdrs 2 kexec_file: Remove mis-use of sh_offset field kexec_file: Allow archs to set purgatory load address kexec_file: Move purgatories sha256 to common code s390/kexec_file: Prepare setup.h for kexec_file_load s390/kexec_file: Add purgatory s390/kexec_file: Add kexec_file_load system call s390/kexec_file: Add image loader s390/kexec_file: Add crash support to image loader s390/kexec_file: Add ELF loader arch/powerpc/kernel/kexec_elf_64.c | 9 +- arch/s390/Kbuild | 1 + arch/s390/Kconfig | 4 + arch/s390/include/asm/kexec.h | 23 ++ arch/s390/include/asm/purgatory.h | 17 ++ arch/s390/include/asm/setup.h | 40 ++- arch/s390/kernel/Makefile | 1 + arch/s390/kernel/asm-offsets.c | 5 + arch/s390/kernel/compat_wrapper.c | 1 + arch/s390/kernel/kexec_elf.c | 149 ++++++++++ arch/s390/kernel/kexec_image.c | 78 +++++ arch/s390/kernel/machine_kexec_file.c | 291 +++++++++++++++++++ arch/s390/kernel/syscalls/syscall.tbl | 1 + arch/s390/purgatory/Makefile | 37 +++ arch/s390/purgatory/head.S | 279 ++++++++++++++++++ arch/s390/purgatory/purgatory.c | 42 +++ arch/x86/kernel/kexec-bzimage64.c | 8 +- arch/x86/kernel/machine_kexec_64.c | 66 ++--- arch/x86/purgatory/Makefile | 3 + arch/x86/purgatory/purgatory.c | 2 +- include/linux/kexec.h | 38 +-- {arch/x86/purgatory => include/linux}/sha256.h | 10 +- kernel/kexec_file.c | 375 ++++++++++++------------- {arch/x86/purgatory => lib}/sha256.c | 4 +- 24 files changed, 1200 insertions(+), 284 deletions(-) create mode 100644 arch/s390/include/asm/purgatory.h create mode 100644 arch/s390/kernel/kexec_elf.c create mode 100644 arch/s390/kernel/kexec_image.c create mode 100644 arch/s390/kernel/machine_kexec_file.c create mode 100644 arch/s390/purgatory/Makefile create mode 100644 arch/s390/purgatory/head.S create mode 100644 arch/s390/purgatory/purgatory.c rename {arch/x86/purgatory => include/linux}/sha256.h (63%) rename {arch/x86/purgatory => lib}/sha256.c (99%) -- 2.13.5