Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-12-04 Thread Nick Desaulniers
On Thu, Nov 16, 2017 at 2:54 PM, Alex Matveev wrote: > On Fri, 17 Nov 2017 00:29:20 +0300 > Yury Norov wrote: > >> On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: >> > Given that this whole mrs_s infrastructure is a workaround for older

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-12-04 Thread Nick Desaulniers
On Thu, Nov 16, 2017 at 2:54 PM, Alex Matveev wrote: > On Fri, 17 Nov 2017 00:29:20 +0300 > Yury Norov wrote: > >> On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: >> > Given that this whole mrs_s infrastructure is a workaround for older >> > assemblers which don't support the

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Alex Matveev
On Fri, 17 Nov 2017 00:29:20 +0300 Yury Norov wrote: > On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: > > Given that this whole mrs_s infrastructure is a workaround for older > > assemblers which don't support the "S" > > syntax for arbitrary unnamed

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Alex Matveev
On Fri, 17 Nov 2017 00:29:20 +0300 Yury Norov wrote: > On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: > > Given that this whole mrs_s infrastructure is a workaround for older > > assemblers which don't support the "S" > > syntax for arbitrary unnamed system registers (which

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Yury Norov
On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: > On 16/11/17 13:07, Yury Norov wrote: > > On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > > > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > > > From: Alex Matveev > > > > > > > >

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Yury Norov
On Thu, Nov 16, 2017 at 01:55:31PM +, Robin Murphy wrote: > On 16/11/17 13:07, Yury Norov wrote: > > On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > > > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > > > From: Alex Matveev > > > > > > > > Use UNDEFINE_MRS_S

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Alex Matveev
On Thu, 16 Nov 2017 11:54:33 + Will Deacon wrote: > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > From: Alex Matveev > > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > in-place and workaround gcc and

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Alex Matveev
On Thu, 16 Nov 2017 11:54:33 + Will Deacon wrote: > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > From: Alex Matveev > > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > in-place and workaround gcc and clang limitations on redefining > >

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:01:44AM -0600, Segher Boessenkool wrote: > The thing with .purgem can work. Inelegant, sure, but it can work :-) It works, there are already functions in the kernel that use these macros more than once. I agree that this might not be the most elegant solution, but at

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:01:44AM -0600, Segher Boessenkool wrote: > The thing with .purgem can work. Inelegant, sure, but it can work :-) It works, there are already functions in the kernel that use these macros more than once. I agree that this might not be the most elegant solution, but at

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Segher Boessenkool
On Thu, Nov 16, 2017 at 08:46:08AM -0800, Sami Tolvanen wrote: > On Thu, Nov 16, 2017 at 07:56:50AM -0600, Segher Boessenkool wrote: > > The compiler is fine, the assembler is fine (and the linker has > > nothing to do with it). Your code is not fine. > > Would you care to elaborate? The current

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Segher Boessenkool
On Thu, Nov 16, 2017 at 08:46:08AM -0800, Sami Tolvanen wrote: > On Thu, Nov 16, 2017 at 07:56:50AM -0600, Segher Boessenkool wrote: > > The compiler is fine, the assembler is fine (and the linker has > > nothing to do with it). Your code is not fine. > > Would you care to elaborate? The current

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 07:56:50AM -0600, Segher Boessenkool wrote: > The compiler is fine, the assembler is fine (and the linker has > nothing to do with it). Your code is not fine. Would you care to elaborate? The current code assumes that macros are visible in other inline assembly blocks,

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 07:56:50AM -0600, Segher Boessenkool wrote: > The compiler is fine, the assembler is fine (and the linker has > nothing to do with it). Your code is not fine. Would you care to elaborate? The current code assumes that macros are visible in other inline assembly blocks,

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Nick Desaulniers
I need this patch to assemble the kernel for arm64 with clang regardless of LTO.

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Nick Desaulniers
I need this patch to assemble the kernel for arm64 with clang regardless of LTO.

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > What limitations? Can you elaborate please? Is this a fix? The commit message in v1 was more informative, I'll change this back for v3: -- Clang's integrated assembler does not allow assembly macros defined in one inline asm block

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Sami Tolvanen
On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > What limitations? Can you elaborate please? Is this a fix? The commit message in v1 was more informative, I'll change this back for v3: -- Clang's integrated assembler does not allow assembly macros defined in one inline asm block

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Segher Boessenkool
On Thu, Nov 16, 2017 at 04:07:42PM +0300, Yury Norov wrote: > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > > in-place and workaround gcc and clang limitations on redefining macros > > > across different assembler blocks. > > > > What limitations? Can you elaborate

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Segher Boessenkool
On Thu, Nov 16, 2017 at 04:07:42PM +0300, Yury Norov wrote: > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > > in-place and workaround gcc and clang limitations on redefining macros > > > across different assembler blocks. > > > > What limitations? Can you elaborate

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Robin Murphy
On 16/11/17 13:07, Yury Norov wrote: On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: From: Alex Matveev Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros in-place and workaround

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Robin Murphy
On 16/11/17 13:07, Yury Norov wrote: On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: From: Alex Matveev Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros in-place and workaround gcc and clang

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Yury Norov
On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > From: Alex Matveev > > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > in-place and workaround gcc and clang

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Yury Norov
On Thu, Nov 16, 2017 at 11:54:33AM +, Will Deacon wrote: > On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > > From: Alex Matveev > > > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > > in-place and workaround gcc and clang limitations on redefining

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Will Deacon
On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > From: Alex Matveev > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > in-place and workaround gcc and clang limitations on redefining macros > across different assembler blocks. What

Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-16 Thread Will Deacon
On Wed, Nov 15, 2017 at 01:34:21PM -0800, Sami Tolvanen wrote: > From: Alex Matveev > > Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros > in-place and workaround gcc and clang limitations on redefining macros > across different assembler blocks. What limitations? Can you

[PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-15 Thread Sami Tolvanen
From: Alex Matveev Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros in-place and workaround gcc and clang limitations on redefining macros across different assembler blocks. Signed-off-by: Alex Matveev Signed-off-by: Yury Norov

[PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO

2017-11-15 Thread Sami Tolvanen
From: Alex Matveev Use UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros in-place and workaround gcc and clang limitations on redefining macros across different assembler blocks. Signed-off-by: Alex Matveev Signed-off-by: Yury Norov Signed-off-by: Sami Tolvanen ---