summaryrefslogtreecommitdiffstats
path: root/drivers/xen
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | |
| \ \ \ \
*-. \ \ \ \ Merge branches 'stable/backend.base.v3' and 'stable/gntalloc.v7' of ↵Linus Torvalds2011-05-204-16/+84
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/backend.base.v3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/pci: Fix compiler error when CONFIG_XEN_PRIVILEGED_GUEST is not set. xen/p2m: Add EXPORT_SYMBOL_GPL to the M2P override functions. xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override. xen/irq: The Xen hypervisor cleans up the PIRQs if the other domain forgot. xen/irq: Export 'xen_pirq_from_irq' function. xen/irq: Add support to check if IRQ line is shared with other domains. xen/irq: Check if the PCI device is owned by a domain different than DOMID_SELF. xen/pci: Add xen_[find|register|unregister]_device_domain_owner functions. * 'stable/gntalloc.v7' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/gntdev,gntalloc: Remove unneeded VM flags
| | * | | | xen/gntdev,gntalloc: Remove unneeded VM flagsDaniel De Graaf2011-03-102-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only time when granted pages need to be treated specially is when using Xen's PTE modification for grant mappings owned by another domain (that is, only gntdev on PV guests). Otherwise, the area does not require VM_DONTCOPY and VM_PFNMAP, since it can be accessed just like any other page of RAM. Since the vm_operations_struct close operations decrement reference counts, a corresponding open function that increments them is required now that it is possible to have multiple references to a single area. We are careful in the gntdev to check if we can remove those flags. The reason that we need to be careful in gntdev on PV guests is because we are not changing the PFN/MFN mapping on PV; instead, we change the application's page tables to point to the other domain's memory. This means that the vma cannot be copied without using another grant mapping hypercall; it also requires special handling on unmap, which is the reason for gntdev's dependency on the MMU notifier. For gntalloc, this is not a concern - the pages are owned by the domain using the gntalloc device, and can be mapped and unmapped in the same manner as any other page of memory. Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [v2: Added in git commit "We are.." from email correspondence]
| * | | | | xen/p2m/m2p/gnttab: Support GNTMAP_host_map in the M2P override.Konrad Rzeszutek Wilk2011-04-181-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We only supported the M2P (and P2M) override only for the GNTMAP_contains_pte type mappings. Meaning that we grants operations would "contain the machine address of the PTE to update" If the flag is unset, then the grant operation is "contains a host virtual address". The latter case means that the Hypervisor takes care of updating our page table (specifically the PTE entry) with the guest's MFN. As such we should not try to do anything with the PTE. Previous to this patch we would try to clear the PTE which resulted in Xen hypervisor being upset with us: (XEN) mm.c:1066:d0 Attempt to implicitly unmap a granted PTE c0100000ccc59067 (XEN) domain_crash called from mm.c:1067 (XEN) Domain 0 (vcpu#0) crashed on cpu#3: (XEN) ----[ Xen-4.0-110228 x86_64 debug=y Not tainted ]---- and crashing us. This patch allows us to inhibit the PTE clearing in the PV guest if the GNTMAP_contains_pte is not set. On the m2p_remove_override path we provide the same parameter. Sadly in the grant-table driver we do not have a mechanism to tell m2p_remove_override whether to clear the PTE or not. Since the grant-table driver is used by user-space, we can safely assume that it operates only on PTE's. Hence the implementation for it to work on !GNTMAP_contains_pte returns -EOPNOTSUPP. In the future we can implement the support for this. It will require some extra accounting structure to keep track of the page[i], and the flag. [v1: Added documentation details, made it return -EOPNOTSUPP instead of trying to do a half-way implementation] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen/irq: The Xen hypervisor cleans up the PIRQs if the other domain forgot.Konrad Rzeszutek Wilk2011-04-141-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And if the other domain forgot to clean up its PIRQs we don't need to fail the operation. Just take a note of it and continue on. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen/irq: Export 'xen_pirq_from_irq' function.Konrad Rzeszutek Wilk2011-04-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this to find the real Xen PIRQ value for a device that requests an MSI or MSI-X. In the past we used 'xen_gsi_from_irq' since that function would return an Xen PIRQ or GSI depending on the provided IRQ. Now that we have seperated that we need to use the correct function. [v2: Deal with rebase on stable/irq.cleanup] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen/irq: Add support to check if IRQ line is shared with other domains.Konrad Rzeszutek Wilk2011-04-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do this via the PHYSDEVOP_irq_status_query support hypervisor call. We will get a positive value if another domain has binded its PIRQ to the specified GSI (IRQ line). [v2: Deal with v2.6.37-rc1 rebase fallout] [v3: Deal with stable/irq.cleanup fallout] [v4: xen_ignore_irq->xen_test_irq_shared] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen/irq: Check if the PCI device is owned by a domain different than DOMID_SELF.Konrad Rzeszutek Wilk2011-04-141-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We check if there is a domain owner for the PCI device. In case of failure (meaning no domain has registered for this device) we make DOMID_SELF the owner. Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> [v2: deal with rebasing on v2.6.37-1] [v3: deal with rebasing on stable/irq.cleanup] [v4: deal with rebasing on stable/irq.ween_of_nr_irqs] [v5: deal with rebasing on v2.6.39-rc3] Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
* | | | | | PM: Add missing syscore_suspend() and syscore_resume() callsRafael J. Wysocki2011-04-201-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device suspend/resume infrastructure is used not only by the suspend and hibernate code in kernel/power, but also by APM, Xen and the kexec jump feature. However, commit 40dc166cb5dddbd36aa4ad11c03915ea (PM / Core: Introduce struct syscore_ops for core subsystems PM) failed to add syscore_suspend() and syscore_resume() calls to that code, which generally leads to breakage when the features in question are used. To fix this problem, add the missing syscore_suspend() and syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c and drivers/xen/manage.c. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* | | | | | Merge branch 'for-linus' of ↵Linus Torvalds2011-04-131-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: fix XEN_SAVE_RESTORE Kconfig dependencies PM / Hibernate: Introduce CONFIG_HIBERNATE_CALLBACKS
| * | | | | | PM / Hibernate: Introduce CONFIG_HIBERNATE_CALLBACKSRafael J. Wysocki2011-04-111-3/+3
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Xen save/restore is going to use hibernate device callbacks for quiescing devices and putting them back to normal operations and it would need to select CONFIG_HIBERNATION for this purpose. However, that also would cause the hibernate interfaces for user space to be enabled, which might confuse user space, because the Xen kernels don't support hibernation. Moreover, it would be wasteful, as it would make the Xen kernels include a substantial amount of code that they would never use. To address this issue introduce new power management Kconfig option CONFIG_HIBERNATE_CALLBACKS, such that it will only select the code that is necessary for the hibernate device callbacks to work and make CONFIG_HIBERNATION select it. Then, Xen save/restore will be able to select CONFIG_HIBERNATE_CALLBACKS without dragging the entire hibernate code along with it. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Tested-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
* | | | | | Merge branch 'stable/bug-fixes-rc2' of ↵Linus Torvalds2011-04-121-4/+2Star
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: Allow PV-OPS kernel to detect whether XSAVE is supported xen: just completely disable XSAVE xen/debug: Don't be so verbose with WARN on 1-1 mapping errors. xen: events: fix error checks in bind_*_to_irqhandler()
| * | | | | xen: events: fix error checks in bind_*_to_irqhandler()Nicolas Kaiser2011-03-301-4/+2Star
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking 'irq < 0' doesn't work when 'irq' is unsigned. The assigned bind_evtchn_to_irq() and bind_virq_to_irq() return int, so using int appears appropriate. Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* / | | | Fix common misspellingsLucas De Marchi2011-03-311-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* | | | xen: Use new irq_move functionsThomas Gleixner2011-03-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These functions take irq_data as an argument and avoid a redundant lookup in the sparse irq case. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* | | | xen: Convert genirq namespaceThomas Gleixner2011-03-291-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Converted with coccinelle. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* | | | xen-gntdev: unlock on error path in gntdev_mmap()Dan Carpenter2011-03-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We should unlock here and also decrement the number of &map->users. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* | | | xen-gntdev: return -EFAULT on copy_to_user failureDan Carpenter2011-03-241-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | copy_to_user() returns the amount of data remaining to be copied. We want to return a negative error code here. The upper layers just call WARN_ON() if we return non-zero so this doesn't change the behavior. But returning -EFAULT is still cleaner. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
* | | Merge branch 'stable/xen.pm.bug-fixes' of ↵Linus Torvalds2011-03-184-13/+29
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/xen.pm.bug-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: use freeze/restore/thaw PM events for suspend/resume/chkpt xen: xenbus PM events support
| * | | xen: use freeze/restore/thaw PM events for suspend/resume/chkptShriram Rajagopalan2011-03-162-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use PM_FREEZE, PM_THAW and PM_RESTORE power events for suspend/resume/checkpoint functionality, instead of PM_SUSPEND and PM_RESUME. Use of these pm events fixes the Xen Guest hangup when taking checkpoints. When a suspend event is cancelled (while taking checkpoints once/continuously), we use PM_THAW instead of PM_RESUME. PM_RESTORE is used when suspend is not cancelled. See Documentation/power/devices.txt and linux/pm.h for more info about freeze, thaw and restore. The sequence of pm events in a suspend-resume scenario is shown below. dpm_suspend_start(PMSG_FREEZE); dpm_suspend_noirq(PMSG_FREEZE); sysdev_suspend(PMSG_FREEZE); cancelled = suspend_hypercall() sysdev_resume(); dpm_resume_noirq(cancelled ? PMSG_THAW : PMSG_RESTORE); dpm_resume_end(cancelled ? PMSG_THAW : PMSG_RESTORE); Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | xen: xenbus PM events supportKazuhiro SUZUKI2011-03-163-5/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make xenbus frontend device subscribe to PM events to receive suspend/resume/freeze/thaw/restore notifications. Signed-off-by: Kenji Wakamiya <wkenji@jp.fujitsu.com> Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com> Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Acked-by: Ian Campbell <ian.campbell@citrix.com> [shriram--minor mods and improved commit message] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | | |
| \ \ \
*-. \ \ \ Merge branches 'stable/irq.fairness' and 'stable/irq.ween_of_nr_irqs' of ↵Linus Torvalds2011-03-181-178/+261
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/irq.fairness' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: events: Remove redundant clear of l2i at end of round-robin loop xen: events: Make round-robin scan fairer by snapshotting each l2 word once only xen: events: Clean up round-robin evtchn scan. xen: events: Make last processed event channel a per-cpu variable. xen: events: Process event channels notifications in round-robin order. * 'stable/irq.ween_of_nr_irqs' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: events: Fix compile error if CONFIG_SMP is not defined. xen: events: correct locking in xen_irq_from_pirq xen: events: propagate irq allocation failure instead of panicking xen: events: do not workaround too-small nr_irqs xen: events: remove use of nr_irqs as upper bound on number of pirqs xen: events: dynamically allocate irq info structures xen: events: maintain a list of Xen interrupts xen: events: push setup of irq<->{evtchn,ipi,virq,pirq} maps into irq_info init functions xen: events: turn irq_info constructors into initialiser functions xen: events: use per-cpu variable for cpu_evtchn_mask xen: events: refactor GSI pirq bindings functions xen: events: rename restore_cpu_pirqs -> restore_pirqs xen: events: remove unused public functions xen: events: fix xen_map_pirq_gsi error return xen: events: simplify comment xen: events: separate two unrelated halves of if condition Fix up trivial conflicts in drivers/xen/events.c
| | * | | | xen: events: Fix compile error if CONFIG_SMP is not defined.Konrad Rzeszutek Wilk2011-03-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/xen/events.c:396: error: 'struct irq_data' has no member named 'affinity' Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: correct locking in xen_irq_from_pirqIan Campbell2011-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of those spin_lock() calls should be an unlock... Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: propagate irq allocation failure instead of panickingIan Campbell2011-03-101-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Running out of IRQs need not be fatal to the machine as a whole. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: do not workaround too-small nr_irqsIan Campbell2011-03-101-7/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the introduction of e7bcecb7b1d2 "genirq: Make nr_irqs runtime expandable" nr_irqs can grow as necessary to accommodate our allocation requests. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: remove use of nr_irqs as upper bound on number of pirqsIan Campbell2011-03-101-34/+25Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't really much relationship between the two, other than nr_irqs often being the larger of the two. Allows us to remove a nr_irqs sized array, the only users of this array are MSI setup and restore, neither of which are particularly performance critical. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: dynamically allocate irq info structuresIan Campbell2011-03-101-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes nr_irq sized array allocation at start of day. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: maintain a list of Xen interruptsIan Campbell2011-03-101-15/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a PVHVM kernel not all interrupts are Xen interrupts (APIC interrupts can also be present). Currently we get away with walking over all interrupts because the lookup in the irq_info array simply returns IRQT_UNBOUND and we ignore it. However this array will be going away in a future patch so we need to manually track which interrupts have been allocated by the Xen events infrastructure. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: push setup of irq<->{evtchn,ipi,virq,pirq} maps into irq_info ↵Ian Campbell2011-03-101-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | init functions Encapsulate setup of XXX_to_irq array in the relevant xen_irq_info_*_init function. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: turn irq_info constructors into initialiser functionsIan Campbell2011-03-101-38/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: use per-cpu variable for cpu_evtchn_maskIan Campbell2011-03-101-20/+8Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I can't see any reason why it isn't already. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: refactor GSI pirq bindings functionsIan Campbell2011-03-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the example set by xen_allocate_pirq_msi and xen_bind_pirq_msi_to_irq: xen_allocate_pirq becomes xen_allocate_pirq_gsi and now only allocates a pirq number and does not bind it. xen_map_pirq_gsi becomes xen_bind_pirq_gsi_to_irq and binds an existing pirq. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: rename restore_cpu_pirqs -> restore_pirqsIan Campbell2011-03-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is nothing per-cpu about this function. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: remove unused public functionsIan Campbell2011-03-101-20/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I was unable to find any user of these functions in either the functionality pending for 2.6.39 or the xen/next-2.6.32 branch of xen.git An exception to this was xen_gsi_from_irq which did appear to be used in xen/next-2.6.32's pciback. However in the 2.6.39 version of pciback xen_pirq_from_irq is, correctly AFAICT, used instead. Only a minority of functions in events.h use "extern" so drop it from those places for consistency. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: fix xen_map_pirq_gsi error returnIan Campbell2011-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix initial value of irq so that first goto out (if pirq or gsi arguments are too large) actually returns an error. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: simplify commentIan Campbell2011-03-101-7/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is never valid assume any particular relationship between a Xen PIRQ number and and Linux IRQ number so there is no need to hedge when saying so. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen: events: separate two unrelated halves of if conditionIan Campbell2011-03-101-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clarifies which bit the comment applies to. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen: events: Remove redundant clear of l2i at end of round-robin loopKeir Fraser2011-03-101-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [ijc: forward ported from linux-2.6.18-xen.hg 991:9ba6d9f3fbc0] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen: events: Make round-robin scan fairer by snapshotting each l2 word once onlyKeir Fraser2011-03-101-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (except for starting l2 word, which we scan in two parts). Signed-off-by: Keir Fraser <keir.fraser@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [ijc: forward ported from linux-2.6.18-xen.hg 990:427276ac595d] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen: events: Clean up round-robin evtchn scan.Keir Fraser2011-03-101-24/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes a couple of boundary cases. Signed-off-by: Keir Fraser <keir.fraser@citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [ijc: forward ported from linux-2.6.18-xen.hg 988:c88a02a22a05] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen: events: Make last processed event channel a per-cpu variable.Ian Campbell2011-03-101-7/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [ijc: forward ported from linux-2.6.18-xen.hg 325:b2768401db94] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| * | | | | xen: events: Process event channels notifications in round-robin order.Scott Rixner2011-03-101-7/+65
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoids fairness issue resulting from domain 0 processing lowest numbered event channel first. Fixes bug #1115 "Event channel port scanning unfair". Bugzilla: http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1115 Signed-off-by: Ian Campbell <ian.campbell@citrix.com> [ijc: forward ported from linux-2.6.18-xen.hg 324:7fe1c6d02a2b various variables have different names in this tree: l1 -> pending_words l2 -> pending_bits l1i -> word_idx l2i -> bit_idx] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | | | |
| \ \ \ \
*-. \ \ \ \ Merge branches 'stable/hvc-console', 'stable/gntalloc.v6' and ↵Linus Torvalds2011-03-187-384/+1184
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'stable/balloon' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/hvc-console' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/hvc: Disable probe_irq_on/off from poking the hvc-console IRQ line. * 'stable/gntalloc.v6' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen: gntdev: fix build warning xen/p2m/m2p/gnttab: do not add failed grant maps to m2p override xen-gntdev: Add cast to pointer xen-gntdev: Fix incorrect use of zero handle xen: change xen/[gntdev/gntalloc] to default m xen-gntdev: prevent using UNMAP_NOTIFY_CLEAR_BYTE on read-only mappings xen-gntdev: Avoid double-mapping memory xen-gntdev: Avoid unmapping ranges twice xen-gntdev: Use map->vma for checking map validity xen-gntdev: Fix unmap notify on PV domains xen-gntdev: Fix memory leak when mmap fails xen/gntalloc,gntdev: Add unmap notify ioctl xen-gntalloc: Userspace grant allocation driver xen-gntdev: Support mapping in HVM domains xen-gntdev: Add reference counting to maps xen-gntdev: Use find_vma rather than iterating our vma list manually xen-gntdev: Change page limit to be global instead of per-open * 'stable/balloon' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: (24 commits) xen-gntdev: Use ballooned pages for grant mappings xen-balloon: Add interface to retrieve ballooned pages xen-balloon: Move core balloon functionality out of module xen/balloon: Remove pr_info's and don't alter retry_count xen/balloon: Protect against CPU exhaust by event/x process xen/balloon: Migration from mod_timer() to schedule_delayed_work() xen/balloon: Removal of driver_pages
| | * | | | xen-gntdev: Use ballooned pages for grant mappingsDaniel De Graaf2011-03-161-33/+5Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Grant mappings cause the PFN<->MFN mapping to be lost on the pages used for the mapping. Instead of leaking memory, use pages that have already been ballooned out and so have no valid mapping. This removes the need for the bad-page leak workaround as pages are repopulated by the balloon driver. Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen-balloon: Add interface to retrieve ballooned pagesKonrad Rzeszutek Wilk2011-03-161-6/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pages that have been ballooned are useful for other Xen drivers doing grant table actions, because these pages have valid struct page/PFNs but have no valid MFN so are available for remapping. Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> [v2: Deal with rebasing on top of modified balloon code] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen-balloon: Move core balloon functionality out of moduleDaniel De Graaf2011-03-163-225/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic functionality of ballooning pages is useful for Xen drivers in general. Rather than require a dependency on the balloon module, split the functionality that is reused into the core. The balloon module is still required to follow ballooning requests from xenstore or to view balloon statistics in sysfs. Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen/balloon: Remove pr_info's and don't alter retry_countKonrad Rzeszutek Wilk2011-03-161-10/+2Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the past the retry_count (in other form of this code) was zero. Meaning retry forever. Do the same thing here without changing it to the value 16. Also remove some of the pr_info as there is no need to spam the user. Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen/balloon: Protect against CPU exhaust by event/x processDaniel Kiper2011-03-141-17/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Protect against CPU exhaust by event/x process during errors by adding some delays in scheduling next event and retry count limit. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen/balloon: Migration from mod_timer() to schedule_delayed_work()Daniel Kiper2011-03-141-13/+3Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migration from mod_timer() to schedule_delayed_work(). Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
| | * | | | xen/balloon: Removal of driver_pagesDaniel Kiper2011-03-141-8/+0Star
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Removal of driver_pages (I do not have seen any references to it). Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>