[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150612164101.GA17611@treble.redhat.com>
Date: Fri, 12 Jun 2015 11:41:01 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Pedro Alves <palves@...hat.com>
Cc: Ingo Molnar <mingo@...nel.org>,
Andy Lutomirski <luto@...capital.net>,
Michal Marek <mmarek@...e.cz>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>,
live-patching@...r.kernel.org, X86 ML <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v5 02/10] x86: Compile-time asm code validation
On Fri, Jun 12, 2015 at 05:00:50PM +0100, Pedro Alves wrote:
> On 06/12/2015 03:10 PM, Josh Poimboeuf wrote:
> > That said, the kernel has much more custom features than other projects.
> > There are some sneaky macros, like _ASM_EXTABLE and ALTERNATIVE, which
> > hide code in various sections. Unless we're able to somehow either stop
> > using these macros or isolate them to a few places, I doubt that such a
> > general purpose assembler option would work.
>
> How does the asmvalidator handle these?
They're not easy to deal with...
The ALTERNATIVE macro creates some instructions which can be patched in
at runtime, to replace some original instructions, if the CPU supports
certain features. So we have to look up those replacement instructions
in another section and consider them to be potentially part of the
original function when doing the analysis and generation.
The _ASM_EXTABLE macro creates code which is executed after an
exception. Similarly to the ALTERNATIVE macro, we have to look up those
instructions and consider them to be part of the original function.
--
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