Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-11 Thread David Woodhouse
On Thu, 2018-01-11 at 13:41 +, Andrew Cooper wrote: > On 11/01/18 13:03, David Woodhouse wrote: > > > > On Thu, 2018-01-04 at 00:15 +, Andrew Cooper wrote: > > > > > > + * We've got no usable stack so can't use a RETPOLINE thunk, and > > > are > > > + * further than +-

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-11 Thread Andrew Cooper
On 11/01/18 13:03, David Woodhouse wrote: > On Thu, 2018-01-04 at 00:15 +, Andrew Cooper wrote: >> + * We've got no usable stack so can't use a RETPOLINE thunk, and are >> + * further than +- 2G from the high mappings so couldn't use >> JUMP_THUNK >> + * even if was a

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-11 Thread David Woodhouse
On Thu, 2018-01-04 at 00:15 +, Andrew Cooper wrote: > + * We've got no usable stack so can't use a RETPOLINE thunk, and are > + * further than +- 2G from the high mappings so couldn't use > JUMP_THUNK > + * even if was a non-RETPOLINE thunk.  Futhermore, an LFENCE

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-09 Thread Jan Beulich
>>> On 09.01.18 at 12:23, wrote: > On 09/01/18 08:36, Jan Beulich wrote: > static io_emul_stub_t *io_emul_stub_setup(struct priv_op_ctxt *ctxt, u8 > opcode, >unsigned int port, unsigned > int > bytes) > {

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-09 Thread Andrew Cooper
On 09/01/18 08:36, Jan Beulich wrote: static io_emul_stub_t *io_emul_stub_setup(struct priv_op_ctxt *ctxt, u8 opcode, unsigned int port, unsigned int bytes) { +struct stubs *this_stubs = _cpu(stubs); +

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-09 Thread Jan Beulich
>>> On 08.01.18 at 19:24, wrote: > On 04/01/18 09:23, Jan Beulich wrote: > On 04.01.18 at 01:15, wrote: >>> --- a/xen/arch/x86/pv/emul-priv-op.c >>> +++ b/xen/arch/x86/pv/emul-priv-op.c >>> @@ -73,37 +73,58 @@ void

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-08 Thread Andrew Cooper
On 04/01/18 09:23, Jan Beulich wrote: On 04.01.18 at 01:15, wrote: >> --- a/xen/arch/x86/boot/trampoline.S >> +++ b/xen/arch/x86/boot/trampoline.S >> @@ -153,8 +153,28 @@ trampoline_protmode_entry: >> .code64 >> start64: >> /* Jump to high

Re: [Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-04 Thread Jan Beulich
>>> On 04.01.18 at 01:15, wrote: > --- a/xen/arch/x86/boot/trampoline.S > +++ b/xen/arch/x86/boot/trampoline.S > @@ -153,8 +153,28 @@ trampoline_protmode_entry: > .code64 > start64: > /* Jump to high mappings. */ > -movabs $__high_start,%rax

[Xen-devel] [PATCH v6.5 11/26] x86: Support indirect thunks from assembly code

2018-01-03 Thread Andrew Cooper
Introduce CALL_THUNK and JMP_THUNK which either degrade to a normal indirect branch, or dispatch to the __x86.indirect_thunk.* symbols. Update all the manual indirect branches in to use the new thunks. The indirect branches in the early boot and kexec path are left intact as we can't use the