Re: [ANNOUNCE] CMOV emulation for 2.4.19-rc1

Gabriel Paubert (paubert@iram.es)
Mon, 01 Jul 2002 18:25:39 +0200


willy tarreau wrote:
> Hello Denis,
>
>
>>This code is performance critical.
>>With this in mind,
>
>
> Yes and no. In fact, I first wanted to code some
> parts in assembler because GCC is sub-optimal
> on bit-fields calculations. But then, I realized that
> I could save, say 10 cycles, while the trap costs
> about 400 cycles.
>
>
>>+static void *modrm_address(struct pt_regs *regs,
>>unsigned char **from, char w, char bit32,
>>w seems to be unused
>
>
> Well, you're right, it's not used anymore. It was
> used to check if the instruction applies to a byte
> or a word.
>
>
>>Why? i86 can do unaligned accesses:
>> offset = *(u32*)(*from); *from += 4;
>
>
> that's simply because I'm not sure if the kernel
> runs with AC flag on or off. I quickly checked
> that it's OK from userland.

AC is only checked when running at CPL==3, i.e.,
you'll never get an alignment trap in the kernel.

Gabriel

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/