aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/keyhandler.c
Commit message (Collapse)AuthorAgeFilesLines
* debug: remove some event channel info from the 'i' and 'q' debug keysDavid Vrabel2013-10-141-9/+2
| | | | | | | | | | | | | The 'i' key would always use VCPU0's selector word when printing the event channel state. Remove the incorrect output as a subsequent change will add the (correct) information to the 'e' key instead. When dumping domain information, printing the state of the VIRQ_DEBUG port is redundant -- this information is available via the 'e' key. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: remove evtchn_upcall_mask from interface on ARMIan Campbell2013-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | On ARM event-channel upcalls are masked using the hardware's interrupt mask bit and not by a software bit. Leaving this field present in the interface has caused some confusion already and is liable to mean it gets inadvertently used in the future. So arrange for this field to be turned into a padding field on ARM by introducing a XEN_HAVE_PV_UPCALL_MASK define. This bit is also unused for x86 PV-on-HVM guests, but we can't realistically distinguish those from x86 PV guests in the headers. Add a per-arch vcpu_event_delivery_is_enabled function to replace an open coded use of evtchn_upcall_mask in common code (in a debug keyhandler). The existing local_event_delivery_is_enabled, which operates only on current, was unimplemented on ARM and unused on x86, so remove it. ifdef the use of evtchn_upcall_mask when setting up a new vcpu info page. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* watchdog: Move watchdog from being x86 specific to common codeAndrew Cooper2013-08-131-1/+1
| | | | | | | | | | | | | | | 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>
* xen: allow for explicitly specifying node-affinityDario Faggioli2013-04-171-0/+11
| | | | | | | | | | | | | | | Make it possible to pass the node-affinity of a domain to the hypervisor from the upper layers, instead of always being computed automatically. Note that this also required generalizing the Flask hooks for setting and getting the affinity, so that they now deal with both vcpu and node affinity. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* 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/mm: Output domain count of paged pages in consoleAndres Lagar-Cavilla2012-01-261-2/+4
| | | | | | | Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* Add the ability to poll stats about shared memory via the consoleAndres Lagar-Cavilla2012-01-261-2/+5
| | | | | | | Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* Include some header files that are not automatically included on all archsStefano Stabellini2012-01-231-0/+1
| | | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* debug: Add domain/vcpu pause_count info to 'd' key.Keir Fraser2011-11-221-5/+7
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* eliminate first_cpu() etcJan Beulich2011-11-081-1/+1
| | | | | | | | This includes the conversion from for_each_cpu_mask() to for_each-cpu(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
* allocate CPU sibling and core maps dynamicallyJan Beulich2011-10-211-1/+1
| | | | | | | | | | ... thus reducing the per-CPU data area size back to one page even when building for large NR_CPUS. At once eliminate the old __cpu{mask,list}_scnprintf() helpers. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* eliminate direct assignments of CPU masksJan Beulich2011-10-211-9/+8
| | | | | | | | | | | | | | | | Use cpumask_copy() instead of direct variable assignments for copying CPU masks. While direct assignments are not a problem when both sides are variables actually defined as cpumask_t (except for possibly copying *much* more than would actually need to be copied), they must not happen when the original variable is of type cpumask_var_t (which may have lass space allocated to it than a full cpumask_t). Eliminate as many of such assignments as possible (in several cases it's even possible to collapse two operations [copy then clear one bit] into one [cpumask_andnot()]), and thus set the way for reducing the allocation size in alloc_cpumask_var(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* eliminate cpumask accessors referencing NR_CPUSJan Beulich2011-10-211-1/+1
| | | | | | | ... in favor of using the new, nr_cpumask_bits-based ones. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* introduce and use nr_cpu_ids and nr_cpumask_bitsJan Beulich2011-10-211-1/+1
| | | | | | | | | | | | | | | The former is the runtime equivalent of NR_CPUS (and users of NR_CPUS, where necessary, get adjusted accordingly), while the latter is for the sole use of determining the allocation size when dynamically allocating CPU masks (done later in this series). Adjust accessors to use either of the two to bound their bitmap operations - which one gets used depends on whether accessing the bits in the gap between nr_cpu_ids and nr_cpumask_bits is benign but more efficient. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* convert more literal uses of cpumask_t to pointersJan Beulich2011-09-181-5/+5
| | | | | | | This is particularly relevant as the number of CPUs to be supported increases (as recently happened for the default thereof). Signed-off-by: Jan Beulich <jbeulich@suse.com>
* xen: remove extern function declarations from C files.Tim Deegan2011-05-261-5/+1
| | | | | | | | Move all extern declarations into appropriate header files. This also fixes up a few places where the caller and the definition had different signatures. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Remove direct cpumask_t members from struct vcpu and struct domainJan Beulich2011-04-051-3/+3
| | | | | | | | | | | | | | | The CPU masks embedded in these structures prevent NR_CPUS-independent sizing of these structures. Basic concept (in xen/include/cpumask.h) taken from recent Linux. For scalability purposes, many other uses of cpumask_t should be replaced by cpumask_var_t, particularly local variables of functions. This implies that no functions should have by-value cpumask_t parameters, and that the whole old cpumask interface (cpus_...()) should go away in favor of the new (cpumask_...()) one. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* re-add calls accidentally deleted from run_all_nonirq_keyhandlers()Keir Fraser2010-12-241-0/+4
| | | | | | | | | | c/s 22538:a3a29e67aa7e, having got applied in a form different from the one submitted, resulted in the calls to console_{start,end}_log_everything() getting removed without replacement. Add them back since, other than run_all_keyhandlers(), this doesn't run with log-everything already in effect. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Reduce side effects of handling '*' debug keyKeir Fraser2010-12-151-4/+5
| | | | | | | NMI watchdog should be suppressed when dumping IRQ handlers. Softirqs should be handled periodically while processing non-IRQ handlers. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* xen: Send the debug VIRQ to guests after the rest of the domain dump is done.Keir Fraser2010-07-161-3/+12
| | | | | | | | Send the debug VIRQ to guests after the rest of the domain dump is done. This stops all the 'q' debug-key output getting interleaved with the debug-virq output from a pv-ops dom0 kernel. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Eliminate unnecessary NR_CPUS-sized arrays from 't' key handlerKeir Fraser2010-07-091-14/+18
| | | | | | Replace them with per-CPU data. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Watchdog timers for domainsKeir Fraser2010-06-041-0/+5
| | | | | | | | Each domain is allowed to set, reset and disable its timers; when any timer runs out the domain is killed. Patch from Christian Limpach <Christian.Limpach@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
* Reduce 'd' debug key's global impactKeir Fraser2010-05-061-16/+45
| | | | | | | | | | | | | | | | | | | | On large systems, dumping state may cause time management to get stalled for so long a period that it wouldn't recover. Therefore alter the state dumping logic to alternatively block each CPU as it prints rather than one CPU for a very long time (using the alternative key handling toggle introduced with an earlier patch). Further, instead of using on_selected_cpus(), which is unsafe when the dumping happens from a hardware interrupt, introduce and use a dedicated IPI sending function (which each architecture can implement to its liking) Finally, don't print useless data (e.g. the hypervisor context of the interrupt that is used for triggering the printing, but isn't part of the context that's actually interesting). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Reduce '0' debug key's global impactKeir Fraser2010-05-061-0/+51
| | | | | | | | On large systems, dumping state may cause time management to get stalled for so long a period that it wouldn't recover. Therefore add a tasklet-based alternative mechanism to handle Dom0 state dumps. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Move tasklet implementation into its own source files.Keir Fraser2010-04-191-1/+1
| | | | | | | | This is preparation for implementing tasklets in vcpu context rather than softirq context. There is no change to the implementation of tasklets in this patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* keyhandler: Do not serialise keyhandlers; increase scratch array size.Keir Fraser2010-02-121-11/+1
| | | | | | | | | | | | | Although serialising keyhandlers is safer, and in particular protects access to shared heyhandler_scratch[], in debug scenarios it is probably better to 'have a go' when requested - and assume the user knows what they are doing. Meanwhile, increase scratch array size to 1024. That's enough for more than a dozen lines of 80-column text, and should be plenty in any practical situation. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* keyhandler: global shared scratch space for temporary stringsKeir Fraser2010-02-111-7/+16
| | | | | | | Put one static definition in one place and we can make it as big as we think reasonable. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Disable watchdog in dump_registersKeir Fraser2009-12-141-0/+2
| | | | | | Avoids triggering watchdog if serial port output is slow. Signed-off-by: Andrew Lyon <andrew.lyon@gmail.com>
* Point per-vcpu vcpu_info at a dummy structure by default, avoidingKeir Fraser2009-10-291-4/+2
| | | | | | need for scattered NULL-pointer checks. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Spinlock profiling (enable in build with lock_profile=y)Keir Fraser2009-10-141-0/+20
| | | | | | | Adds new tool xenlockprof to run from dom0. From: Juergen Gross <juergen.gross@ts.fujitsu.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Add a single trigger for all diagnostic keyhandlersKeir Fraser2009-08-021-63/+134
| | | | | | | | | | 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>
* x86_64: allow more vCPU-s per guestKeir Fraser2009-06-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove unused 'retry' parameter from on_selected_cpus() etc.Keir Fraser2009-05-271-2/+2
| | | | | | | Remove the unused "retry" parameter of on_selected_cpus(), on_each_cpu(), smp_call_function(), and smp_call_function_single(). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Pass cpumasks by reference always.Keir Fraser2009-05-271-1/+1
| | | | | | | | | | | | | Rather than passing cpumasks by value in all cases (which is problematic for large NR_CPUS configurations), pass them 'by reference' (i.e. through a pointer to a const cpumask). On x86 this changes send_IPI_mask() to always only send IPIs to remote CPUs (meaning any caller needing to handle the current CPU as well has to do so on its own). Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Fix event-channel access for 32-bit HVM guests.Keir Fraser2009-03-031-1/+1
| | | | | | Based on a patch by Joe Jin <joe.jin@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Print domain max_pages in 'q' debug output.Keir Fraser2009-01-081-2/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Print d->is_dying when dumping domain info.Keir Fraser2008-10-271-2/+2
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Add debug key 'e' for event channel informationKeir Fraser2008-09-221-2/+2
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Delay 5 seconds on reboot *after* stopping all CPUs.Keir Fraser2008-08-041-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: extend debug key 't' to collect useful clock skew infoKeir Fraser2008-07-281-14/+38
| | | | | | | | | | | | | | | | | By repeating "xm debug-key t; xm dmesg | tail -N" in dom0 (e.g. with the "watch" command), useful skew info about the machine can be collected, which will be very helpful for diagnosing customer problems on misbehaving machines. Patch details: 1) Min and max readings from the current sample are useless so get rid of those but retain the current maxdif (stime skew). 2) Remember max of skew, sum of skews, and a count so average skew can be displayed. 3) Also record info for cycles (tsc on x86, itc on ia64). Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* Fix debug key t to avoid irq jitter.Keir Fraser2008-07-211-0/+2
| | | | | From: Dan Magenheimer <dan.magenheimer@oracle.com> Siigned-off-by: Keir Fraser <keir.fraser@citrix.com>
* Bring back console_start_log_everything() as a milder alternative toKeir Fraser2008-06-131-4/+9
| | | | | | | | | | console_start_sync(). Revert keyhandler logic to use it. The difference now is that serial logic is updated to not drop characters if inb a log_everything region. Still this is milder than a sync region since the async buffer must be filled before we start to busy-wait on each character. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Improve serial output when dropping characters to drop them in bigKeir Fraser2008-06-131-9/+4
| | | | | | | | batches. Printing one character in one thousand is not useful! Also make debug handlers all print synchronously. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* dom0 state dumpKeir Fraser2008-06-121-0/+16
| | | | | | | | | | Since xenctx cannot (for obvious reasons) display the context of dom0's vCPU-s, here are the beginnings of a console based mechanism to achieve the same (useful if dom0 hangs with one or more de-scheduled vCPU-s). The stack handling obviously needs improvement, but the register context should come out fine in all cases. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* keyhandler: When dumping all-CPU register state, wnter console syncKeir Fraser2008-06-121-0/+5
| | | | | mode so we do not drop any critical debug data. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Turn some simple softirqs into tasklets.Keir Fraser2008-04-111-4/+4
| | | | | | TRACE_SOFTIRQ does not appear to be necessary at all. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Allow bitop functions to be applied only to fields of at least 4Keir Fraser2008-03-161-3/+3
| | | | | | | | | | | | | bytes. Otherwise the 'longword' processor instructions used will overlap with adjacent fields with unpredictable consequences. This change requires some code fixup and just a few casts (mainly when operating on guest-shared fields which cannot be changed, and which by observation are clearly safe). Based on ideas from Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix gdb debugging of hypervisor.Keir Fraser2007-12-121-0/+1
| | | | | | | | | | | | | This patch: * enables the gdbstubs to properly access hypervisor memory; * prevents an assertion failure in __spurious_page_fault's call to map_domain_page if such accesses fail, by testing in_irq(); * prints some additional helpful messages; * fixes the endianness of register transfers from the gdbstubs so that gdb is much less confused. * fixes the documentation in docs/misc/crashdb.txt Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Change prototype of machine_restart to void machine_restart(void).kfraser@localhost.localdomain2007-09-101-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>