From: Thomas Garnier Subject: [RFC 12/22] x86/boot/64: Adapt assembly for PIE support Date: Tue, 18 Jul 2017 15:33:23 -0700 Message-ID: <20170718223333.110371-13-thgarnie@google.com> References: <20170718223333.110371-1-thgarnie@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Cc: linux-arch@vger.kernel.org, kvm@vger.kernel.org, linux-pm@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org, linux-crypto@vger.kernel.org, kernel-hardening@lists.openwall.com, xen-devel@lists.xenproject.org To: Herbert Xu , "David S . Miller" , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Peter Zijlstra , Josh Poimboeuf , Thomas Garnier , Arnd Bergmann , Matthias Kaehlcke , Boris Ostrovsky , Juergen Gross , Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Joerg Roedel , Andy Lutomirski , Borislav Petkov , "Kirill A . Shutemov" , Brian Gerst , Borislav Petkov , Christian Borntraeger , "Rafael J . Wysocki" , Len Brown In-Reply-To: <20170718223333.110371-1-thgarnie@google.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" List-Id: linux-crypto.vger.kernel.org Q2hhbmdlIHRoZSBhc3NlbWJseSBjb2RlIHRvIHVzZSBvbmx5IHJlbGF0aXZlIHJlZmVyZW5jZXMg b2Ygc3ltYm9scyBmb3IgdGhlCmtlcm5lbCB0byBiZSBQSUUgY29tcGF0aWJsZS4KCkVhcmx5IGF0 IGJvb3QsIHRoZSBrZXJuZWwgaXMgbWFwcGVkIGF0IGEgdGVtcG9yYXJ5IGFkZHJlc3Mgd2hpbGUg cHJlcGFyaW5nCnRoZSBwYWdlIHRhYmxlLiBUbyBrbm93IHRoZSBjaGFuZ2VzIG5lZWRlZCBmb3Ig dGhlIHBhZ2UgdGFibGUgd2l0aCBLQVNMUiwKdGh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