aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* libelf-loader: introduce elf_load_imageStefano Stabellini2012-01-235-8/+44
| | | | | | | | | | | | | | Implement a new function, called elf_load_image, to perform the actually copy of the elf image and clearing the padding. The function is implemented as memcpy and memset when the library is built as part of the tools, but it is implemented as raw_copy_to_guest and raw_clear_guest when built as part of Xen, so that it can be safely called with an HVM style dom0. 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>
* Introduce clear_user and clear_guestStefano Stabellini2012-01-2312-0/+527
| | | | | | | | | | | | Introduce clear_user for x86 and ia64, shamelessly taken from Linux. The x86 version is the 32 bit clear_user implementation. Introduce clear_guest for x86 and ia64. The x86 implementation is based on clear_user and a new clear_user_hvm function. The ia64 implementation is actually in xencomm and it is based on xencomm_copy_to_guest. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jan Beulich <JBeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* xen: implement an signed 64 bit division helper functionStefano Stabellini2012-01-231-0/+19
| | | | | | | | | Implement a C function to perform 64 bit signed division and return both quotient and remainder. Useful as an helper function to implement __aeabi_ldivmod. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* A collection of fixes to Xen common filesStefano Stabellini2012-01-237-10/+16
| | | | | | | | | | | | | | | | - call free_xenoprof_pages only ifdef CONFIG_XENOPROF; - define PRI_stime as PRId64 in an header file; - respect boundaries in is_kernel_*; - implement is_kernel_rodata; - guest_physmap_add_page should be ((void)0). - fix guest_physmap_add_page; - introduce CONFIG_XENOPROF; - define _srodata and _erodata as const char*. 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>
* Include some header files that are not automatically included on all archsStefano Stabellini2012-01-2313-2/+17
| | | | | | | 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>
* Move cpufreq option parsing to cpufreq.cStefano Stabellini2012-01-233-33/+35
| | | | | | | | 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> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* xenoprof: Make the escape code consistent across 32 and 64-bit xenGeorge Dunlap2012-01-231-1/+1
| | | | | | | | | | | | | | | | At the moment, the xenoprof escape code is defined as "~0UL". Unfortunately, this expands to 0xffffffff on 32-bit systems and 0xffffffffffffffff on 64-bit systems; with the result that while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as "compat mode") is broken. This patch makes the definition consistent across architectures. In so doing, it will break old-32-bit-on-new-Xen, and vice versa; but this was seen as an acceptable thing to do. Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisorGeorge Dunlap2012-01-231-7/+41
| | | | | | | | | | | | | The dump_guest_backtrace() function attempted to walk the stack based on the assumption that the guest and hypervisor pointer sizes were the same; thus any 32-bit guest running under 64-bit hypervisor would have unreliable results. In 64-bit mode, read the 32-bit stack frame properly. Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* xenoprof: Adjust indentationGeorge Dunlap2012-01-231-44/+44
| | | | | | | | | Bring indentation into Xen hypervisor standard coding style. No functional changes. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/vMSI: miscellaneous fixesJan Beulich2012-01-234-34/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | This addresses a number of problems in msixtbl_{read,write}(): - address alignment was not checked, allowing for memory corruption in the hypervisor (write case) or returning of hypervisor private data to the guest (read case) - the interrupt mask bit was permitted to be written by the guest (while Xen's interrupt flow control routines need to control it) - MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain numbers (making it unobvious why they have these values, and making the latter non-portable) - MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a non-zero table offset); this was also affecting host MSI-X code - struct msixtbl_entry's table_flags[] was one element larger than necessary due to improper open-coding of BITS_TO_LONGS() - msixtbl_read() unconditionally accessed the physical table, even though the data was only needed in a quarter of all cases - various calculations were done unnecessarily for both of the rather distinct code paths in msixtbl_read() Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was chosen to be 3. Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/hvm: No need to arch_set_info_guest() before restoring per-vcpu HVM state.Keir Fraser2012-01-225-49/+25
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* tools/libvchan: Beef up the CPU barriers in libvchan.Keir Fraser2012-01-211-9/+9
| | | | | | Although they were sufficient for x86, they weren't safe more generally. Signed-off-by: Keir Fraser <keir@xen.org>
* libxc: Update rmb/wmb for x86.Keir Fraser2012-01-211-4/+6
| | | | | | Only the compiler needs to see the barriers; not the CPU. Signed-off-by: Keir Fraser <keir@xen.org>
* libxl: libxl_qmp.c should use libxl's own list macros, since theyKeir Fraser2012-01-211-9/+10
| | | | | | | exist. Also, older Linux versions do not have SIMPLEQ macros in sys/queue.h. Signed-off-by: Keir Fraser <keir@xen.org>
* x86/hvm: Fix earlier hvm_load_cpu_ctxt() breakage.Keir Fraser2012-01-201-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* vpmu: separate architecture specific PMU initialisationDietmar Hahn2012-01-204-39/+60
| | | | | | | | | This patch moves the architecture specific initialisation of the PMU into the archicture specific directory. Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com> Signed-off-by: Keir Fraser <keir@xen.org> Committed-by: Keir Fraser <keir@xen.org>
* x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.Keir Fraser2012-01-201-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* iommu: Move IOMMU faults handling into softirq for AMD-Vi.Dario Faggioli2012-01-201-3/+41
| | | | | | | | | | | | Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a softirq-tasklet, raised by the actual IRQ handler. To avoid more interrupts being generated (because of further faults), they must be masked in the IOMMU within the low level IRQ handler and enabled back in the tasklet body. Notice that this may cause the log to overflow, but none of the existing entry will be overwritten. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/hvm: Allow wake up of offline vcpu via nmi-ipiJuergen Gross2012-01-201-0/+9
| | | | | | | | | | On a real machine a cpu disabled via hlt with interrupts disabled can be reactivated via a nmi ipi. Enable the hypervisor to do this for hvm, too. Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Signed-off-by: Keir Fraser <keir@xen.org> Committed-by: Keir Fraser <keir@xen.org>
* xen: Simplify callers of boot_vcpu(). In VCPUOP_up, checkKeir Fraser2012-01-203-22/+17
| | | | | | is_initialised under the per-domain lock. Signed-off-by: Keir Fraser <keir@xen.org>
* x86/mm: refine epte_present testTim Deegan2012-01-191-1/+5
| | | | | | | | | | | | | | | | | | The current test for a present ept entry checks for a permission bit to be set. While this is valid in contexts in which we want to know whether an entry will fault, it is not correct when it comes to testing whether an entry is valid. Specifically, in the ept_change_entry_type_page function which is used to set entries to the log dirty type. In combination with a p2m access type like n or n2rwx, log dirty will not be set for ept entries for which it should. Reported-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Tim Deegan <tim@xen.org>
* Correct p2m unlocking during grant table mapAndres Lagar-Cavilla2012-01-191-2/+6
| | | | | | | | We were not putting gfn's consistently. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_adAndres Lagar-Cavilla2012-01-191-2/+2
| | | | | | | Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: Improve ring management for memory events. Do not lose guest eventsAndres Lagar-Cavilla2012-01-197-121/+340
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is an amalgamation of the work done by Olaf Hering <olaf@aepfle.de> and our work. It combines logic changes to simplify the memory event API, as well as leveraging wait queues to deal with extreme conditions in which too many events are generated by a guest vcpu. In order to generate a new event, a slot in the ring is claimed. If a guest vcpu is generating the event and there is no space, it is put on a wait queue. If a foreign vcpu is generating the event and there is no space, the vcpu is expected to retry its operation. If an error happens later, the function returns the claimed slot via a cancel operation. Thus, the API has only four calls: claim slot, cancel claimed slot, put request in the ring, consume the response. With all these mechanisms, no guest events are lost. Our testing includes 1. ballooning down 512 MiBs; 2. using mem access n2rwx, in which every page access in a four-vCPU guest results in an event, with no vCPU pausing, and the four vCPUs touching all RAM. No guest events were lost in either case, and qemu-dm had no mapping problems. Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* add NULL checks in code added by 24492:6c104b46ef89Jan Beulich2012-01-192-2/+19
| | | | | | | | Also a couple of missing is_hvm_domain() checks. Further properly pass the PCI segment in a call to pci_get_pdev(). Signed-off-by: Jan Beulich <jbeulich@suse.com>
* libxl: VM generation ID: Add missing gate for HVM domain.Paul Durrant2012-01-171-1/+3
| | | | | | | | This will fix localhost migrate failures found by the automatic tests. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* sched_credit: Use delay to control scheduling frequencyHui Lv2012-01-174-1/+57
| | | | | | | | | | | | | | | | | | | | This patch can improve Xen performance: 1. Basically, the "delay method" can achieve 11% overall performance boost for SPECvirt than original credit scheduler. 2. We have tried 1ms delay and 10ms delay, there is no big difference between these two configurations. (1ms is enough to achieve a good performance) 3. We have compared different load level response time/latency (low, high, peak), "delay method" didn't bring very much response time increase. 4. 1ms delay can reduce 30% context switch at peak performance, where produces the benefits. (int sched_ratelimit_us = 1000 is the recommended setting) Signed-off-by: Hui Lv <hui.lv@intel.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* Move IOMMU faults handling into softirq for VT-d.Dario Faggioli2012-01-171-3/+36
| | | | | | | | | | | | Dealing with interrupts from VT-d IOMMU(s) is deferred to a softirq-tasklet, raised by the actual IRQ handler. Since a new interrupt is not generated, even if further faults occur, until we cleared all the pending ones, there's no need of disabling IRQs, as the hardware does it by its own. Notice that this may cause the log to overflow, but none of the existing entry will be overwritten. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* libxl: drop vfs path -- fsback/front were deleted some time agoIan Campbell2012-01-161-2/+0
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* ocaml: Correct ocaml type name for Aggregate types.Ian Campbell2012-01-101-0/+2
| | | | | | | | No change to the generated code because this path isn't used yet. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* cleanup get_gfn_from_base_reg() function.Wei Wang2012-01-162-22/+3
| | | | | | Signed-off-by: Wei Wang <wei.wang2@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* fix compat header generation after 24503:86b8a1e3a419Jan Beulich2012-01-162-3/+3
| | | | | | | | | At once also remove the duplicate forced inclusion of public/xen-compat.h there (it's already done through cppflags-y) and convert --include to the canonical -include in said c/s' adjustments to CFLAGS-y and AFLAGS-y. Signed-off-by: Jan Beulich <jbeulich@suse.com>
* sedf: remove useless tracing printk and harmonize comments style.Dario Faggioli2012-01-151-274/+229
| | | | | | | | | | | | | | | | | | sched_sedf.c used o have its own mechanism for producing tracing-alike kind of information (domain block, wakeup, etc.). Nowadays, with an even not so high number of pCPUs/vCPUs, just trying to enable this makes the serial console completely unusable, produces tons of very hard to parse and interpreet logging and can easily livelock Dom0. Moreover, pretty much the same result this is struggling to get to, is better achieved by enabling the scheduler-related tracing events, as it is for the other schedulers (say, credit or credit2). For all these reasons, this removes that machinery completely. While at it, check in some cosmetics that harmonize the comments withim themself and with the rest of the code base. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
* x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86Keir Fraser2012-01-1519-48/+46
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* libxl: Fix leaks on context init failureIan Jackson2012-01-131-8/+12
| | | | | | | | | | | | Several of the error exits from libxl_ctx_alloc leaked the context struct itself and sometimes other resources too. Fix this by using the standard "rc = ERROR_FOO; goto out" error handling style throughout. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: Provide more formal libxl__ctx_lock and _unlockIan Jackson2012-01-131-10/+13
| | | | | | | | | | | | | | Previously the only official interface for the ctx lock was the CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx" from the surrounding scope. Instead, provide libxl__ctx_lock and _unlock functions which can be used by these convenience macros, and other callers who have nonstandard requirements. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: move a lot more includes into libxl_internal.hIan Jackson2012-01-1327-138/+53
| | | | | | | | | | | | | | | | | Move a lot of #include <stdfoo.h> from individual files into libxl_internal.h. This helps avoid portability mistakes where necessary system headers are omitted from individual files, and is also of course a convenience when developing. Also add #include "libxl_osdeps.h" /* must come before any other headers */ to the top of most libxl*.c files, so that anyone who adds any headers before libxl_internal.h will put the in the right place. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* xenstore: New function xs_path_is_subpathIan Jackson2012-01-132-0/+24
| | | | | | | | | This utility function compares two paths, textually and reports whether one is a subpath (a child path) of the other. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* libxl: make LIBXL_INIT_GC a statement, not an initialiserIan Jackson2012-01-132-3/+8
| | | | | | | | | | | | | | | | | | | | | Previously LIBXL_INIT_GC was an initialiser, which you were expected to use like this: libxl__gc gc = LIBXL_INIT_GC(ctx); But we are going to want to put things in the gc which are to be initialised using other macros. That means that LIBXL_INIT_GC has to become a statement too. So instead, we make it so that it's used like this: libxl_gc gc; LIBXL_INIT_GC(gc,ctx); In fact there are only a couple of callers now, including GC_INIT which uses this trick: libxl_gc gc[1]; LIBXL_INIT_GC(gc[0],ctx); Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* .gitignore: ocaml: add xenlight.mliIan Jackson2012-01-131-0/+1
| | | | | Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* remove inclusion of asm/config.hJan Beulich2012-01-1313-16/+1
| | | | | | | | | This was always bogus (xen/config.h should have been used instead) and is superfluous now that xen/config.h gets included through the compiler command line. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* force inclusion of xen/config.h through compiler optionJan Beulich2012-01-1335-41/+2
| | | | | | | | | | | | | 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>
* libxl: fix build with make prior to 3.81Jan Beulich2012-01-121-1/+3
| | | | | | | | | Up to 3.80, make only supported simple 'else' constructs, which got violated by 24432:e0effa7c04f5. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* .gitignoreIan Jackson2012-01-121-0/+372
| | | | | | | | Introduce a .gitignore file for the convenience of people who use git. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86/mm: Fix operator associativity bug in mm-locks.hTim Deegan2012-01-121-2/+2
| | | | | | | | | | | | | In an order-enforcing wrapper for an "external" recursive lock, we aim to increment/decrement a recurse count and only update the lock ordering on zero counts. Unfortunately we incrementing/decrementing the pointer to the recurse count, rather than the count itself. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
* x86-64: globally use -mno-sseJan Beulich2012-01-122-2/+2
| | | | | | | | This eliminates pointless prologue code from functions having variable argument lists (since that way xmm registers can't possibly be passed). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: properly define size_tJan Beulich2012-01-122-4/+10
| | | | | | | | | | | | | | Having it defined unilaterally as 'unsigned long' got me surprised recently when I tried to use the 'z' printk type modifier, as that is expected by the compiler to be used only on the type it knows size_t is supposed to have. Generally the compiler provides a construct to do this, so use it when available. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Christoph Egger <Christoph.Egger@amd.com>
* x86: move and fold certain type property definitionsJan Beulich2012-01-122-10/+5
| | | | | | | | | | Not only is it less code to have them consolidated, it also permits their use virtually everywhere (since config.h is required to be included everywhere. (Shouldn't we, btw, follow Linux and remove the explicit inclusion in favor of command line enforced one?) Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* amd iommu: Enable FC bit in iommu host level PTEWei Wang2012-01-121-0/+7
| | | | | Signed-off-by: Wei Wang <wei.wang2@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>
* amd iommu: add ppr log processing into iommu interrupt handlingWei Wang2012-01-121-42/+121
| | | | | | | | PPR log and event log share the same interrupt source. Interrupt handler should check both of them. Signed-off-by: Wei Wang <wei.wang2@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>