aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/spinlock.h
Commit message (Collapse)AuthorAgeFilesLines
* spinlock: ensure the flags parameter is wide enoughstagingAndrew Cooper2013-10-221-3/+15
| | | | | | | | | | Because of the construction of spin_lock_irq() (and varients), the flags parameter could be trucated. Use a BUILD_BUG_ON() to verify the width of the parameter. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* eliminate lock profile pointer from spinlock structure when !LOCK_PROFILEJan Beulich2012-08-071-2/+3
| | | | | | | | This pointer is never used for anything, and needlessly increases the memory footprint of various pieces of data. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: define __section() and friends and use them for section annotations.Tim Deegan2012-04-111-2/+2
| | | | | | | | | By itself this is just code-tidying, but it's also useful for the following patch, which will adjust __section() for clang compiles. Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* force inclusion of xen/config.h through compiler optionJan Beulich2012-01-131-1/+0
| | | | | | | | | | | | | As we expect all source files to include the header as the first thing anyway, stop doing this by repeating the inclusion in each and every source file (and in many headers), but rather enforce this uniformly through the compiler command line. As a first cleanup step, remove the explicit inclusion from all common headers. Further cleanup can be done incrementally. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Make lock profiling usable againJuergen Gross2011-11-071-11/+23
| | | | | | | | | | | | Using lock profiling (option lock_profile in xen/Rules.mk) resulted in build errors. Changes: - Include public/sysctl.h in spinlock.h when using lock profiling. - Allocate profile data in an own structure to avoid struct domain becoming larger then one page Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: remove extern function declarations from C files.Tim Deegan2011-05-261-0/+4
| | | | | | | | 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 spin_barrier_irq(). It is pointless.Keir Fraser2011-03-261-2/+0
| | | | | | | | Add a barrier-appropriate consistency check to spinlock.c, and add code comments to explain why barrier operations are more relaxed than lock-acquisition operations. Signed-off-by: Keir Fraser <keir@xen.org>
* rwlock: Allow to scale to 2^31-1 readers on x86.Keir Fraser2011-03-261-0/+2
| | | | | | | | | Also rework to match the 'trylock' style of raw function used for spinlocks. Inspired by Jan Beulich's patch to do similar improved scaling. Signed-off-by: Keir Fraser <keir@xen.org>
* Define Linux-style <preempt.h> interface.Keir Fraser2010-11-181-2/+0
| | | | | | Use it to disable sleeping in spinlock and rcu-read regions. Signed-off-by: Keir Fraser <keir@xen.org>
* Add locking-depth debugging, introduce in_atomic() boolean.Keir Fraser2010-11-161-0/+2
| | | | | | | This will be useful for debugging use of sleep-in-hypervisor primitives. Signed-off-by: Keir Fraser <keir@xen.org>
* Implement ACPI APEI ERST featureKeir Fraser2010-08-221-0/+7
| | | | | | | | | | | | | | | | | APEI are ACPI4.0 new features. It consists of ERST, BERT, HEST, and EINJ. ERST is used to save fault error log to a platform persistent storage, so that when reboot os can retrieve the error log and handle it. This patch is used to implement ERST feature to Xen. It consists of 3-level hierarchy: operation level, action level, and instru= ction level. Instruction do basic io; Action done by sequential instructions parsed from ACPI ERST table; Operation done by sequential actions defined by ACPI spec, providing erst_write/ erst_read/ erst_clear interfaces to MCE/ NMI/ PCIe error handling mechanism, etc. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
* Move cpu hotplug routines into common cpu.c file.Keir Fraser2010-05-141-0/+2
| | | | | | | | | Also simplify the locking (reverting to use if spin_trylock, as returning EBUSY/EAGAIN seems unavoidable after all). In particular this should continue to ensure that stop_machine_run() does not have cpu_online_map change under its feet. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* lockprof: Fix x86_32 build and clean up coding styleKeir Fraser2009-10-151-4/+4
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Spinlock profiling (enable in build with lock_profile=y)Keir Fraser2009-10-141-2/+95
| | | | | | | 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>
* Transcendent memory ("tmem") for Xen.Keir Fraser2009-05-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tmem, when called from a tmem-capable (paravirtualized) guest, makes use of otherwise unutilized ("fallow") memory to create and manage pools of pages that can be accessed from the guest either as "ephemeral" pages or as "persistent" pages. In either case, the pages are not directly addressible by the guest, only copied to and fro via the tmem interface. Ephemeral pages are a nice place for a guest to put recently evicted clean pages that it might need again; these pages can be reclaimed synchronously by Xen for other guests or other uses. Persistent pages are a nice place for a guest to put "swap" pages to avoid sending them to disk. These pages retain data as long as the guest lives, but count against the guest memory allocation. Tmem pages may optionally be compressed and, in certain cases, can be shared between guests. Tmem also handles concurrency nicely and provides limited QoS settings to combat malicious DoS attempts. Save/restore and live migration support is not yet provided. Tmem is primarily targeted for an x86 64-bit hypervisor. On a 32-bit x86 hypervisor, it has limited functionality and testing due to limitations of the xen heap. Nearly all of tmem is architecture-independent; three routines remain to be ported to ia64 and it should work on that architecture too. It is also structured to be portable to non-Xen environments. Tmem defaults off (for now) and must be enabled with a "tmem" xen boot option (and does nothing unless a tmem-capable guest is running). The "tmem_compress" boot option enables compression which takes about 10x more CPU but approximately doubles the number of pages that can be stored. Tmem can be controlled via several "xm" commands and many interesting tmem statistics can be obtained. A README and internal specification will follow, but lots of useful prose about tmem, as well as Linux patches, can be found at http://oss.oracle.com/projects/tmem . Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
* Clean up use of spin_is_locked() and introduce rw_is_locked().Keir Fraser2008-12-131-1/+5
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* spinlock: Add debug-build checks for IRQ-safe spinlocks.Keir Fraser2008-10-231-2/+19
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Define spin_barrier_irq() for IRQ-safe spinlocks, and use it for virq_lock.Keir Fraser2008-10-221-0/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* spinlock: Modify recursive spinlock definitions to support up to 4095 CPUs.Keir Fraser2008-10-201-3/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Clean up spinlock operations and compile as first-class functions.Keir Fraser2008-10-201-77/+79
| | | | | | | | This follows modern Linux, since apparently outlining spinlock operations does not slow down execution. The cleanups will also allow more convenient addition of diagnostic code. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* evtchn: Avoid spurious event-channel notifications across unbind/bind.Keir Fraser2008-07-311-2/+2
| | | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com> Signed-off-by: Huacai Chen <huacai.chen@intel.com>
* xen: Split domain_flags into discrete first-class fields in thekfraser@localhost.localdomain2007-03-291-0/+7
| | | | | | domain structure. This makes them quicker to access, and simplifies domain pause and checking of runnable status. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Can be built -std=gnu99 (except for .S files).kfraser@localhost.localdomain2006-10-181-4/+4
| | | | | | | | | Need to be careful with static initialisers: 1. *_LOCK_UNLOCKED, CPU_MASK_* no longer include a cast 2. Dynamic uses of the above are replaced by appropriate function invocations. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1389.10.1 (427fa2d3ZV92f_ErvLuIzWbV1f67QA)kaf24@firebug.cl.cam.ac.uk2005-05-091-0/+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.1159.1.270 (417cd5efuYLEDeFTqZTJOYsZwD2mag)kaf24@freefall.cl.cam.ac.uk2004-10-251-51/+0
| | | | | | Get rid of critical-region checking. It gets in the way and has found precisely zero real bugs!
* bitkeeper revision 1.1159.53.27 (4134d3b2RKqSKYYMoQoESXU2EtGiiQ)kaf24@scramble.cl.cam.ac.uk2004-08-311-2/+0
| | | | | Build fixes and move set_current() earlier in boot (Charles Coffing).
* bitkeeper revision 1.1159.62.1 (412f5ac2sXlMhMeRveH20BE_o6ZJVw)kaf24@freefall.cl.cam.ac.uk2004-08-271-0/+11
| | | | | Allow shadow p.t. code to do unsafe things with shadow locks held.
* bitkeeper revision 1.1159.59.1 (412f52e5pzGsSRKxWkXlLmoWzjYc7g)kaf24@freefall.cl.cam.ac.uk2004-08-271-13/+64
| | | | | | | | Add debugging for locked critical regions. Allows us to assert that certain things don't happen while in a c.r.: currently these include taking page faults and GPFs, and also we disallow use of the user-space access macros (uaccess.h).
* bitkeeper revision 1.1041.4.1 (40e49f12Fj3pygWG3LxLQ2tcwBx24A)kaf24@scramble.cl.cam.ac.uk2004-07-011-0/+2
| | | | | | Fix common files when compiled without CONFIG_SMP (some x86-specific files still don't work).
* bitkeeper revision 1.994.1.6 (40d852d480GZ_R_XEId8Zw3_6I_0lA)kaf24@scramble.cl.cam.ac.uk2004-06-221-106/+48
| | | | | Various cleanups. Get rid of zombie page state.
* bitkeeper revision 1.982 (40d300456_XUbFFOMxRh4MjyB7AfJA)kaf24@scramble.cl.cam.ac.uk2004-06-181-10/+0
| | | | | | | | | Hacked the scheduler interfaces in Xen. We now have synchronous pause. Suspend/death VIRQs have gone away; replace by dom-controller msgs. Xen no longer knows about PS/2 keyboard/mouse; DOM0 can go straight at them.
* bitkeeper revision 1.821 (406007d6uu0vZYDxa9P1ZfNO9kF_Cg)kaf24@scramble.cl.cam.ac.uk2004-03-231-0/+142
Many files: xeno -> xen renames. ide-xen.c: Rename: xen/drivers/ide/ide-xeno.c -> xen/drivers/ide/ide-xen.c xen.lds: Rename: xen/arch/i386/xeno.lds -> xen/arch/i386/xen.lds Many files: mvdir