- Subject: Re: disabling group leader perf_event
- From: Pekka Enberg <penberg@xxxxxxxxxx>
- Date: Wed, 8 Sep 2010 09:16:49 +0300
- Cc: Ingo Molnar <mingo@xxxxxxx>, Avi Kivity <avi@xxxxxxxxxx>, Pekka Enberg <penberg@xxxxxxxxxxxxxx>, Tom Zanussi <tzanussi@xxxxxxxxx>, Frédéric Weisbecker <fweisbec@xxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, linux-perf-users@xxxxxxxxxxxxxxx, linux-kernel <linux-kernel@xxxxxxxxxxxxxxx>
- In-reply-to: <20100908014409.GA17010@xxxxxxxxxxxxxxxxxxxx>
- References: <4C84D1CE.3070205@xxxxxxxxxx> <1283774045.1930.341.camel@laptop> <4C84D77B.6040600@xxxxxxxxxx> <20100906124330.GA22314@xxxxxxx> <4C84E265.1020402@xxxxxxxxxx> <20100906125905.GA25414@xxxxxxx> <4C850147.8010908@xxxxxxxxxx> <20100906154737.GA4332@xxxxxxx> <4C852B2A.2030103@xxxxxxxxxx> <20100907034417.GA14046@xxxxxxx> <20100908014409.GA17010@xxxxxxxxxxxxxxxxxxxx>
2010/9/8 Paul Mackerras <paulus@xxxxxxxxx>:
>> We start with trivial (and useless) special case of something like:
>>
>> #define MAX_BYTECODE_SIZE 256
>>
>> int x86_bytecode_verify(char *opcodes, unsigned int len)
>> {
>>
>> if (len-1 > MAX_BYTECODE_SIZE-1)
>> return -EINVAL;
>>
>> if (opcodes[0] != 0xc3) /* RET instruction */
>> return -EINVAL;
>>
>> return 0;
>> }
>>
>> ... and then we add checks for accepted/safe x86 patterns of
>> instructions step by step - always keeping it 100% correct.
>
> So... I would be interested to see you add the case for the MOV
> instruction. :)
Heh, which one of them - there are tons of variants under 'mov' on
x86? On a more serious note: the biggest problem is that you need to
do verification during execution because you don't know the exact
address until then for most addressing modes that use registers.
Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]