diff mbox series

[v3,1/4] x86/mm: declare check_la57_support() as inline

Message ID 20181028130945.23581-2-changbin.du@gmail.com (mailing list archive)
State New, archived
Headers show
Series kernel hacking: GCC optimization for better debug experience (-Og) | expand

Commit Message

Changbin Du Oct. 28, 2018, 1:09 p.m. UTC
The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
So declare check_la57_support() as inline to make sure the code
referring to level4_kernel_pgt is optimized out. This is a preparation
for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
---
 arch/x86/kernel/head64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Steven Rostedt Oct. 28, 2018, 6:09 p.m. UTC | #1
On Sun, 28 Oct 2018 13:09:42 +0000
Changbin Du <changbin.du@gmail.com> wrote:

> The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
> So declare check_la57_support() as inline to make sure the code
> referring to level4_kernel_pgt is optimized out. This is a preparation
> for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.
> 
> Signed-off-by: Changbin Du <changbin.du@gmail.com>

Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>

-- Steve

> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>  arch/x86/kernel/head64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
> index 5dc377dc9d7b..5ae682f2aa83 100644
> --- a/arch/x86/kernel/head64.c
> +++ b/arch/x86/kernel/head64.c
> @@ -98,7 +98,7 @@ static bool __head check_la57_support(unsigned long physaddr)
>  	return true;
>  }
>  #else
> -static bool __head check_la57_support(unsigned long physaddr)
> +static inline bool __head check_la57_support(unsigned long physaddr)
>  {
>  	return false;
>  }
Masahiro Yamada Oct. 29, 2018, 1:04 p.m. UTC | #2
On Mon, Oct 29, 2018 at 3:09 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Sun, 28 Oct 2018 13:09:42 +0000
> Changbin Du <changbin.du@gmail.com> wrote:
>
> > The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
> > So declare check_la57_support() as inline to make sure the code
> > referring to level4_kernel_pgt is optimized out. This is a preparation
> > for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.
> >
> > Signed-off-by: Changbin Du <changbin.du@gmail.com>
>
> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
>
> -- Steve
>


Applied to linux-kbuild.
Borislav Petkov Nov. 2, 2018, 11:27 a.m. UTC | #3
On Mon, Oct 29, 2018 at 10:04:46PM +0900, Masahiro Yamada wrote:
> On Mon, Oct 29, 2018 at 3:09 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > On Sun, 28 Oct 2018 13:09:42 +0000
> > Changbin Du <changbin.du@gmail.com> wrote:
> >
> > > The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
> > > So declare check_la57_support() as inline to make sure the code
> > > referring to level4_kernel_pgt is optimized out. This is a preparation
> > > for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.
> > >
> > > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> >
> > Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> >
> > -- Steve
> >
> 
> Applied to linux-kbuild.

Next time, before you route a patch through your tree, please get an x86
maintainer's ACK first.

Thx.
Masahiro Yamada Nov. 9, 2018, 4:27 p.m. UTC | #4
On Fri, Nov 2, 2018 at 8:28 PM Borislav Petkov <bp@alien8.de> wrote:
>
> On Mon, Oct 29, 2018 at 10:04:46PM +0900, Masahiro Yamada wrote:
> > On Mon, Oct 29, 2018 at 3:09 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > On Sun, 28 Oct 2018 13:09:42 +0000
> > > Changbin Du <changbin.du@gmail.com> wrote:
> > >
> > > > The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
> > > > So declare check_la57_support() as inline to make sure the code
> > > > referring to level4_kernel_pgt is optimized out. This is a preparation
> > > > for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.
> > > >
> > > > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> > >
> > > Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > >
> > > -- Steve
> > >
> >
> > Applied to linux-kbuild.
>
> Next time, before you route a patch through your tree, please get an x86
> maintainer's ACK first.


I changed my mind, and did not include this in my previous pull request
because this series is causing many warnings.

Now, it is aiming for v5.0-rc1

So, it is not too late.

If x86 maintainers issue Acked-by,
I am happy to add it.




> Thx.
>
> --
> Regards/Gruss,
>     Boris.
>
> Good mailing practices for 400: avoid top-posting and trim the reply.
Changbin Du Nov. 10, 2018, 1:41 a.m. UTC | #5
On Sat, Nov 10, 2018 at 01:27:29AM +0900, Masahiro Yamada wrote:
> On Fri, Nov 2, 2018 at 8:28 PM Borislav Petkov <bp@alien8.de> wrote:
> >
> > On Mon, Oct 29, 2018 at 10:04:46PM +0900, Masahiro Yamada wrote:
> > > On Mon, Oct 29, 2018 at 3:09 AM Steven Rostedt <rostedt@goodmis.org> wrote:
> > > >
> > > > On Sun, 28 Oct 2018 13:09:42 +0000
> > > > Changbin Du <changbin.du@gmail.com> wrote:
> > > >
> > > > > The level4_kernel_pgt is only defined when X86_5LEVEL is enabled.
> > > > > So declare check_la57_support() as inline to make sure the code
> > > > > referring to level4_kernel_pgt is optimized out. This is a preparation
> > > > > for CONFIG_CC_OPTIMIZE_FOR_DEBUGGING.
> > > > >
> > > > > Signed-off-by: Changbin Du <changbin.du@gmail.com>
> > > >
> > > > Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > > >
> > > > -- Steve
> > > >
> > >
> > > Applied to linux-kbuild.
> >
> > Next time, before you route a patch through your tree, please get an x86
> > maintainer's ACK first.
> 
> 
> I changed my mind, and did not include this in my previous pull request
> because this series is causing many warnings.
>
Most of the new warnings are false warnings. Since this series didn't change any
code where the warnings happen. I'll make patches to make gcc happy.

> Now, it is aiming for v5.0-rc1
> 
> So, it is not too late.
> 
> If x86 maintainers issue Acked-by,
> I am happy to add it.
> 
> 
> 
> 
> > Thx.
> >
> > --
> > Regards/Gruss,
> >     Boris.
> >
> > Good mailing practices for 400: avoid top-posting and trim the reply.
> 
> 
> 
> -- 
> Best Regards
> Masahiro Yamada
diff mbox series

Patch

diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 5dc377dc9d7b..5ae682f2aa83 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -98,7 +98,7 @@  static bool __head check_la57_support(unsigned long physaddr)
 	return true;
 }
 #else
-static bool __head check_la57_support(unsigned long physaddr)
+static inline bool __head check_la57_support(unsigned long physaddr)
 {
 	return false;
 }