Re: [Xen-devel] [RFC v3 10/13] jump_label: port __jump_table to linker tables

2016-07-22 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 02:24:44PM -0700, Luis R. Rodriguez wrote: > diff --git a/tools/objtool/special.c b/tools/objtool/special.c > index bff8abb3a4aa..f0ad369f994b 100644 > --- a/tools/objtool/special.c > +++ b/tools/objtool/special.c > @@ -26,6 +26,10 @@ > #include "special.h" > #include

Re: [Xen-devel] [RFC v3 10/13] jump_label: port __jump_table to linker tables

2016-07-22 Thread Josh Poimboeuf
On Sat, Jul 23, 2016 at 12:26:54AM +0200, Luis R. Rodriguez wrote: > On Fri, Jul 22, 2016 at 04:49:45PM -0500, Josh Poimboeuf wrote: > > On Fri, Jul 22, 2016 at 02:24:44PM -0700, Luis R. Rodriguez wrote: > > > diff --git a/tools/objtool/special.c b/tools/objtool/special.c > &

Re: [Xen-devel] [PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

2017-03-22 Thread Josh Poimboeuf
On Wed, Mar 22, 2017 at 08:46:16AM +0100, Ingo Molnar wrote: > > * Jiri Slaby wrote: > > > On 03/22/2017, 08:25 AM, Ingo Molnar wrote: > > > > > > * Pavel Machek wrote: > > > > > >> Hi! > > >> > > >>> -ENTRY(saved_rbp) .quad 0 > > >>> -ENTRY(saved_rsi)

Re: [Xen-devel] [PATCH v2 03/10] x86: assembly, use SYM_FUNC_END for functions

2017-03-22 Thread Josh Poimboeuf
On Mon, Mar 20, 2017 at 01:32:15PM +0100, Jiri Slaby wrote: > Somewhere END was used to end a function, elsewhere, nothing was used. > So unify it and mark them all by SYM_FUNC_END. > > Signed-off-by: Jiri Slaby For me these patches would be easier to review if the

Re: [Xen-devel] [PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

2017-03-22 Thread Josh Poimboeuf
On Wed, Mar 22, 2017 at 04:01:08PM +0100, Jiri Slaby wrote: > On 03/22/2017, 03:11 PM, Josh Poimboeuf wrote: > > Or, here's a much easier way to do it, without involving objtool: > > > > --- a/include/linux/linkage.h > > +++ b/include/linux/linkage.h > >

Re: [Xen-devel] [PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

2017-03-23 Thread Josh Poimboeuf
On Thu, Mar 23, 2017 at 08:38:20AM +0100, Ingo Molnar wrote: > > * Josh Poimboeuf <jpoim...@redhat.com> wrote: > > > On Wed, Mar 22, 2017 at 08:46:16AM +0100, Ingo Molnar wrote: > > > > > > * Jiri Slaby <jsl...@suse.cz> wrote: > > &g

Re: [Xen-devel] [PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

2017-03-20 Thread Josh Poimboeuf
On Mon, Mar 20, 2017 at 04:32:09PM +0100, Jiri Slaby wrote: > On 03/20/2017, 02:32 PM, Josh Poimboeuf wrote: > > On Mon, Mar 20, 2017 at 01:32:14PM +0100, Jiri Slaby wrote: > >> This is a start of series to cleanup macros used for starting functions, > >> data, globa

Re: [Xen-devel] [PATCH v2 02/10] x86: assembly, FUNC_START for fn, DATA_START for data

2017-03-20 Thread Josh Poimboeuf
On Mon, Mar 20, 2017 at 01:32:14PM +0100, Jiri Slaby wrote: > This is a start of series to cleanup macros used for starting functions, > data, globals etc. across x86. When we have all this sorted out, this > will help to inject DWARF unwinding info by objtool later. > > The goal is forcing

Re: [Xen-devel] [PATCH v2 03/10] x86: assembly, use SYM_FUNC_END for functions

2017-04-10 Thread Josh Poimboeuf
On Mon, Apr 10, 2017 at 01:23:46PM +0200, Jiri Slaby wrote: > On 03/22/2017, 04:44 PM, Jiri Slaby wrote: > > On 03/22/2017, 03:26 PM, Josh Poimboeuf wrote: > >> On Mon, Mar 20, 2017 at 01:32:15PM +0100, Jiri Slaby wrote: > >>> Somewhere END was used to end a functio

Re: [Xen-devel] [PATCH v2 03/10] x86: assembly, use SYM_FUNC_END for functions

2017-03-21 Thread Josh Poimboeuf
On Mon, Mar 20, 2017 at 01:32:15PM +0100, Jiri Slaby wrote: > ENTRY(ftrace_caller) > /* save_mcount_regs fills in first two parameters */ > @@ -184,11 +184,12 @@ GLOBAL(ftrace_epilogue) > GLOBAL(ftrace_graph_call) > jmp ftrace_stub > #endif > +SYM_FUNC_END(ftrace_caller) > > /*

Re: [Xen-devel] [PATCH 1/3] paravirt,xen: remove xen_patch()

2017-08-10 Thread Josh Poimboeuf
On Thu, Aug 10, 2017 at 02:52:52PM +0200, Juergen Gross wrote: > Xen's paravirt patch function xen_patch() does some special casing for > irq_ops functions to apply relocations when those functions can be > patched inline instead of calls. > > Unfortunately none of the special case function

Re: [Xen-devel] [PATCH v3 04/29] x86: assembly, use ENDPROC for functions

2017-04-25 Thread Josh Poimboeuf
On Fri, Apr 21, 2017 at 04:12:40PM +0200, Jiri Slaby wrote: > Somewhere END was used to end a function. It is not intended to be used > for functions, because it does not mark the actual symbols as functions. > Use ENDPROC in such cases which does the right job. > > Signed-off-by: Jiri Slaby

Re: [Xen-devel] [PATCH v2 1/2] paravirt,xen: remove xen_patch()

2017-08-16 Thread Josh Poimboeuf
_direct, 0) Might as well remove the ENDPROC indentations while you're at it, for readability and consistency with other asm code. Otherwise, Reviewed-by: Josh Poimboeuf <jpoim...@redhat.com> -- Josh ___ Xen-devel mailing list Xen-d

Re: [Xen-devel] [PATCH v3 04/29] x86: assembly, use ENDPROC for functions

2017-05-12 Thread Josh Poimboeuf
On Fri, May 12, 2017 at 09:53:48AM +0200, Jiri Slaby wrote: > On 04/26/2017, 03:42 AM, Josh Poimboeuf wrote: > >> @@ -323,7 +323,7 @@ ENTRY(resume_userspace) > >>movl%esp, %eax > >>callprepare_exit_to_usermode > >>jmp restore_all >

Re: [Xen-devel] [PATCH v3 04/29] x86: assembly, use ENDPROC for functions

2017-05-19 Thread Josh Poimboeuf
On Fri, May 19, 2017 at 11:17:24AM +0200, Jiri Slaby wrote: > On 05/17/2017, 03:23 PM, Jiri Slaby wrote: > >> So the initial CFI state is different between the two types of > >> "functions". And there are a lot of other differences. C-type > >> functions have to follow frame pointer conventions,

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-06 Thread Josh Poimboeuf
On Fri, Oct 06, 2017 at 11:29:52AM -0400, Boris Ostrovsky wrote: > >>> + > >>> void __init_or_module apply_paravirt(struct paravirt_patch_site *start, > >>>struct paravirt_patch_site *end) > >>> { > >>> diff --git a/arch/x86/kernel/cpu/hypervisor.c > >>>

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-06 Thread Josh Poimboeuf
On Thu, Oct 05, 2017 at 04:35:03PM -0400, Boris Ostrovsky wrote: > > > #ifdef CONFIG_PARAVIRT > > +/* > > + * Paravirt alternatives are applied much earlier than normal alternatives. > > + * They are only applied when running on a hypervisor. They replace some > > + * native instructions with

Re: [Xen-devel] [PATCH 00/13] x86/paravirt: Make pv ops code generation more closely match reality

2017-10-06 Thread Josh Poimboeuf
On Fri, Oct 06, 2017 at 09:35:16AM +0200, Vitaly Kuznetsov wrote: > Josh Poimboeuf <jpoim...@redhat.com> writes: > > > - For the most common runtime cases (everything except Xen and vSMP), > > vmlinux disassembly now matches what the actual runtime code looks &g

Re: [Xen-devel] [PATCH v4 01/27] linkage: new macros for assembler symbols

2017-10-06 Thread Josh Poimboeuf
On Mon, Oct 02, 2017 at 11:12:20AM +0200, Jiri Slaby wrote: >SYM_CODE_INNER_LABEL -- only for labels in the middle of code >SYM_CODE_INNER_LABEL_NOALIGN -- only for labels in the middle of code Why are the inner labels aligned by default? Seems like unaligned would be the most common

[Xen-devel] [PATCH 02/13] x86/paravirt: Fix output constraint macro names

2017-10-04 Thread Josh Poimboeuf
Some of the paravirt '*_CLOBBERS' macros refer to output constraints instead of clobbers, which makes the code extra confusing. Rename the output constraint related macros to '*_OUTPUTS'. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt_types.

[Xen-devel] [PATCH 00/13] x86/paravirt: Make pv ops code generation more closely match reality

2017-10-04 Thread Josh Poimboeuf
bits to specify which ops it needs during early boot, then those ops can be patched in using early alternatives.) For more details, see the commit log in patch 11/13. Josh Poimboeuf (13): x86/paravirt: remove wbinvd() paravirt interface x86/paravirt: Fix output constraint macro names x86

[Xen-devel] [PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros

2017-10-04 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/special_insns.h | 24 arch/x86/kernel/paravirt_patch_32.c | 21 +++-- arch/x86/kernel/paravirt_patch_64.c | 29 +++-- 3 files changed, 50 insertions(

[Xen-devel] [PATCH 01/13] x86/paravirt: remove wbinvd() paravirt interface

2017-10-04 Thread Josh Poimboeuf
Since lguest was removed, only the native version of wbinvd() is used. The paravirt interface is no longer needed. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt.h | 5 - arch/x86/include/asm/paravirt_types.h | 1 - arch/x86/inclu

[Xen-devel] [PATCH 04/13] x86/paravirt: Convert DEF_NATIVE macro to GCC extended asm syntax

2017-10-04 Thread Josh Poimboeuf
. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt_types.h | 10 +++--- arch/x86/include/asm/special_insns.h | 14 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/inclu

[Xen-devel] [PATCH 09/13] x86/asm: Convert ALTERNATIVE*() assembler macros to preprocessor macros

2017-10-04 Thread Josh Poimboeuf
The ALTERNATIVE() and ALTERNATIVE_2() macros are GNU assembler macros, which makes them quite inflexible for future changes. Convert them to preprocessor macros. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/entry/entry_32.S| 12 +++--- arch/x86/entry/en

[Xen-devel] [PATCH 05/13] x86/paravirt: Move paravirt asm macros to paravirt-asm.h

2017-10-04 Thread Josh Poimboeuf
The paravirt.h file is quite big and the asm interfaces for paravirt don't need to be in the same file as the C interfaces. Move the asm interfaces to a dedicated header file. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/entry/entry_32.S | 1 + arch/x86

[Xen-devel] [PATCH 06/13] x86/paravirt: Clean up paravirt-asm.h

2017-10-04 Thread Josh Poimboeuf
Some cleanup to make the code easier to read and understand: - Use the common "PV_" prefix - Simplify the PV_SITE macro interface - Improve whitespace Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt-asm.h | 95 +++--

[Xen-devel] [PATCH 07/13] x86/paravirt: Simplify ____PVOP_CALL()

2017-10-04 Thread Josh Poimboeuf
Remove the inline asm duplication in PVOP_CALL(). Also add 'IS_ENABLED(CONFIG_X86_32)' to the return variable logic, making the code clearer and rendering the comment unnecessary. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt_types.

[Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-04 Thread Josh Poimboeuf
cide what to replace the native code with. Then each site would only be patched once. But that's going to be a bit more work. At least this patch creates a good foundation for eventually getting rid of .parainstructions and pv ops completely. Suggested-by: Andy Lutomirski <l...@kernel.org> Sig

[Xen-devel] [PATCH 08/13] x86/paravirt: Clean up paravirt_types.h

2017-10-04 Thread Josh Poimboeuf
Make paravirt_types.h more understandable: - Use more consistent and logical naming - Simplify interfaces - Put related macros together - Improve whitespace Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt_types.h | 104 ++-

[Xen-devel] [PATCH 13/13] x86/paravirt: Convert natively patched pv ops to use paravirt alternatives

2017-10-04 Thread Josh Poimboeuf
likely to match reality. Reported-by: Sasha Levin <alexander.le...@verizon.com> Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/include/asm/paravirt-asm.h | 23 +-- arch/x86/include/asm/paravirt.h | 37 + 2 files

[Xen-devel] [PATCH 12/13] objtool: Add support for new .pv_altinstructions section

2017-10-04 Thread Josh Poimboeuf
Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- tools/objtool/special.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tools/objtool/special.c b/tools/objtool/special.c index 84f001d52322..dc15a3564fc9 100644 --- a/tools/objtool/special.c +++ b/tools/objtool/spe

[Xen-devel] [PATCH 10/13] x86/alternative: Support indirect call replacement

2017-10-04 Thread Josh Poimboeuf
Add alternative patching support for replacing an instruction with an indirect call. This will be needed for the paravirt alternatives. Signed-off-by: Josh Poimboeuf <jpoim...@redhat.com> --- arch/x86/kernel/alternative.c | 22 +++--- 1 file changed, 15 insertions

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-17 Thread Josh Poimboeuf
On Tue, Oct 17, 2017 at 09:58:59AM -0400, Boris Ostrovsky wrote: > On 10/17/2017 01:24 AM, Josh Poimboeuf wrote: > > On Mon, Oct 16, 2017 at 02:18:48PM -0400, Boris Ostrovsky wrote: > >> On 10/12/2017 03:53 PM, Boris Ostrovsky wrote: > >>> On 10/12/2017 03:27 PM, And

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-16 Thread Josh Poimboeuf
On Mon, Oct 16, 2017 at 02:18:48PM -0400, Boris Ostrovsky wrote: > On 10/12/2017 03:53 PM, Boris Ostrovsky wrote: > > On 10/12/2017 03:27 PM, Andrew Cooper wrote: > >> On 12/10/17 20:11, Boris Ostrovsky wrote: > >>> There is also another problem: > >>> > >>> [1.312425] general protection

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-17 Thread Josh Poimboeuf
On Tue, Oct 17, 2017 at 11:36:57AM -0400, Boris Ostrovsky wrote: > On 10/17/2017 10:36 AM, Josh Poimboeuf wrote: > > > > Maybe we can add a new field to the alternatives entry struct which > > specifies the offset to the CALL instruction, so apply_alternatives() > >

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-17 Thread Josh Poimboeuf
On Tue, Oct 17, 2017 at 04:59:41PM -0400, Boris Ostrovsky wrote: > On 10/17/2017 04:50 PM, Josh Poimboeuf wrote: > > On Tue, Oct 17, 2017 at 04:36:00PM -0400, Boris Ostrovsky wrote: > >> On 10/17/2017 04:17 PM, Josh Poimboeuf wrote: > >>> On Tue, Oct 17, 2017 at 11:

Re: [Xen-devel] [PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure

2017-10-17 Thread Josh Poimboeuf
On Tue, Oct 17, 2017 at 04:36:00PM -0400, Boris Ostrovsky wrote: > On 10/17/2017 04:17 PM, Josh Poimboeuf wrote: > > On Tue, Oct 17, 2017 at 11:36:57AM -0400, Boris Ostrovsky wrote: > >> On 10/17/2017 10:36 AM, Josh Poimboeuf wrote: > >>> Maybe we can add a new f

Re: [Xen-devel] [PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros

2017-11-17 Thread Josh Poimboeuf
On Fri, Nov 17, 2017 at 08:10:13PM +0100, Juergen Gross wrote: > On 17/11/17 19:07, Borislav Petkov wrote: > > On Wed, Oct 04, 2017 at 10:58:24AM -0500, Josh Poimboeuf wrote: > >> Convert the hard-coded native patch assembly code strings to macros to > >> facilitate sha

Re: [Xen-devel] [PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros

2017-11-18 Thread Josh Poimboeuf
On Sat, Nov 18, 2017 at 11:20:06AM +0100, Juergen Gross wrote: > +#define NATIVE_ZERO "xor " _REG_ARG1 ", " _REG_ARG1 > >>> > >>> NATIVE_ZERO_OUT > >>> > >>> I guess. NATIVE_ZERO reads like the native representation of 0 :-) > >> > >> NATIVE_ZERO_ARG1? > > > > On a slight

Re: [Xen-devel] [PATCH 02/13] x86/paravirt: Fix output constraint macro names

2017-11-16 Thread Josh Poimboeuf
On Wed, Oct 25, 2017 at 11:33:43AM +0200, Juergen Gross wrote: > On 04/10/17 17:58, Josh Poimboeuf wrote: > > Some of the paravirt '*_CLOBBERS' macros refer to output constraints > > instead of clobbers, which makes the code extra confusing. Rename the > > output cons

Re: [Xen-devel] [PATCH 03/13] x86/paravirt: Convert native patch assembly code strings to macros

2017-11-16 Thread Josh Poimboeuf
On Wed, Oct 25, 2017 at 11:46:18AM +0200, Juergen Gross wrote: > On 04/10/17 17:58, Josh Poimboeuf wrote: > > Convert the hard-coded native patch assembly code strings to macros to > > facilitate sharing common code between 32-bit and 64-bit. > > > > These macros wi

Re: [Xen-devel] [PATCH 10/13] x86/alternative: Support indirect call replacement

2017-11-16 Thread Josh Poimboeuf
On Wed, Oct 25, 2017 at 01:25:02PM +0200, Juergen Gross wrote: > On 04/10/17 17:58, Josh Poimboeuf wrote: > > Add alternative patching support for replacing an instruction with an > > indirect call. This will be needed for the paravirt alternatives. > > > > Signed-of