Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp209750ybh; Tue, 21 Jul 2020 21:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQaG1As4ADagf85zGuzAh6/oqjdeGgYwyOevMq7veOtK7jZX2RLYj/OeQOTIXLZwG2anOR X-Received: by 2002:a50:afa2:: with SMTP id h31mr29217371edd.303.1595391960338; Tue, 21 Jul 2020 21:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595391960; cv=none; d=google.com; s=arc-20160816; b=OFzORisnkLel8DzHS1bXyIglq4nFytzOe6BgbW81rK1vroutdSkFbh109qtLafHack wrt3F6VrF5R5CAaISd8b7wvTCGz2F8NNqgaa39nV3GPw0PkacBOfbVq7luVvK5lSzeMu jTj9xs9L6W0gUpIbGed0T+pqW4BT86Ahkj3GAuttE0vn1hUCdSVie7/FhvsQaZp3jcmT GYA/GmxKIds+Bjhp6r2UZsFLG3xnZbx2v6SyOo/jfCk3u+Gldg6Ve++khf0LHqxy8fkh Q9hKL/kXxM8GUPVas8tMHuRWY4hlz4m5WaIhPRIEafKwIotyN02kf6PmPDfSKViMCSV8 +ohg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=MAUyrNAXvNPZV+Pej/qLRCvER52OFZm9x/iIxCMoP8A=; b=jCVDhRcVXu+SD2UzQyp1O52EzmWHBei7H0H4Ly2vSk+CCD+L38DjW8IVmB5jv8rQA0 9k2rwEIrEUf9JhW46+Mm/5lCdFsHbzNuhuxs48IQrpw+g/hqMlifVYYv6J112iXWMvTw +tpFV3pIpkABcI9JWIawG1Mqo/CDa3D6iTuXyyRExFtRAD7U8EVT7IGzTMO1js+zXE5j jvw/MraqcfMfiCUL2Q35VXYfQYGlexIv9ErGRc22QiCkt+gryBLJ45PaI4lmXeGFA4jk Fk/YSe+7yHy6k2wzyX0o+u5iitRIkOKrKlZ8sRvla226DRdyr+h/+TByrhz4lYZTyzLc /6LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ipgyBIiz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc22si14976760ejb.317.2020.07.21.21.25.36; Tue, 21 Jul 2020 21:26:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=ipgyBIiz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726253AbgGVEZ1 (ORCPT + 99 others); Wed, 22 Jul 2020 00:25:27 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:33067 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725843AbgGVEZ1 (ORCPT ); Wed, 22 Jul 2020 00:25:27 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4BBMnt5ZW1z9sPB; Wed, 22 Jul 2020 14:25:22 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1595391924; bh=qAm3Ccutxcy1GjzClSJFUEMJeVzNgrnTzX0RTNep1/A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=ipgyBIiz2TASWCM4uo7asEhhIi+fSNmSYJ948zzcfbHg//f6/OvKe3lTWHL4vAqB7 eU208+WBeoL/Rq6bM3v6p/srh985sEwTM9j+7HTV2BI7a2ZYRgzcYwWPDnFcbrf8yM AHbofXD/M16u4tiCm+BMYJ4JGsRHJA2b5HYr54JeoLaucp3063seyP54aHYPLna/rX Oi6W24NzBNZJFW9daEF7bJbs3Kpb7gojdK0bfUvEWCqsYsN2AxeEFM9N3g6OYc/tk+ Cri/cBoXAFMAjyVNIUBmM1SG9T6OTEbAxzlNOXhYNxIGP4rR+XyZJQWduu5U7rs2nw 8aMRDscSBsngA== From: Michael Ellerman To: Hari Bathini , Andrew Morton Cc: kernel test robot , Pingfan Liu , Kexec-ml , Mimi Zohar , Nayna Jain , Petr Tesarik , Mahesh J Salgaonkar , Sourabh Jain , lkml , linuxppc-dev , Eric Biederman , Thiago Jung Bauermann , Dave Young , Vivek Goyal Subject: Re: [PATCH v4 07/12] ppc64/kexec_file: add support to relocate purgatory In-Reply-To: <159524956457.20855.12480643681198700190.stgit@hbathini.in.ibm.com> References: <159524918900.20855.17709718993097359220.stgit@hbathini.in.ibm.com> <159524956457.20855.12480643681198700190.stgit@hbathini.in.ibm.com> Date: Wed, 22 Jul 2020 14:25:19 +1000 Message-ID: <871rl4rxao.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hari Bathini writes: > Right now purgatory implementation is only minimal. But if purgatory > code is to be enhanced to copy memory to the backup region and verify > sha256 digest, relocations may have to be applied to the purgatory. > So, add support to relocate purgatory in kexec_file_load system call > by setting up TOC pointer and applying RELA relocations as needed. > > Reported-by: kernel test robot > [lkp: In v1, 'struct mem_sym' was declared in parameter list] > Signed-off-by: Hari Bathini > --- > > * Michael, can you share your opinion on the below: > - https://lore.kernel.org/patchwork/patch/1272027/ > - My intention in cover note. It seems like a lot of complexity for little benefit. AFAICS your final purgatory_64.c is only 36 lines, and all it does is a single (open coded) memcpy(). It seems like we could write that in not many more lines of assembler and avoid all this code. What am I missing? cheers