aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/nmi.c
Commit message (Collapse)AuthorAgeFilesLines
* x86/watchdog: Tweak implementation given new common codeAndrew Cooper2013-08-131-2/+1
| | | | | Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* watchdog: Move watchdog from being x86 specific to common codeAndrew Cooper2013-08-131-1/+7
| | | | | | | | | | | | | | | Augment watchdog_setup() to be able to possibly return an error, and introduce watchdog_enabled() as a better alternative to knowing the architectures internal details. This patch does not change the x86 implementaion, beyond making it compile. For header files, some includes of xen/nmi.h were only for the watchdog functions, so are replaced rather than adding an extra include of xen/watchdog.h Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: move watchdog declarations from config.h to nmi.hJan Beulich2013-02-151-0/+1
| | | | | | | They don't belong into the former. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/nmi: self_nmi() should not unconditionally enable interruptsAndrew Cooper2012-11-151-3/+4
| | | | | | | | | It seems that all current callers have interrupts enabled, making the code currently safe but dangerous. Also, fix a trailing whitespace issue. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* printk: prefer %#x et at over 0x%xJan Beulich2012-09-211-1/+1
| | | | | | | | | Performance is not an issue with printk(), so let the function do minimally more work and instead save a byte per affected format specifier. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: also allow disabling LAPIC NMI watchdog on newer CPUsJan Beulich2012-08-021-7/+1
| | | | | | | | This complements c/s 9146:941897e98591, and also replaces a literal zero with a proper manifest constant. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* NMI: Command line parameter for watchdog timeoutAndrew Cooper2012-03-081-2/+15
| | | | | | | | | | Introduce a command parameter to set the watchtog timeout. Manually specifying "watchdog_timeout=<seconds>" on the command line will also turn the watchdog on. For consistency, move opt_watchdog into nmi.c along with opt_watchdog_timeout. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* x86: fix boot-time watchdog test.Tim Deegan2011-06-281-1/+11
| | | | | | | | | | Since the perf counter that the LAPIC NMI watchdog uses only runs while the core isn't halted, and all APs are idle at this point in the boot process, it's possible that remote CPUs won't see any NMIs during the 10-tick waiting period. Force all CPUs to busy-wait so we know the timers are running. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* move register_cpu_notifier() into .init.textJan Beulich2011-04-021-5/+7
| | | | | | | With no modular drivers, all CPU notifier setup is supposed to happen during boot. There also is a respective comment in the function.=20 Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: use rdmsrl/wrmsrlKeir Fraser2010-06-241-6/+6
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86: Streamline the CPU early boot process.Keir Fraser2010-05-191-5/+2
| | | | | | | | | | | | Mainly this involves getting rid of a bunch of cpumasks and replacing with a single 'cpu_state' enumeration to track progress and allow master-slave handshaking. Cleaning this stuff up is a prerequisite for safely handling slave failure (e.g., out of memory, invalid slave CPU capabilities, ...). This will get fixed up in a future patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 nmi: Enable/disable dynamically on each CPU during hotplug.Keir Fraser2010-05-191-4/+29
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Dynamically allocate percpu data area when a CPU comes online.Keir Fraser2010-05-181-1/+1
| | | | | | At the same time, the data area starts life zeroed. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Add MSR support for various feature AMD processor families.Keir Fraser2010-05-151-1/+1
| | | | Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
* Remove many uses of cpu_possible_map and iterators over NR_CPUS.Keir Fraser2010-05-141-1/+1
| | | | | | | The significant remaining culprits for x86 are credit2, hpet, and percpu-area subsystems. To be dealt with in a separate patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: fix MCE/NMI injectionKeir Fraser2009-12-011-2/+3
| | | | | | | | | | | | | | | | | | | | This attempts to address all the concerns raised in http://lists.xensource.com/archives/html/xen-devel/2009-11/msg01195.html, but I'm nevertheless still not convinced that all aspects of the injection handling really work reliably. In particular, while the patch here on top of the fixes for the problems menioned in the referenced mail also adds code to keep send_guest_trap() from injecting multiple events at a time, I don't think the is the right mechanism - it should be possible to handle NMI/MCE nested within each other. Another fix on top of the ones for the earlier described problems is that the vCPU affinity restore logic didn't account for software injected NMIs - these never set cpu_affinity_tmp, but due to it most likely being different from cpu_affinity it would have got restored (to a potentially random value) nevertheless. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* VMX: issue an NMI rather than just calling the NMI handlerKeir Fraser2009-08-141-4/+7
| | | | | | | when the VMEXIT code indicates that an NMI has been raised. Otherwise we might hit a real NMI while in the handler. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Add a single trigger for all diagnostic keyhandlersKeir Fraser2009-08-021-2/+13
| | | | | | | | | | Add a new keyhandler that triggers all the side-effect-free keyhandlers. This lets automated tests (and users) log the full set of keyhandlers without having to be aware of which ones might reboot the host. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Rename for_each_cpu() to for_each_possible_cpu()Keir Fraser2009-07-151-1/+1
| | | | | | ... to be more precise in naming, and also to match Linux. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86_64: allow more vCPU-s per guestKeir Fraser2009-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the shared info layout is fixed, guests are required to use VCPUOP_register_vcpu_info prior to booting any vCPU beyond the traditional limit of 32. MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no longer being exposed in the public headers. The tools changes are clearly incomplete (and done only so things would build again), and the current state of the tools (using scalar variables all over the place to represent vCPU bitmaps) very likely doesn't permit booting DomU-s with more than the traditional number of vCPU-s. Testing of the extended functionality was done with Dom0 (96 vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way of a simple kernel side patch - to use only some, resulting in a sparse bitmap). ia64 changes only to make things build, and build-tested only (and the tools part only as far as the build would go without encountering unrelated problems in the blktap code). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: Make the num_siblings CPU parameter per-CPU.Keir Fraser2009-01-221-1/+1
| | | | | | | | | While it is unlikely that a system has a different number of siblings for different physical CPUs, make this parameter per-CPU for consistency, and deal with the (so far theoretical) case that this is different per CPU package. Signed-off-by: Frank van der Linden <Frank.Vanderlinden@Sun.COM>
* NMI watchdog: don't try to run too slow.Keir Fraser2008-10-201-3/+10
| | | | | | | The way MSR writes of performance counters works means that Intel CPUs running faster than about 2.1GHz can't set the NMI timer to 1Hz. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* NMI watchdog: use new counter on Core/Core2 CPUsKeir Fraser2008-10-171-5/+7
| | | | | | | The old CPU_CLK_UNHALTED performance counter no longer runs on Core or Core2 CPUs. Use the new CPU_CLK_UNHALTED.CORE_P one. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Fix misc issues related to allowing support of more CPUsKeir Fraser2008-09-221-1/+1
| | | | | | | | | | This mainly means removing stack variables that (should) depend on NR_CPUS (other than cpumask_t ones) and adjusting certain array sizes. There's at least one open tools issue: The 'xm vcpu-pin' path assumes a maximum of 64 CPU-s in many places. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: MCA support.Keir Fraser2008-07-041-2/+2
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86: Support x2APIC mode.Keir Fraser2008-05-011-3/+2
| | | | Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
* x86: AMD Fam10/11 adjustmentsKeir Fraser2007-10-111-2/+7
| | | | | | | Signed-off-by: Jan Beulich <jbeulich@novell.com> Sync up affected files with 2.6.23-rc9. Signed-off-by: Keir Fraser <keir@xensource.com>
* Convert __init into __devinit in wakeup path.kfraser@localhost.localdomain2007-07-111-1/+1
| | | | | | | | | | | | | Need to ensure all the code slice in the wakeup path still existing. For this purpose, we have to use __devinit instead of __init, since the former is null for CONFIG_HOTPLUG while the latter always causes related code to be free-ed after first boot. Later when adding __init to some function, be sure to consider wakeup case and cpu hotplug! Signed-off-by <Kevin.Tian@intel.com>
* xen: Remove {nmi_pending,nmi_masked,paused} vcpu bitflags.kfraser@localhost.localdomain2007-03-291-7/+7
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Indentation cleanups (remove hard tabs).kfraser@localhost.localdomain2006-08-171-4/+4
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Assorted further PER_CPU- or read_mostly-ifications.kaf24@firebug.cl.cam.ac.uk2006-08-081-19/+17
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Simplify the Xen genapic code. Many genapic hooks have beenkaf24@firebug.cl.cam.ac.uk2006-04-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | replaced with unconditional static 'sane' implementations. Functions relating to interrupt/IPI delivery have been grouped into two sets: physical delivery and logical-flat delivery. All subarchitectures use physical delivery except the basic default subarchitecture. The main behavioural changes are: 1. Summit no longer uses logical-clustered delivery mode 2. Physical mode no longer makes any pretence to set the LDR sanely. We never deliver interrupts in logical mode so this really should not matter. 3. Sanity checking of phys_cpu_present_map is enabled for all subarchitectures. Really we should have a sane set of APIC IDs in the system, as we rely on them for physical delivery mode. 4. We enable 'bigsmp' mode on any system with more than eight CPUs. The previous xAPIC check was unnecessary, since our bigsmp mode uses physical delivery, not logical-clustered. This all obviously needs testing on some big systems. Signed-off-by: Keir Fraser <keir@xensource.com>
* Allow NMI watchdog setup on newer P4 processors.kaf24@firebug.cl.cam.ac.uk2006-03-061-6/+0
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Make all nmi debugkey tracing arch specific.kaf24@firebug.cl.cam.ac.uk2006-01-131-0/+22
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix up the way we initialise and set the NMI heartbeatkaf24@firebug.cl.cam.ac.uk2006-01-131-42/+23
| | | | | | | | | | 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>
* Debug keyhandlers for triggering an NMI and examine current NMI state.Ian.Campbell@xensource.com2006-01-131-0/+25
| | | | | | | | | | | | | 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>
* Ensure watchdog remains disabled unless enabled on the command line.Ian.Campbell@xensource.com2006-01-131-6/+14
| | | | | | | | | | | | | 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>
* Rename ac_timer_* interfaces -> timer_*. The ac_ iskaf24@firebug.cl.cam.ac.uk2006-01-121-4/+4
| | | | | | | | | | meaningless and unnecessary. Rename rem_timer -> stop_timer. Signed-off-by: Keir Fraser <keir@xensource.com>
* Pull nmi/traps changes from Linux 2.6.14.kaf24@firebug.cl.cam.ac.uk2005-12-061-16/+124
| | | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Upgrade Xen's msr.h to include definitions from Linux 2.6.14.kaf24@firebug.cl.cam.ac.uk2005-11-151-12/+7
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1770 (42c2d66cG6YTU0WhG1b97E-InSNWWA)kaf24@firebug.cl.cam.ac.uk2005-06-291-1/+15
| | | | | | | Ensure global variables required by get_s_time() are initialised before first use. Rejuggle bootstrap code slightly. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1653 (429f7931iJ8kgS9qBlBbtyY9irorQA)cl349@firebug.cl.cam.ac.uk2005-06-021-0/+1
| | | | | | | Many files: More include cleanups towards "include where it's used". Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* bitkeeper revision 1.1651 (429f70102tptpkVKU9_mkUC4olK_-Q)cl349@firebug.cl.cam.ac.uk2005-06-021-1/+1
| | | | | | | | | | Many files: More include cleanups towards "include where it's used". sched.h: g/c unneeded include. include xen/spinlock.h once should be enough. Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
* bitkeeper revision 1.1566 (4295f4d0ecoRI1FVDrCqrrfgF5j8ug)kaf24@firebug.cl.cam.ac.uk2005-05-261-64/+57
| | | | | | Clean up NMI watchdog handler. No need to hack into ac_timer structs. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1548 (4294554btfa2GpomqV57KFpxEHsjEA)kaf24@firebug.cl.cam.ac.uk2005-05-251-10/+6
| | | | | | | | | Move to Linux's cpumask_t and 'hotplug' multi-processor booting interfaces. This also brings apic.c and various other files closer to their Linux 2.6 equivalents. Simplified the scheduler interfaces a little (particularly per-cpu and idle-domain initialisation). Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1413 (42886cbcgOQRttqbKGwhoGUdvq0jbg)kaf24@firebug.cl.cam.ac.uk2005-05-161-1/+22
| | | | | | | Fix the watchdog disable/enable interface. This cleans up common code somewhat. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1389.10.1 (427fa2d3ZV92f_ErvLuIzWbV1f67QA)kaf24@firebug.cl.cam.ac.uk2005-05-091-7/+3
| | | | | | | Phase 1 of upgrading platform code to be derived from Linux 2.6.11 rather than 2.4.x. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1389.1.2 (4270ed5dZvr_HdIQR0eBM2m4Kj81_A)kaf24@firebug.cl.cam.ac.uk2005-04-281-1/+1
| | | | | | | | | Renames: execution_context/xen_regs -> cpu_user_regs full_execution_context -> vcpu_guest_context [defined both 'struct xxx' and 'xxx_t' forms] Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1236.1.124 (42429eb8uGingMvF7MF3Py6CUzFBzA)kaf24@firebug.cl.cam.ac.uk2005-03-241-1/+1
| | | | | | | | NMI watchdog hooks off ac_timer softirq rather than apic timer irq. In extreme situations we may service ac_timer events without ever actually taking an apic interrupt. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1159.212.30 (41f5268cMEdHLMEMs4o0SWqVEHZvuw)mafetter@fleming.research2005-01-241-6/+3
| | | | | | | Minor cleanup. Removed some duplicate MSRs, fixed some MSR names, added a few new MSRs and MSR bit fields. Signed-off-by: michael.fetterman@cl.cam.ac.uk