Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp777ybg; Fri, 25 Oct 2019 15:31:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaKD9d7SeW1kgbdlM2TxWTlqafEWD6s1cvkAWPk4NJMBoOL7PmiATy5+tb8s/REVE6re+I X-Received: by 2002:a50:8b26:: with SMTP id l35mr6561078edl.220.1572042701506; Fri, 25 Oct 2019 15:31:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572042701; cv=none; d=google.com; s=arc-20160816; b=rtcBov0jmhrRkGvwM27fd/7WKxE/Ac8H6RA+2urwW0q4aUeBhfN5NNuxy88ZGzCv6s b1n/u8wpuPCQhW3JGisUlNM7IHy7+qV2z3CIEE4hpobCsVRSkCNVKIGcWBsEsvqaiYtX Z8vFkkDo7ZNGoat6Ivy9nvwa6qC7KsG8a2rwUDjBzjOkIW2gpuIYwgMUnfS/s8BxiDZ9 lKUkorRvWEpWYoVbmTHPDylQLWKroZaswdX1DP9CKaBmKqUjV+vNm1QRo92gVbQ447VI yOSBIC/2XLLzCe3s/cHUly90iDXqYCqkyiTHF7h43OsCm3775eZ3bf7wTmqhGNwMvnW0 yQ3w== 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=kZdCRjYQZ84QFMbCHFmncYdcuMzKhHm/pmhnBMk2XLM=; b=z1tfcIAT1t34ACbKqi9XOqbmeus8l7U//8OmgKP1Q+mw8KtvvrHd/Sgm1D+vqPJSGF DgwXZFx4VJxSd42MIC9GyKQJackpErxYPMn+9N//AIV8KJ/PtUJInFIhAdcVx821a05R 3wGyhd7x+6BZwb+9uDM5nKNxAtpF6b0CkXZYFnE0TrbqRUfPrlwUKXxTlz1p3IUwAdSU HOVy1cDEZquWIp/P1LWKxcon4lPJK9ajE7ihSutY18Myk/mcJHFKoWD+sPqKuBBG3iD9 u0EMCczzfwUDJ3GMqvn4gHAhx0+qWyGonsc/EgAK//qBwm976gvxkbxLq32NsGyGNkzK LbyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=femDesdz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si2866906edi.349.2019.10.25.15.31.17; Fri, 25 Oct 2019 15:31:40 -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=@ellerman.id.au header.s=201909 header.b=femDesdz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2410111AbfJYLDz (ORCPT + 99 others); Fri, 25 Oct 2019 07:03:55 -0400 Received: from bilbo.ozlabs.org ([203.11.71.1]:33265 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407262AbfJYLDz (ORCPT ); Fri, 25 Oct 2019 07:03:55 -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 4701Sm2xxqz9sPK; Fri, 25 Oct 2019 22:03:52 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1572001432; bh=zR2+Wwbibdf/2nUQuITloJZKmPyWJx1+odpdcK+KecM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=femDesdzuQMKmpeQquHw9TYWi2ahr/MEHHgZP72991U55pcEPgkOtaw7UktH8gHSH t8mxNFAm01wWMBTHub3OozAc2CiVlBYzz7RBav3esumybZNTyXi35rORWAL+aR7OwD Lc9ZaoKGGRAds/fPXStuUdq5HyP78jR4ZEA2NdFwVA9LczvXt0Kk5P4NykZquk8lOf /GNTHjPRYJi61LSBo2e7nDfFjWpVwSexgkjbJUPAiNt1F/v1BqAM1m1fyAwpZyPY8M 7dbC0jyQ0TlLa9qKy3C9J1rUfAVV9VzS5QC5GjfZn92quJPJ3Fii8c1tMU8vbveF7q 7ggeAwqpuQOxA== From: Michael Ellerman To: Thiago Jung Bauermann , linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Mike Anderson , Paul Mackerras , Ram Pai , Thiago Jung Bauermann Subject: Re: [PATCH] powerpc/prom_init: Undo relocation before entering secure mode In-Reply-To: <20190911163433.12822-1-bauerman@linux.ibm.com> References: <20190911163433.12822-1-bauerman@linux.ibm.com> Date: Fri, 25 Oct 2019 22:03:51 +1100 Message-ID: <87o8y5dr3c.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 Thiago Jung Bauermann writes: > The ultravisor will do an integrity check of the kernel image but we > relocated it so the check will fail. Restore the original image by > relocating it back to the kernel virtual base address. > > This works because during build vmlinux is linked with an expected virtual > runtime address of KERNELBASE. > > Fixes: 6a9c930bd775 ("powerpc/prom_init: Add the ESM call to prom_init") > Signed-off-by: Thiago Jung Bauermann > --- > arch/powerpc/include/asm/elf.h | 3 +++ > arch/powerpc/kernel/prom_init.c | 11 +++++++++++ > arch/powerpc/kernel/prom_init_check.sh | 3 ++- > 3 files changed, 16 insertions(+), 1 deletion(-) This breaks the build when CONFIG_RELOCATABLE=n: prom_init.c:(.init.text+0x3160): undefined reference to `relocate' See http://kisskb.ellerman.id.au/kisskb/buildresult/14004234/ cheers