Re: [tip:x86/setup] x86, setup: "glove box" BIOS calls -- infrastructure

From: H. Peter Anvin
Date: Fri Apr 10 2009 - 13:20:50 EST


Pavel Machek wrote:

+ .code16
+ .text
+ .globl intcall
+ .type intcall, @function
+intcall:
+ /* Self-modify the INT instruction. Ugly, but works. */
+ cmpb %al, 3f
+ je 1f
+ movb %al, 3f
+ jmp 1f /* Synchronize pipeline */
+1:

There are various CPU bugs with self-modifying code, but I guess we
are not using it heavily enough. Also we are single-threaded so that
should be ok.
Pavel


This case is extremely straightforward, so I'm not worried about it. The final JMP is actually not required (there is a LOOP instruction between the modify and the invocation point) but is there for extra safety.

FWIW, we already do SMC during the transfer to protected mode (pmjump.S), and hopefully got the issues worked out there.

-hpa
--
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/