[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150610153155.GB29724@treble.redhat.com>
Date: Wed, 10 Jun 2015 10:31:55 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Andi Kleen <andi@...stfloor.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Michal Marek <mmarek@...e.cz>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Borislav Petkov <bp@...en8.de>,
Linus Torvalds <torvalds@...ux-foundation.org>, x86@...nel.org,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 00/10] x86/asm: Compile-time asm code validation
On Wed, Jun 10, 2015 at 05:04:12PM +0200, Andi Kleen wrote:
> > > > - duplicate the destination code inside the function
> > > > - convert the jump to a call
> > >
> > > That all won't work for a lot of cases.
> >
> > Hm, could you give an example?
>
> Just a standard *_user exception handler.
I'm afraid I don't follow. Exception handlers don't work via jump
instructions, but rather via CPU exceptions.
Or are you talking about something else?
> > Well, I don't see how that's really a logical conclusion.
>
> What's special about assembler code?
Ok, I'll bite:
- it's human-generated
- it's much simpler
- it doesn't have stack metadata by default
- it has far fewer constraints
But I don't see this line of discussion going anywhere without any real
examples of why you need external jumps in asm functions...
> > But we're
> > probably being too vague here... Do you have any examples where you
> > really need to jump outside of a callable function?
>
> It's not needed, but it's an optimization to optimize icache usage.
> It is optional (-freorder-blocks-and-partition)
>
> In this case gcc splits the function into two (hot and cold)
>
> It's actually a nice optimization and it would be sad from stopping
> the kernel from using it.
Sorry if I wasn't clear, I was trying to ask for examples in kernel asm
code.
Are you suggesting that we implement this gcc optimization in kernel asm
code?
--
Josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists