Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-19 Thread H. Peter Anvin
,Chris Metcalf ,"Paul E . McKenney" ,Andrew Morton ,Christopher Li ,Dou Liyang ,Masahiro Yamada ,Daniel Borkmann ,Markus Trippelsdorf ,Peter Foley ,Steven Rostedt ,Tim Chen ,Catalin Marinas ,Matthew Wilcox ,Michal Hocko ,Rob Landley ,Jiri Kosina ,"H . J . Lu" ,Paul Bolle ,Baoquan He ,Dan

Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-19 Thread Ard Biesheuvel
On 19 July 2017 at 23:27, H. Peter Anvin wrote: > On 07/19/17 08:40, Thomas Garnier wrote: >>> >>> This doesn't look right. It's accessing a per-cpu variable. The >>> per-cpu section is an absolute, zero-based section and not subject to >>> relocation. >> >> PIE does not respect the zero-based s

Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-19 Thread H. Peter Anvin
On 07/19/17 08:40, Thomas Garnier wrote: >> >> This doesn't look right. It's accessing a per-cpu variable. The >> per-cpu section is an absolute, zero-based section and not subject to >> relocation. > > PIE does not respect the zero-based section, it tries to have > everything relative. Patch 16

Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-19 Thread Thomas Garnier
On Wed, Jul 19, 2017 at 3:27 PM, H. Peter Anvin wrote: > On 07/19/17 08:40, Thomas Garnier wrote: >>> >>> This doesn't look right. It's accessing a per-cpu variable. The >>> per-cpu section is an absolute, zero-based section and not subject to >>> relocation. >> >> PIE does not respect the zero-

Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-19 Thread Thomas Garnier
On Tue, Jul 18, 2017 at 7:49 PM, Brian Gerst wrote: > On Tue, Jul 18, 2017 at 6:33 PM, Thomas Garnier wrote: >> Change the assembly code to use only relative references of symbols for the >> kernel to be PIE compatible. The new __ASM_GET_PTR_PRE macro is used to >> get the address of a symbol on

Re: [Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-18 Thread Brian Gerst
On Tue, Jul 18, 2017 at 6:33 PM, Thomas Garnier wrote: > Change the assembly code to use only relative references of symbols for the > kernel to be PIE compatible. The new __ASM_GET_PTR_PRE macro is used to > get the address of a symbol on both 32 and 64-bit with PIE support. > > Position Independ

[Xen-devel] [RFC 06/22] kvm: Adapt assembly for PIE support

2017-07-18 Thread Thomas Garnier
Change the assembly code to use only relative references of symbols for the kernel to be PIE compatible. The new __ASM_GET_PTR_PRE macro is used to get the address of a symbol on both 32 and 64-bit with PIE support. Position Independent Executable (PIE) support will allow to extended the KASLR ran