From: Pavel Machek Subject: Re: [PATCH v3 11/27] x86/power/64: Adapt assembly for PIE support Date: Thu, 24 May 2018 13:03:41 +0200 Message-ID: <20180524110341.GB20225@amd> References: <20180523195421.180248-1-thgarnie@google.com> <20180523195421.180248-12-thgarnie@google.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KFztAG8eRSV9hGtP" Cc: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Greg Kroah-Hartman , Philippe Ombredanne , Kate Stewart , Arnaldo Carvalho de Melo , Yonghong Song , Andrey Ryabinin , Kees Cook , Tom Lendacky , "Kirill A . Shutemov" , Andy Lutomirski , Dominik Brodowski , Borislav Petkov , Borislav Petkov , "Rafael J . Wysocki" , Len Brown , Juerge To: Thomas Garnier Return-path: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Content-Disposition: inline In-Reply-To: <20180523195421.180248-12-thgarnie@google.com> List-Id: linux-crypto.vger.kernel.org --KFztAG8eRSV9hGtP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed 2018-05-23 12:54:05, Thomas Garnier wrote: > Change the assembly code to use only relative references of symbols for t= he > kernel to be PIE compatible. >=20 > Position Independent Executable (PIE) support will allow to extended the > KASLR randomization range below the -2G memory limit. >=20 > Signed-off-by: Thomas Garnier Again, was this tested? > diff --git a/arch/x86/power/hibernate_asm_64.S b/arch/x86/power/hibernate= _asm_64.S > index ce8da3a0412c..6fdd7bbc3c33 100644 > --- a/arch/x86/power/hibernate_asm_64.S > +++ b/arch/x86/power/hibernate_asm_64.S > @@ -24,7 +24,7 @@ > #include > =20 > ENTRY(swsusp_arch_suspend) > - movq $saved_context, %rax > + leaq saved_context(%rip), %rax > movq %rsp, pt_regs_sp(%rax) > movq %rbp, pt_regs_bp(%rax) > movq %rsi, pt_regs_si(%rax) > @@ -115,7 +115,7 @@ ENTRY(restore_registers) > movq %rax, %cr4; # turn PGE back on > =20 > /* We don't restore %rax, it must be 0 anyway */ > - movq $saved_context, %rax > + leaq saved_context(%rip), %rax > movq pt_regs_sp(%rax), %rsp > movq pt_regs_bp(%rax), %rbp > movq pt_regs_si(%rax), %rsi --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --KFztAG8eRSV9hGtP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlsGnA0ACgkQMOfwapXb+vK3PwCgjIuOx9YZTN3evFcQKm9c41TU Q4sAoLZgV0pIcRgoHsgk/ecLa/CLhuIR =YTGF -----END PGP SIGNATURE----- --KFztAG8eRSV9hGtP--