qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks


From: Paul Brook
Subject: Re: [Qemu-devel] [RFC][PATCH] x86: CS limit checks
Date: Thu, 17 Jul 2008 13:17:40 +0100
User-agent: KMail/1.9.9

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.

Paul




reply via email to

[Prev in Thread] Current Thread [Next in Thread]