If the guest context is VM86 then we need to treat ss:sp as 16 bit
segment:offset rather than 32 bit selector:offset.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
lock' on a particular VCPU. Since this requires acquiring
the approrpiate per-CPU lock, we must re-check the VCPU's
current CPU binding after the lock is acquired.
Signed-off-by: Keir Fraser <keir@xensource.com>
timers. Also, compund updates to APIC ICR and ICR2 registers
must be done with interrupts disabled to ensure local
atomicity.
Signed-off-by: Keir Fraser <keir@xensource.com>
Add 'N' keyhandler to dump the current per CPU NMI counts and the
current NMI mask/pending status.
Add 'n' keyhandler to trigger an NMI by sending an IPI. For some
reason the destination shorthand for self is not valid when used with
the NMI delivery mode so we send the IPI to our own APIC ID
explicitly.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Bail out of setup_apic_nmi_watchdog() early if watchdog is not
enabled. Is the watchdog is disabled then increment
watchdog_disable_count to prevent it ever becoming enabled.
Unconditionally call setup_apic_nmi_watchdog() from setup_local_APIC()
so that the above is guaranteed to have occurred before the first call
of watchdog_enable().
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
'opposite' of init_timer(), it marks the end of a timer's
lifetime. After this call the timer will not be pending,
its callback handler will not be running, and future calls
to set_timer() will silently fail.
Signed-off-by: Keir Fraser <keir@xensource.com>
rewritten from scratch a couple of times now and it's safe
to assert that the original Linux heritage was deleted
long ago.
Signed-off-by: Keir Fraser <keir@xensource.com>
offending caller that broke the vcpu cache (writable
pagetable code kept a mapping outstanding until flush,
which could occur on a different vcpu).
Signed-off-by: Keir Fraser <keir@xensource.com>
gmp dev files are installed. If files are missing, Makefile exits with a
message indicating that these tools will not be built, rather than an
error, which prevents Xen from building.
Signed-off-by: Vinnie Scarlata <vincent.r.scarlata@intel.com>
and definition of xc_linux_save(). In particular the argument for
the suspend pointer to function was null in one and int in the other.
On inspection, int seemed to be correct, so I went with this.
I also fixed up a few other cosmetic discrepancies.
Signed-Off-By: Horms <horms@verge.net.au>
The NMI handler is not built unless CONFIG_X86_LOCAL_APIC is defined, and
CONFIG_X86_LOCAL_APIC requires a dom0 build.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
EFLAGS that we do not pull in non-zero IOPL, then crash
the domain, and then bug out when dom0 gets vcpu context.
This could otherwise be triggered by a malicious guest.
Signed-off-by: Keir Fraser <keir@xensource.com>
Improve mapping slot search by using a free bitmap.
Removed map_domain_pages (multi-page mapping functionality).
Noone uses it, nor should they use it in future,
Signed-off-by: Keir Fraser <keir@xensource.com>
Register our NMI handler with Xen. Do an iret via the hypervisor
whenever the return CS is > RING0.
Add include/asm-xen/asm-x86_64/nmi.h as a Xen modified copy of
include/asm-x86_64/nmi.h in order that we can implement
get_nmi_reason() in a manner suitable for Xen.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Register our NMI handler with Xen. Use a pseudo-flag in EFLAGS in
indicate that we should return from the NMI via a hypervisor iret.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Handle NMI interrupts and dispatch to dom0 on x86_64.
Renames the switch_to_user hypercall to iret. Extend the semantics to
include returns to guest/kernel if CS indicates ring 1. Retain the old
semantics of returning to guest/user if CS indicates ring3.
Plumb in nmi_op hypercall to generic code.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
Handle NMI interrupts and dispatch to dom0 on x86_32.
Renames the switch_vm86 hypercall to iret and implements full iret
semantics instead only what is required by VM86 returns.
Plumb in nmi_op hypercall to generic code.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
This patch adds core and generic x86 support code to enable Xen to
pass NMI's to a dedicated NMI callback in DOM0 instead of raising a
VIRQ.
Introduces the nmi_op hypercall to allow DOM0 to (un)register the NMI
handler.
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>