aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/grant_table.h
Commit message (Collapse)AuthorAgeFilesLines
* gnttab: remove unused MAPTRACK_MAX_ENTRIES defineMatthew Daley2013-07-021-3/+0
| | | | | | | The maximum number of grant mappings is given by max_nr_maptrack_frames() as of commit 5ce8faf, not this unused define. Signed-off-by: Matthew Daley <mattjd@gmail.com>
* gnttab: cleanup of number-of-active-frames calculationsJan Beulich2012-09-121-34/+0
| | | | | | | | | | | | | max_nr_active_grant_frames() is merly is special case of num_act_frames_from_sha_frames(), so there's no need to have a special case implementation for it. Further, some of the related definitions (including the "struct active_grant_entry" definition itself) can (and hence should) really be private to grant_table.c. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@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>
* 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>
* Fix rcu domain locking for transitive grantsKeir Fraser2011-03-081-1/+1
| | | | | | | | | | | | | | | When acquiring a transitive grant for copy then the owning domain needs to be locked down as well as the granting domain. This was being done, but the unlocking was not. The acquire code now stores the struct domain * of the owning domain (rather than the domid) in the active entry in the granting domain. The release code then does the unlock on the owning domain. Note that I believe I also fixed a bug where, for non-transitive grants the active entry contained a reference to the acquiring domain rather than the granting domain. From my reading of the code this would stop the release code for transitive grants from terminating its recursion correctly. Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
* Transitive grant support.Keir Fraser2009-10-071-0/+2
| | | | Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Implement sub-page grant support.Keir Fraser2009-10-071-3/+8
| | | | Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Introduce a grant_entry_v2 structure.Keir Fraser2009-10-071-4/+24
| | | | Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Rename the struct grant_entry to struct grant_entry_v1, so that itKeir Fraser2009-10-071-3/+3
| | | | | | isn't in the way when we introduce struct grant_entry_v2. Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Simplify include/xen/grant_table.h a bit:Keir Fraser2009-10-071-14/+7
| | | | | | | -- INITIAL_GRANT_ENTRIES is never used, so can be removed. -- Simplify num_act_frames_from_sha_frames a little. Signed-off-by: Steven Smith <steven.smith@citrix.com>
* Revert 19658:28a197617286 "Fix up the synchronisation around grantKeir Fraser2009-06-011-2/+0
| | | | | | | | | | table map track handles". There is no race since the hypercall takes the domain-lock. Furthermore removing locking from get_maptrack_handle() races gnttab_setup_table(). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Fix up the synchronisation around grant table map track handles.Keir Fraser2009-05-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | At present, we're not doing any at all, so if a domain e.g. tries to do two map operations at the same time from different vcpus then you could end up with both operations getting back the same maptrack handle. Fix this problem by just shoving an enormous lock around grant table operations. This is unlikely to be heavily contended, because netback and blkback both restrict themselves to mapping on a single vcpu at a time (globally for netback, and per-device for blkback), and most of the interesting bits are already protected by the remote domain's grant table lock anyway. The unconteded acquisition cost might be significant for some workloads. If that were the case, it might be worth only acquiring the lock only for multi-vcpu domains, since we only manipulate the maptrack table in the context of one of the domain's vcpus. I've not done that optimisation here, because I didn't want to think about what would happen if e.g. a cpu got hot-unplugged from a domain while it was performing a map operation. Signed-off-by: Steven Smith <steven.smith@citrix.com>
* gnttab: Remove unused per-domain map_count fieldKeir Fraser2009-05-191-1/+0
| | | | Signed-off-by: Steven Smith <steven.smith@eu.citrix.com>
* PoD: Check refcount, not type count when reclaiming zero pagesKeir Fraser2009-01-291-3/+0
| | | | | | | | | | Check the page refcount rather than the type count when deciding if a page is still mapped. This catches pages which are mapped by qemu; it also removes the need for gnttab_is_granted(). Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* PoD memory 5/9: emergency scanKeir Fraser2009-01-051-0/+4
| | | | | | | | | | | | Implement "emergency scan" for zero pages, to deal with start-of-day page scrubbers. If the cache is running out, scan through memory looking for "zero pages" that we can reclaim for the cache. This is necessary for operating systems which have a start-of-day page scrubber which runs before the balloon driver can balloon down to the target. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
* GNTTAB: PowerPC patch for dynamic grant tables.Hollis Blanchard2007-02-191-0/+4
| | | | | | | Grant table expansion is disabled for now, since we currently make assumptions about grant table MFNs being contiguous. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
* acm: Fix the traversal of the event channel buckets and use the activekfraser@localhost.localdomain2007-03-011-0/+22
| | | | | | | | grant table entries instead of the shared ones. I had to move some functions from grant_table.c into grant_table.h to make them usable by the ACM module. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
* Dynamic grant-table sizing.kfraser@localhost.localdomain2007-02-151-7/+31
| | | | | | Signed-off-by: Christopher CLark <christopher.clark@cl.cam.ac.uk> Signed-off-by: Andrei Petrov <andrei.petrov@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Replace grant-table typedefs with explicit structs.kaf24@firebug.cl.cam.ac.uk2006-04-141-11/+12
| | | | | | | Reduce MAPTRACK_MAX_ENTRIES to something plausible. Signed-off-by: Keir Fraser <keir@xensource.com>
* Clean up grant_mapping_t. Increase its size from 4bytes to 8bytes andkaf24@firebug.cl.cam.ac.uk2006-04-141-3/+3
| | | | | | | | removed tight encoding of flag and ref. This change is xen-internal so this shouldn't affect domain api. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* Fix gnttab_release_mappings -- it doesn't need to dropkaf24@firebug.cl.cam.ac.uk2005-12-211-12/+0
| | | | | | | | | | | | | | page refcnts for host mappings as they are already destroyed by put_page_from_l1e(). Also call gnttab_release_mappings later (after destroying page-table references) and from common code rather than arch/x86. Also a few other misc gnttab cleanups. Signed-off-by: Keir Fraser <keir@xensource.com>
* Move arch-specific portions of grant-table implementationkaf24@firebug.cl.cam.ac.uk2005-11-231-5/+5
| | | | | | | | out of common code. Ready for use by ia64. Signed-off-by: Keir Fraser <keir@xensource.com>
* When a foreign page is mapped via a grant reference, itkaf24@firebug.cl.cam.ac.uk2005-11-221-6/+3
| | | | | | | | | | | | | | | | must also be unmapped explicitly via the grant-table interface (GNTTABOP_unmap_grant_ref). If not, the guest ends up with a dangling grant reference that is not cleared up until the guest dies. Because this can obviously lead to deferred hard-to-debug problems, debug builds of Xen use a 'spare' PTE flag to track granted mappings and to crash a domain if it attempts to free such a PTE without using GNTTABOP_unmap_grant_ref. Signed-off-by: Keir Fraser <keir@xensource.com>
* Restructure GNTTABOP_map_grant_ref.kaf24@firebug.cl.cam.ac.uk2005-09-231-4/+0
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Start cleaning up grant tables. gnttab_donate now calledkaf24@firebug.cl.cam.ac.uk2005-09-151-6/+0
| | | | | | | | | | gnttab_transfer, with slightly rationalised interface and simpler implementation inside Xen. This is a tiny chip off the tip of a very big iceberg. :-) Signed-off-by: Keir Fraser <keir@xensource.com>
* Some arch/x86 gnttab cleanups in Xen.kaf24@firebug.cl.cam.ac.uk2005-08-141-6/+11
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* This changest allows grant mappings to arbitrary PTEs.akw27@arcadians.cl.cam.ac.uk2005-08-121-3/+4
| | | | | | | | | | | | | | | | The map operation now takes PTE addresses as well as virtual addresses. The contains_pte flag is used to indicate what sort of address is in the map request. Additionally, this patch: - fixes grant mappings to user space. - fixes overflow testing when you run out of maptrack entry space. Signed-off-by: Andrew Warfield <andrew.warfield@cl.cam.ac.uk> Signed-off-by: Leoffrey Lefebvre <geoffrey.g.lefebvre@intel.com>
* bitkeeper revision 1.1236.1.213 (4251e21boiMcVvsOm7kHtd1O51o1mA)cwc22@centipede.cl.cam.ac.uk2005-04-051-1/+2
| | | | | | Dynamic sizing of a domain's grant map tracking table on demand. Grant tables now default for block front/back communication.
* bitkeeper revision 1.1236.56.1 (4251a1f9OIyZY2I2LqBlxl0mi64FkA)cwc22@centipede.cl.cam.ac.uk2005-04-041-2/+5
| | | | | | Grant tables: substantially more robust. Block front and back drivers: support for using grant tables for interdomain communication.
* bitkeeper revision 1.1236.26.1 (4231b4a20dnya9Kf1nGoYAKIhIcGJw)cwc22@centipede.cl.cam.ac.uk2005-03-111-0/+4
| | | | | Grant tables map operation working.
* bitkeeper revision 1.1236.1.73 (4230542aNzdikO2FdRgaB46eNiQNHw)cwc22@centipede.cl.cam.ac.uk2005-03-101-0/+1
| | | | | Maintain count of mappings, and fast exit put_page check if none in use
* bitkeeper revision 1.1236.22.1 (422fbf4aXvKwpBGHOzUdfvbs05k_oQ)cwc22@centipede.cl.cam.ac.uk2005-03-101-5/+0
| | | | | | remove gnttab_release_all_mappings fixes to refcounts and flags
* bitkeeper revision 1.1236.12.12 (422e2f94y48ELm2z25jB8lJCOUxZgw)cwc22@centipede.cl.cam.ac.uk2005-03-081-0/+5
| | | | | grant tables: page ref counting fixes.
* bitkeeper revision 1.1159.223.12 (41f14d3cE4GADmEAEr6XE9nXX4dyGw)kaf24@scramble.cl.cam.ac.uk2005-01-211-1/+0
| | | | | | Common-code cleanups. Moved arch-specific code out into arch/x86 and asm-x86.
* bitkeeper revision 1.1159.142.4 (4184b6d4rc3Jd2irJimPyupm4TO06A)kaf24@freefall.cl.cam.ac.uk2004-10-311-2/+2
| | | | | | | | | | Rename Xen public interfaces. 1. hypervisor-if.h is now xen.h 2. hypervisor-ifs/ directory is now: <include/public/...> in Xen <asm/xen-public/...> in Linux <xen/...> in user space
* bitkeeper revision 1.1159.1.216 (41656f2ek7HkbBXpAt8AAbtJEyjlTg)kaf24@freefall.cl.cam.ac.uk2004-10-071-25/+34
| | | | | Grant-table interface redone.
* bitkeeper revision 1.1159.1.106 (412dec2dJdF7UJz-ddgHVVOekKtAHQ)kaf24@labyrinth.cl.cam.ac.uk2004-08-261-3/+18
| | | | | | Completed first cut of Xen support for grant tables. The device drivers now need modifying to use them.
* bitkeeper revision 1.1159.51.2 (412cb2dfaIDYjySJYYMTByGbcM77UA)kaf24@labyrinth.cl.cam.ac.uk2004-08-251-3/+14
| | | | | More grant-table code, and some related sundry improvements.
* bitkeeper revision 1.1159.45.17 (412b0f07nrZVpzBQ0MnEcFNcQUolbw)kaf24@scramble.cl.cam.ac.uk2004-08-241-3/+39
| | | | | More grant-table code. Various cleanups and speedups.
* bitkeeper revision 1.1159.48.1 (4126259181cq4hyB3cquYrgpQokAIQ)kaf24@scramble.cl.cam.ac.uk2004-08-201-0/+38
Framework for grant-table implementation in Xen.