Re: [PATCH] Athlon/Opteron Prefetch Fix for 2.6.0test5 + numbers

From: Jamie Lokier
Date: Thu Sep 18 2003 - 10:40:04 EST


Andi Kleen wrote:
> I added a check for LDT entries now. This means prefetch exceptions
> inside non standard code segments will be not handled (I will fix
> that in a follow up patch)

> + /* Don't check for LDT code segments because they could have
> + non zero bases. Better would be to add in the base in this case. */
> + if (regs->xcs & (1<<2))
> + return 0;

It is possible to have a non-standard code segment in the GDT, too.
Thus a better to check is "unlikely((regs->xcs & 0xffff) != __USER_CS)".

One way to add in the correct base would be to use the real segment
register. Don't call __get_user: call your own special function which
uses %gs, and temporarily load regs->xcs into %gs.

Alternatively you can just calculate the base and add it.

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