Skip to contentSkip to conversation

paravirt_ops.safe_halt vs .halt?

DISCUSSION Jeremy Fitzhardinge 3 participants 4 messages Sep 21, 2006 virtio core

lore
Share & tools
lore
#0 lore raw

What's paravirt_ops.halt for? Is it the non-safe equivalent to safe_halt, or is it intended for shutting down the machine? It doesn't seem to be used anywhere.

J

#1 lore raw
Quoted 3 lines · * Jeremy Fitzhardinge ([email protected]) wrote:

What's paravirt_ops.halt for? Is it the non-safe equivalent to safe_halt, or is it intended for shutting down the machine? It doesn't seem to be used anywhere.

It's called from halt(). Xen should be using it to down the cpu.

thanks,
-chris

#2 lore raw
Quoted 9 lines · Chris Wright
Quoted 4 lines · * Jeremy Fitzhardinge ([email protected]) wrote:

What's paravirt_ops.halt for? Is it the non-safe equivalent to safe_halt, or is it intended for shutting down the machine? It doesn't seem to be used anywhere.

It's called from halt(). Xen should be using it to down the cpu.

Wonder if we shouldn't give it a less ambigious name... Or rename safe_halt to block() or something.

J

#3 lore raw
Quoted 5 lines · Jeremy Fitzhardinge
Quoted 3 lines · Chris Wright

* Jeremy Fitzhardinge ([email protected]) wrote:

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines

What's paravirt_ops.halt for? Is it the non-safe equivalent to safe_halt, or is it intended for shutting down the machine? It doesn't seem to be used anywhere.

It's called from halt(). Xen should be using it to down the cpu.

It's also called whenever there is a raw hlt instruction. Which happens in some cases when you don't want to shutdown the CPU (at least, testing HLT instruction). So there are really three kinds of halt

1) safe_halt - safely halt and enable interrupts
2) shutdown_halt - halt and disable interrupts to shut down the CPU (some cases of this are bare hlts)
3) bare_hlt - hlt for other reasons than the above, or in regions know to already have interrupts enabled, thus avoiding the extra sti. This avoidance is pretty silly, considering the only bare halts I believe are in bootup code.

We had this triple abstraction in VMI when it was a subarch, but it was unclear it was worth imposing on places that weren't really applicable to a virtualization context.

In short, perhaps it is best to separate safe_halt vs shutdown_halt and unconditionally use sti; hlt or cli; hlt instead of providing a bare halt paravirt op.

Zach