aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/event.h
Commit message (Collapse)AuthorAgeFilesLines
* evtchn: implement EVTCHNOP_set_priority and add the set_priority hookDavid Vrabel2013-10-141-0/+11
| | | | | | | | | | | | Implement EVTCHNOP_set_priority. A new set_priority hook added to struct evtchn_port_ops will do the ABI specific validation and setup. If an ABI does not provide a set_priority hook (as is the case of the 2-level ABI), the sub-op will return -ENOSYS. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* evtchn: allow many more evtchn objects to be allocated per domainDavid Vrabel2013-10-141-8/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expand the number of event channels that can be supported internally by altering now struct evtchn's are allocated. The objects are indexed using a two level scheme of groups and buckets (instead of only buckets). Each group is a page of bucket pointers. Each bucket is a page-sized array of struct evtchn's. The optimal number of evtchns per bucket is calculated at compile time. If XSM is not enabled, struct evtchn is 16 bytes and each bucket contains 256, requiring only 1 group of 512 pointers for 2^17 (131,072) event channels. With XSM enabled, struct evtchn is 24 bytes, each bucket contains 128 and 2 groups are required. For the common case of a domain with only a few event channels, instead of requiring an additional allocation for the group page, the first bucket is indexed directly. As a consequence of this, struct domain shrinks by at least 232 bytes as 32 bucket pointers are replaced with 1 bucket pointer and (at most) 2 group pointers. [ Based on a patch from Wei Liu with improvements from Malcolm Crossley. ] Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* evtchn: use a per-domain variable for the max number of event channelsDavid Vrabel2013-10-141-1/+1
| | | | | | | | | Instead of the MAX_EVTCHNS(d) macro, use d->max_evtchns instead. This avoids having to repeatedly check the ABI type. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* evtchn: print ABI specific state with the 'e' debug keyDavid Vrabel2013-10-141-0/+7
| | | | | | | | | | | | | | | | In the output of the 'e' debug key, print some ABI specific state in addition to the (p)ending and (m)asked bits. For the 2-level ABI, print the state of that event's selector bit. e.g., (XEN) port [p/m/s] (XEN) 1 [0/0/1]: s=3 n=0 x=0 d=0 p=74 (XEN) 2 [0/0/1]: s=3 n=0 x=0 d=0 p=75 Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* evtchn: refactor low-level event channel port opsDavid Vrabel2013-10-141-0/+45
| | | | | | | | | | | | | Use functions for the low-level event channel port operations (set/clear pending, unmask, is_pending and is_masked). Group these functions into a struct evtchn_port_op so they can be replaced by alternate implementations (for different ABIs) on a per-domain basis. Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* use SMP barrier in common code dealing with shared memory protocolsIan Campbell2013-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Xen currently makes no strong distinction between the SMP barriers (smp_mb etc) and the regular barrier (mb etc). In Linux, where we inherited these names from having imported Linux code which uses them, the SMP barriers are intended to be sufficient for implementing shared-memory protocols between processors in an SMP system while the standard barriers are useful for MMIO etc. On x86 with the stronger ordering model there is not much practical difference here but ARM has weaker barriers available which are suitable for use as SMP barriers. Therefore ensure that common code uses the SMP barriers when that is all which is required. On both ARM and x86 both types of barrier are currently identical so there is no actual change. A future patch will change smp_mb to a weaker barrier on ARM. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: move for_each_set_bit to xen/bitops.hStefano Stabellini2013-05-081-1/+1
| | | | | | | | Move for_each_set_bit from asm-x86/bitops.h to xen/bitops.h. Replace #include <asm/bitops.h> with #include <xen/bitops.h> everywhere. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* Remove bool return code from evtchn_set_pending() and callers.Keir Fraser2012-05-101-2/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* xsm: expose context of event channel peersDaniel De Graaf2012-02-291-0/+10
| | | | | | | | | | This hypercall allows a domain to identify the security context of a domain that it is communicating with using the interdomain event channel that it is using for the communication. This can be used to augment Xen's security permissions with intra-domain security checks. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* xen: change virq parameters from int to uint32_tDaniel De Graaf2012-01-281-2/+2
| | | | | Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* xen: allow global VIRQ handlers to be delegated to other domainsDaniel De Graaf2012-01-281-3/+9
| | | | | | | | | | | | | | | | | This patch sends global VIRQs to a domain designated as the VIRQ handler instead of sending all global VIRQ events to dom0. This is required in order to run xenstored in a stubdom, because VIRQ_DOM_EXC must be sent to xenstored for domain destruction to work properly. This patch was inspired by the xenstored stubdomain patch series sent to xen-devel by Alex Zeffertt in 2009. Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com> Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Keir Fraser <keir@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>
* Create a generic callback mechanism for Xen-bound event channelsAndres Lagar-Cavilla2011-12-061-1/+4
| | | | | | | | | | | | For event channels for which Xen is the consumer, there currently is a single action. With this patch, we allow event channel creators to specify a generic callback (or no callback). Because the expectation is that there will be few callbacks, they are stored in a small table. Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Keir Fraser <keir@xen.org> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Tim Deegan <tim@xen.org>
* replace d->nr_pirqs sized arrays with radix treeJan Beulich2011-06-231-1/+1
| | | | | | | | | | | | | | | With this it is questionable whether retaining struct domain's nr_pirqs is actually necessary - the value now only serves for bounds checking, and this boundary could easily be nr_irqs. Note that ia64, the build of which is broken currently anyway, is only being partially fixed up. v2: adjustments for split setup/teardown of translation data v3: re-sync with radix tree implementation changes Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Revert 23295:4891f1f41ba5 and 23296:24346f749826Keir Fraser2011-05-021-1/+1
| | | | | | Fails current lock checking mechanism in spinlock.c in debug=y builds. Signed-off-by: Keir Fraser <keir@xen.org>
* replace d->nr_pirqs sized arrays with radix treeJan Beulich2011-05-011-1/+1
| | | | | | | | | | | | | | | With this it is questionable whether retaining struct domain's nr_pirqs is actually necessary - the value now only serves for bounds checking, and this boundary could easily be nr_irqs. Another thing to consider is whether it's worth storing the pirq number in struct pirq, to avoid passing the number and a pointer to quite a number of functions. Note that ia64, the build of which is broken currently anyway, is only partially fixed up. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: IRQ affinity should track vCPU affinityKeir Fraser2010-06-171-0/+3
| | | | | | | | | | | | | | With IRQs getting bound to the CPU the binding vCPU currently runs on there can result quite a bit of extra cross CPU traffic as soon as that vCPU moves to a different pCPU. Likewise, when a domain re-binds an event channel associated with a pIRQ, that IRQ's affinity should also be adjusted. The open issue is how to break ties for interrupts shared by multiple domains - currently, the last request (at any point in time) is being honored. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* notify_via_xen_event_channel() takes explicit domain parameter.Keir Fraser2010-06-041-1/+1
| | | | | | Also remove pointless tasklet from mem_event notify path. Signed-off-by: John Byrne <john.l.byrne@hp.com>
* x86: add a shared page indicating the need for an EOI notificationKeir Fraser2008-11-281-0/+3
| | | | | | | | | | To simplify the interface for the guest, when a guest uses this new (sub-)hypercall, PHYSDEVOP_eoi behavior changes to unmask the corresponding event channel at once, avoiding the eventual need for a second hypercall from the guest. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: MCA support.Keir Fraser2008-07-041-0/+3
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Cleanups to suspend-event-channel patches.Keir Fraser2008-07-041-5/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix build.Keir Fraser2008-07-041-0/+3
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: MSI interrupt storm avoidance.Keir Fraser2008-07-041-3/+2
| | | | | Signed-off-by: Shan Haitao <Haitao.shan@intel.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xen: Rename remaining vcpu_flags as pause_flags.kfraser@localhost.localdomain2007-03-291-3/+3
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] No need to call hvm_do_resume() on every vm entry.kfraser@localhost.localdomain2006-10-231-0/+7
| | | | | Original patch from Xin Li <xin.b.li@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [hvm/qemu] Flip the device model over to using the new Xen event channelssos22@douglas.cl.cam.ac.uk2006-08-081-0/+1
| | | | | | | | support. Signed-off-by: Steven Smith <ssmith@xensource.com>
* [XEN] Add Xen-attached event channels, which will be usedkfraser@localhost.localdomain2006-08-041-6/+31
| | | | | | by HVM for the ioreq_packet port. Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Replace direct common-code access of evtchn_upcall_maskkaf24@firebug.cl.cam.ac.uk2006-06-101-3/+0
| | | | | | | | | | | | with local_event_delivery_* accessors. Notes: 1. Still some (read-only, debug) use in keyhandler.c 2. Still accesses through current->vcpu_info. Both above may need to be compiled only for architectures that use event channels. Signed-off-by: Keir Fraser <keir@xensource.com>
* Make event_pending() architecture-specific.kaf24@firebug.cl.cam.ac.uk2006-04-111-5/+0
| | | | | | | | | PowerPC needs this because the domain can directly modify the hardware's "interrupts enabled" bit, and we don't want to patch Linux to replace all those accesses to use evtchn_upcall_mask instead. Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* Backtrack on the new interface for reserved event-channelkaf24@firebug.cl.cam.ac.uk2006-04-051-8/+10
| | | | | | | | | | | | ports, as binding them in user space via the evtchn driver would be a pain. Instead extend VIRQs so they can be classified as 'global' or 'per vcpu'. The former can only be allocated once per guest, but can be re-bound to an arbitrary VCPU. Signed-off-by: Keir Fraser <keir@xensource.com>
* Add new interface for allocating reserved event-channelkaf24@firebug.cl.cam.ac.uk2006-04-051-0/+5
| | | | | | | | ports to arbitrary Xen subsystems. Signed-off-by: Keir Fraser <keir@xensource.com>
* Define a new sched_op hypercall called sched_op_new, which differs from thekaf24@firebug.cl.cam.ac.uk2006-03-141-29/+5
| | | | | | | | | | | | | | | | | | legacy hypercall in that it takes a pointer to a block of extra arguments rather than an opaque unsigned long. The old hypercall still exists, for backwards compatibility. The new hypercall supports new sub-command SCHEDOP_poll, which can be used to wait on a set of event-channel ports with an optional timeout. This is exported in XenLinux as HYPERVISOR_poll, and used in the pcifront driver to wait on a response from the pciback driver. Can also be used for debuggers. :-) Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: John Levon <john.levon@sun.com>
* Per-vcpu IO evtchn patch for HVM domain.kaf24@firebug.cl.cam.ac.uk2006-02-231-0/+6
| | | | | | | | We are starting to send patches to support SMP VMX guest. Signed-off-by: Xin Li <xin.b.li@intel.com>
* Fix unmask_evtchn() when the port is bound to a differentkaf24@firebug.cl.cam.ac.uk2005-12-131-1/+1
| | | | | | | | VCPU. Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix event_pending() macro to match the assembly-languagekaf24@firebug.cl.cam.ac.uk2005-11-171-2/+2
| | | | | | | | | | | checks in entry.S. This will avoid a hard-to-debug loop that we found ourselves in recently, involving hypercall_preempt_check() spuriously returning TRUE, but no event getting propagated to the guest (since mask != 0). Signed-off-by: Keir Fraser <keir@xensource.com>
* Make the event-channel pending and mask arrays consist ofkaf24@firebug.cl.cam.ac.uk2005-10-171-4/+5
| | | | | | | | | | | | | | | | | | | longs. Thi sensures appropriate alignment for architectures that require it, and also allows us to naturally support up to 4096 event channels per 64-bit guest. Moved 'n_vcpu' field from shared_info to start_info. Really it ought to disappear altogether as the info can be derived from xenstore. Fix a weird bug in XendDomainInfo where 'vcpus' information for a domain defaults to floating point value 1.0 rather than integer 1. This looks like a Python bug to me, but in any case it is 'fixed' by explicitly converting the default value to an integer. Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up event-channel notification code in Xen.kaf24@firebug.cl.cam.ac.uk2005-08-111-22/+7
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1709.1.16 (42b1d2ecGSNeZhThHshE903eA1tK-Q)djm@kirby.fc.hp.com2005-06-161-0/+2
| | | | | | | Add arch-dep notification hook (per discussion on xen-devel) needed for ia64 and VTi/x. Signed-off-by: Matt Chapman <matthewc@hp.com>
* bitkeeper revision 1.1664.1.1 (42a08862ToP8uoeBgUzDwAQBMXo4wg)kaf24@firebug.cl.cam.ac.uk2005-06-031-5/+2
| | | | | | | | | | Event-channel CPU affinity. Currently all event channels still bind to VCPU#0 at start of day, and have their binding automatically changed when bound to a VIRQ or IPI source. XenLinux maintains a per-cpu evtchn mask denoting which event channels are bound to each cpu. Todo: Allow guests to change binding of of non-ipi and non-virq evtchns. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1654 (429f793bJpez_x78azX5iKCsmtPMUQ)cl349@firebug.cl.cam.ac.uk2005-06-021-12/+12
|\ | | | | | | | | | | Merge firebug.cl.cam.ac.uk:/auto/groups/xeno-xenod/BK/xen-unstable.bk into firebug.cl.cam.ac.uk:/local/scratch/cl349/xen-unstable.bk
| * bitkeeper revision 1.1644.1.1 (429f749dKFzVUg9NXDMVu4apHJvpNQ)kaf24@firebug.cl.cam.ac.uk2005-06-021-12/+12
| | | | | | | | | | | | | | The last annoying rename: struct exec_domain *ed -> struct vcpu *v Signed-off-by: Keir Fraser <keir@xensource.com>
* | bitkeeper revision 1.1651 (429f70102tptpkVKU9_mkUC4olK_-Q)cl349@firebug.cl.cam.ac.uk2005-06-021-0/+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.1389.20.1 (42836117f2yEkILParltXJcom3kTeA)kaf24@firebug.cl.cam.ac.uk2005-05-121-3/+3
| | | | | | | | | More descriptive 'flags' and 'id' field names for exec_domain/domain structures seems a good idea after all. At the same time, I've renamed the flag macros to be a bit neater and more descriptive, and more in keeping with the style of such definitions in asm/mm.h, for example. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1389.5.35 (427e00b2juTv-JMiPdIYinvwaH2N8Q)kaf24@firebug.cl.cam.ac.uk2005-05-081-1/+1
| | | | | | Field-name cleanups. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1159.1.487 (41c1a6a3A4oeBsOqAlUgIz4zo-l3aA)cl349@arcadians.cl.cam.ac.uk2004-12-161-4/+2
| | | | | Don't deliver misdirect virq's.
* bitkeeper revision 1.1159.1.484 (41c1a3e20WEWxhNQDQK6avGv36pVEA)cl349@arcadians.cl.cam.ac.uk2004-12-161-1/+6
| | | | | Remove per vcpu misdirect virq support.
* bitkeeper revision 1.1159.1.400 (4192268botrLPEWBvExDtqcSivVN3g)cl349@freefall.cl.cam.ac.uk2004-11-101-1/+1
| | | | | Move virq to evtchn mapping to exec_domain.
* bitkeeper revision 1.1159.1.399 (4191f4cbUvkMenqLkHaeRu45RztOdA)cl349@freefall.cl.cam.ac.uk2004-11-101-1/+1
| | | | | More SMP guest support.
* bitkeeper revision 1.1159.1.398 (4190c2a3yFTT9r-Ede8ilkq-wZrXkg)cl349@freefall.cl.cam.ac.uk2004-11-091-6/+5
| | | | | Add focus to pirqs and interdomain evtchns.
* bitkeeper revision 1.1159.1.395 (4190ab80qQIIPeM49q40ES01DxL7Ng)cl349@freefall.cl.cam.ac.uk2004-11-091-4/+4
| | | | | | Move shared_info pointer from exec_domain to domain and add vcpu_info pointer in exec_domain.