aboutsummaryrefslogtreecommitdiffstats
path: root/xen
Commit message (Collapse)AuthorAgeFilesLines
* flask: move policy headers into hypervisorDaniel De Graaf2013-01-106-346/+25
| | | | | | | | | | Rather than keeping around headers that are autogenerated in order to avoid adding build dependencies from xen/ to files in tools/, move the relevant parts of the FLASK policy into the hypervisor tree and generate the headers as part of the hypervisor's build. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* xsm: Use the dummy XSM module if XSM is disabledDaniel De Graaf2013-01-106-754/+763
| | | | | | | | | | | | This patch moves the implementation of the dummy XSM module to a header file that provides inline functions when XSM_ENABLE is not defined. This reduces duplication between the dummy module and callers when the implementation of the dummy return is not just "return 0", and also provides better compile-time checking for completeness of the XSM implementations in the dummy module. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
* HVM xenstore strings and firmware passthrough headerRoss Philipson2013-01-101-0/+79
| | | | | | | | | Add public HVM definitions header for xenstore strings used in HVMLOADER. In addition this header describes the use of the firmware passthrough values set using xenstore. Signed-off-by: Ross Philipson <ross.philipson@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* VT-d: fix interrupt remapping source validation for devices behind legacy ↵Jan Beulich2013-01-091-1/+1
| | | | | | | | | | | bridges Using SVT_VERIFY_BUS here doesn't make sense; native Linux also uses SVT_VERIFY_SID_SQ here instead. This is XSA-33 / CVE-2012-5634. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* x86/hvm: Bind device-model event-channels to registered device-modelKeir Fraser2013-01-091-7/+9
| | | | | | domid during vcpu initialisation. Signed-off-by: Keir Fraser <keir@xen.org>
* nested vmx: synchronize page fault error code match and maskDongxiao Xu2013-01-081-0/+12
| | | | | | | | | | Page fault is specially handled not only with exception bitmaps, but also with consideration of page fault error code mask/match values. Therefore in nested virtualization case, the two values need to be synchronized from virtual VMCS to shadow VMCS. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* nested vmx: emulate IA32_VMX_MISC MSRDongxiao Xu2013-01-082-1/+4
| | | | | | | | | Use the host value to emulate IA32_VMX_MISC MSR for L1 VMM. For CR3-target value, we don't support this feature currently and set the number to zero. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86/hvm: Bind xen-created event channels to building domainDaniel De Graaf2013-01-081-2/+2
| | | | | | | | | | Instead of using a hardcoded domain 0 as the endpoint for the event channels created in hvm_vcpu_initialise, use the domain ID of the building domain so that a domain builder in a domain other than dom0 has the expected access to the event channels. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: fix assertion in get_page_type()Jan Beulich2013-01-071-1/+1
| | | | | | | | | | | | c/s 22998:e9fab50d7b61 (and immediately following ones) made it possible that __get_page_type() returns other than -EINVAL, in particular -EBUSY. Consequently, the assertion in get_page_type() should check for only the return values we absolutely don't expect to see there. This is XSA-37 / CVE-2013-0154. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* x86: compat_show_guest_stack() should not truncate MFNJan Beulich2013-01-071-2/+3
| | | | | | | | Re-using "addr" here was a mistake, as it is a 32-bit quantity. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* IOMMU: add option to specify devices behaving like ones using phantom functionsJan Beulich2013-01-071-0/+57
| | | | | | | | | At least certain Marvell SATA controllers are known to issue bus master requests with a non-zero function as origin, despite themselves being single function devices. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* VT-d: relax source qualifier for MSI of phantom functionsJan Beulich2013-01-071-1/+10
| | | | | | | | | With ordinary requests allowed to come from phantom functions, the remapping tables ought to be set up to allow for MSI triggers to come from other than the "real" device too. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* IOMMU: add phantom function supportJan Beulich2013-01-077-19/+167
| | | | | | | | | | | | | Apart from generating device context entries for the base function, all phantom functions also need context entries to be generated for them. In order to distinguish different use cases, a variant of pci_get_pdev() is being introduced that, even when passed a phantom function number, would return the underlying actual device. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* IOMMU/PCI: consolidate pdev_type() and cache its result for a given deviceJan Beulich2013-01-075-27/+40
| | | | | | | | | | | | | Add an "unknown" device types as well as one for PCI-to-PCIe bridges (the latter of which other IOMMU code with or without this patch doesn't appear to handle properly). Make sure we don't mistake a device for which we can't access its config space as a legacy PCI device (after all we in fact don't know how to deal with such a device, and hence shouldn't try to). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* AMD IOMMU: adjust flush function parametersJan Beulich2013-01-073-9/+9
| | | | | | | ... to use a (struct pci_dev *, devfn) pair. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* VT-d: adjust context map/unmap parametersJan Beulich2013-01-073-25/+23
| | | | | | | ... to use a (struct pci_dev *, devfn) pair. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* IOMMU: adjust add/remove operation parametersJan Beulich2013-01-076-56/+59
| | | | | | | ... to use a (struct pci_dev *, devfn) pair. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* IOMMU: adjust (re)assign operation parametersJan Beulich2013-01-074-70/+46
| | | | | | | ... to use a (struct pci_dev *, devfn) pair. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
* mergeIan Campbell2013-01-041-3/+3
|\
| * passthrough/domctl: use correct struct in unionAndrew Cooper2013-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | This appears to be a copy paste error from c/s 23861:ec7c81fbe0de. It is safe, functionally speaking, as both the xen_domctl_assign_device and xen_domctl_get_device_group structure start with a 'uint32_t machine_sbdf'. We should however use the correct union structure. Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* | xen: arm: fix guest register access.Ian Campbell2012-12-205-9/+74
| | | | | | | | | | | | | | | | | | We weren't taking the guest mode (CPSR) into account and would always access the user version of the registers. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* | arm: trim pagetable flag definitions to fit in 80 charactersTim Deegan2012-12-201-4/+4
|/ | | | | | Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86: also print CRn register values upon double faultJan Beulich2012-12-201-16/+13
| | | | | | | Do so by simply re-using _show_registers(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: arm: remove now empty dummy.SIan Campbell2012-12-192-9/+0
| | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: remove nr_irqs_gsi from generic codeIan Campbell2012-12-196-14/+11
| | | | | | | | | | | | | | | | The concept is X86 specific. AFAICT the generic concept here is the number of static physical IRQs which the current hardware has, so call this nr_static_irqs. Also using "defined NR_IRQS" as a standin for x86 might have made sense at one point but its just cleaner to push the necessary definitions into asm/irq.h. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: mark early_panic as a noreturn functionIan Campbell2012-12-191-1/+1
| | | | | | | | | | | | Otherwise gcc complains about variables being used when not initialised when in fact that point is never reached. There aren't any instances of this in tree right now, I noticed this while developing another patch. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: introduce arm32 as a subarch of arm.Ian Campbell2012-12-1938-27/+30
| | | | | | | | | | | | | | - move 32-bit specific files into subarch specific arm32 subdirectory. - move gic.h to xen/include/asm-arm (it is needed from both subarch and generic code). - make the appropriate build and config file changes to support XEN_TARGET_ARCH=arm32. This prepares us for an eventual 64-bit subarch. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: reorder registers in struct cpu_user_regs.Ian Campbell2012-12-194-7/+11
| | | | | | | | | | | | | Primarily this is so that they are ordered in the same way as the mapping from arm64 x0..x31 registers to the arm32 registers, which is just less confusing for everyone going forward. It also makes the implementation of select_user_regs in the next patch slightly simpler. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: remove hard tabs from asm code.Ian Campbell2012-12-194-471/+498
| | | | | | | | | | | Run expand(1) over xen/arch/arm/.../*.S Add emacs local vars block. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> [ijc -- stripped trailing whitespace caught by git apply] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: fix long lines in entry.SIan Campbell2012-12-191-33/+33
| | | | | | | | This is a purely whitespace change. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: implement share_xen_page_with_privileged_guestsIan Campbell2012-12-192-3/+6
| | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: implement send_timer_event.Ian Campbell2012-12-192-1/+7
| | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: initialise dom_{xen,io,cow}Ian Campbell2012-12-194-2/+31
| | | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub domain_relinquish_resources.Ian Campbell2012-12-192-1/+7
| | | | | | | | | Currently unimplemented. Domain teardown in general needs looking at. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub out domain_get_maximum_gpfnIan Campbell2012-12-192-1/+5
| | | | | | | | | | It currently has no callers, so return ENOSYS until such a time as one arrives. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub page_is_ram_type.Ian Campbell2012-12-192-3/+6
| | | | | | | | | | | | | | Callers are VT-d (so x86 specific) and various bits of page offlining support, which although it looks generic (and is in xen/common) does things like diving into page_info->count_info which is not generic. In any case on this is only reachable via XEN_SYSCTL_page_offline_op, which clearly shouldn't be called on ARM just yet. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub out steal_page.Ian Campbell2012-12-192-3/+6
| | | | | | | | | | Callers handle the failure gracefully, can be called by GNTTABOP_transfer, XENMEM_exchange or tmem. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub out wallclock time.Ian Campbell2012-12-192-5/+18
| | | | | | | | | | | | | We don't currently have much concept of wallclock time on ARM (for either the hypervisor, dom0 or guests). For now just stub everything out. Specifically domain_set_time_offset, update_vcpu_system_time and wallclock_time. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> ` Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: stub out pirq related functions.Ian Campbell2012-12-192-4/+29
| | | | | | | | | | On ARM we use GIC functionality to inject virtualised real interrupts for h/w devices rather than evtchn-pirqs. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: implement arch_vcpu_reset.Ian Campbell2012-12-192-1/+5
| | | | | | | | | Untested. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: implement arch_get_info_guestIan Campbell2012-12-192-1/+17
| | | | | | | | | Untested, but basically the inverse of arch_set_info_guest. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: make smp_send_state_dump a real functionIan Campbell2012-12-192-3/+6
| | | | | | | | | It still doesn't do anything useful, but at least it isn't in dummy.S! Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: define node_online_map.Ian Campbell2012-12-193-2/+4
| | | | | | | | | | For now just initialise it as a single online node, which is what asm-arm/numa.h assumes anyway. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen: arm: Call init_xen_time earlierIan Campbell2012-12-191-2/+2
| | | | | | | | | | If we panic before calling init_xen_time then the "Rebooting in 5 seconds" delay ends up calling udelay which uses cntfrq before it has been initialised resulting in a divide by zero. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* xen/arm: do not map vGIC twice for dom0Stefano Stabellini2012-12-191-2/+0
| | | | | | | | | We don't need to manually set the P2M for the vGIC in construct_dom0, because we have already done it generally for every guest in gicv_setup. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* x86, amd: Disable way access filter on Piledriver CPUsAndre Przywara2012-12-192-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Way Access Filter in recent AMD CPUs may hurt the performance of some workloads, caused by aliasing issues in the L1 cache. This patch disables it on the affected CPUs. The issue is similar to that one of last year: http://lkml.indiana.edu/hypermail/linux/kernel/1107.3/00041.html This new patch does not replace the old one, we just need another quirk for newer CPUs. The performance penalty without the patch depends on the circumstances, but is a bit less than the last year's 3%. The workloads affected would be those that access code from the same physical page under different virtual addresses, so different processes using the same libraries with ASLR or multiple instances of PIE-binaries. The code needs to be accessed simultaneously from both cores of the same compute unit. More details can be found here: http://developer.amd.com/Assets/SharedL1InstructionCacheonAMD15hCPU.pdf CPUs affected are anything with the core known as Piledriver. That includes the new parts of the AMD A-Series (aka Trinity) and the just released new CPUs of the FX-Series (aka Vishera). The model numbering is a bit odd here: FX CPUs have model 2, A-Series has model 10h, with possible extensions to 1Fh. Hence the range of model ids. Signed-off-by: Andre Przywara <osp@andrep.de> Add and use MSR_AMD64_IC_CFG. Update the value whenever it is found to not have all bits set, rather than just when it's zero. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* xen/arch/*: add struct domain parameter to arch_do_domctlDaniel De Graaf2012-12-186-411/+84
| | | | | | | | | | | | | | | Since the arch-independent do_domctl function now RCU locks the domain specified by op->domain, pass the struct domain to the arch-specific domctl function and remove the duplicate per-subfunction locking. This also removes two get_domain/put_domain call pairs (in XEN_DOMCTL_assign_device and XEN_DOMCTL_deassign_device), replacing them with RCU locking. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* xen: lock target domain in do_domctl common codeDaniel De Graaf2012-12-181-209/+59
| | | | | | | | | | | Because almost all domctls need to lock the target domain, do this by default instead of repeating it in each domctl. This is not currently extended to the arch-specific domctls, but RCU locks are safe to take recursively so this only causes duplicate but correct locking. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* nested vmx: nested TPR shadow/threshold emulationDongxiao Xu2012-12-182-3/+44
| | | | | | | | | | | | | | | | | TPR shadow/threshold feature is important to speedup the boot time for Windows guest. Besides, it is a must feature for certain VMM. We map virtual APIC page address and TPR threshold from L1 VMCS, and synch it into shadow VMCS in virtual vmentry. If TPR_BELOW_THRESHOLD VM exit is triggered by L2 guest, we inject it into L1 VMM for handling. Besides, this commit fixes an issue for apic access page, if L1 VMM didn't enable this feature, we need to fill zero into the shadow VMCS. Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Committed-by: Keir Fraser <keir@xen.org>
* xen: sched_credit: add some tracingDario Faggioli2012-12-181-1/+34
| | | | | | | | About tickling, and PCPU selection. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>