On Sat, Feb 12, 2011 at 12:45 AM, Michael Walle <mich...@walle.cc> wrote: > Am Freitag 11 Februar 2011, 21:41:14 schrieb Blue Swirl: >> > +Special instructions >> > +-------------------- >> > +The translation recognizes one special instruction to halt the cpu: >> > + and r0, r0, r0 >> > +On real hardware this instruction is a nop. It is not used by GCC and >> > +should (hopefully) not be used within hand-crafted assembly. >> > +Insert this instruction in your idle loop to reduce the cpu load on the >> > +host. >> >> It would be better to use MMIO or privileged instruction for this >> instead of changing an unprivileged instruction. > > MMIO can't be used as that would have an impact on real hardware? The idea is > to use this instruction for both the real hardware and QEMU.
Then it's OK. In general, if this were a QEMU only solution (like I thought), then new instruction would have been a bit less attractive than MMIO, which can be ignored on real HW, remapped by a kernel with MMU (which you don't have) etc.