[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks |
Date: |
Thu, 17 Jul 2008 15:14:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Paul Brook wrote:
> On Thursday 17 July 2008, Jan Kiszka wrote:
>> + if (s->pc < s->cs_base || s->pc - s->cs_base > s->cs_limit) {
>> + /* At least some of the opcode fetches violate the CS limit.
>> + Overwrite the generated code with a GPF raising one. */
>> + gen_opc_ptr = gen_opc_start;
>> + gen_opparam_ptr = gen_opparam_start;
>> + gen_exception(s, EXCP0D_GPF, pc_start - s->cs_base);
>> + }
>
> I'm fairly sure this is wrong. The TB may fault before it gets to the end of
> the segment. Likewise if the instruction spanning the limit happens to be an
> illegal op you will generate the wrong kind of exception.
What a pity, it looked so easy. OK, will think about those aspects
again. BTW, what happens when the translator hits an unresolvable
address and faults?
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
- [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Jan Kiszka, 2008/07/17
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Paul Brook, 2008/07/17
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks,
Jan Kiszka <=
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Paul Brook, 2008/07/17
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Jan Kiszka, 2008/07/17
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Paul Brook, 2008/07/17
- Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Fabrice Bellard, 2008/07/17
- [Qemu-devel] Re: [RFC][PATCH] x86: CS limit checks, Jan Kiszka, 2008/07/17
Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks, Fabrice Bellard, 2008/07/17