Re: [PATCH 3/3] x86, extable: Handle early exceptions

From: Borislav Petkov
Date: Fri Apr 20 2012 - 04:46:51 EST


On Thu, Apr 19, 2012 at 11:11:00AM -0700, Linus Torvalds wrote:
> > OTOH, if we can share early and normal exception handling lookup code, then a
> > perfect hash would make sense as those exceptions would pile up.
>
> Oh, any of this only makes sense if we can share it with the runtime
> exception lookup.
>
> They are *seldom* hugely performance-critical, but there are some
> unusual loads where you do get a fair number of exceptions.

I was thinking, and this is probably purely hypothetical and tangential
to the topic but, what happens if we get an exception right in the
middle between using the early_idt_handler's and switching to the normal
trap handlers in trap_init()?

write_idt_entry() is a simple memcpy so what happens if we have a
half-written descriptor? Won't we need some locking there to atomize the
switch?

Or am I dreaming?

Thanks.

--
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
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/