kvm: reset state from the CPU's reset method

Now that we have a CPU object with a reset method, it is better to
keep the KVM reset close to the CPU reset.  Using qemu_register_reset
as we do now keeps them far apart.

Reviewed-by: Gleb Natapov <gnatapov@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
kvm: forward INIT signals coming from the chipset

Reviewed-by: Gleb Natapov <gnatapov@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
x86: SMBASE is not reset by INIT#

An INIT reset does not change SMBASE back to 0x30000.  Save the
current value and restore it after cpu_reset.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
apic: do not accept SIPI on the bootstrap processor

SIPI interrupts are ignored on the bootstrap.  Never accept one.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpu: make CPU_INTERRUPT_RESET available on all targets

On the x86, some devices need access to the CPU reset pin (INIT#).
Provide a generic service to do this, using one of the internal
cpu_interrupt targets.  Generalize the PPC-specific code for
CPU_INTERRUPT_RESET to other targets.

Since PPC does not support migration, I picked the value that
is used on x86, CPU_INTERRUPT_TGT_INT_1.  Consequently, TGT_INT_2
and TGT_INT_3 are shifted down by one while keeping their value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
pc: port 92 reset requires a low->high transition

The PIIX datasheet says that "before another INIT pulse can be
generated via [port 92h], [bit 0] must be written back to a
zero.

This bug is masked right now because a full reset will clear the
value of port 92h.  But once we implement soft reset correctly,
the next attempt to enable the A20 line by setting bit 1 (and
leaving the others untouched) will cause another reset.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
x86: correctly implement soft reset

Do not do a hard reset for port 92h, keyboard controller, or cf9h soft reset.
These only reset the CPU.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
apic: introduce more symbolic constants

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>