Skip to contentSkip to conversation

UP APIC reenabling vs. cpu type detection o

PATCH Petr Vandrovec 2 participants 2 messages Feb 9, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines · Maciej W. Rozycki
Quoted 5 lines · Petr Vandrovec

Unfortunately both these ways needs intimate knowledge of how UP NMI watchdog works in each kernel, and it is incompatible with other perfctr uses. Probably I'll switch perfctr delivery to some real maskable interrupt while VMware VM owns CPU - if it is possible. Then interrupt should be still pending after VM does __sti().

Why do you need to mask NMI at all?

Because of you must provide some function which handles NMI, and as you cannot switch IDT and CR3 atomically together, NMI handler has to be on same address in both address spaces - at least temporary. And in addition NMI handler in VM would have to switch address spaces back, execute NMI handler, and return CPU/MMU back to previous state - which may be just in the middle of normal VM<->Linux transition, so this context switching cannot use any global variable, it must save complete CPU/MMU state on stack. And it must not use any spinlock.

If you have any idea how it can be done with NMI unmasked all the way around...
Thanks,
Petr Vandrovec [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 5 lines · Petr Vandrovec
Quoted 1 line

Why do you need to mask NMI at all?

Because of you must provide some function which handles NMI, and as you cannot switch IDT and CR3 atomically together, NMI handler has to be on same address in both address spaces - at least temporary.

Can't it be?

Quoted 5 lines

And in addition NMI handler in VM would have to switch address spaces back, execute NMI handler, and return CPU/MMU back to previous state - which may be just in the middle of normal VM<->Linux transition, so this context switching cannot use any global variable, it must save complete CPU/MMU state on stack. And it must not use any spinlock.

Do you need to pass NMIs to VM at all? NMIs as defined by the PC/AT
architecture are delivered as a result of memory parity errors or ISA IOCHK errors. Is that functionality really needed in VM?

Quoted 2 lines

If you have any idea how it can be done with NMI unmasked all the way around...

It depends on the application -- you may avoid problems by careful coding
and a nested NMI will never happen -- the CPU masks the NMI line internally, from accepting an NMI till a subsequent iret.

Signature · 8 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/