aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tests
Commit message (Collapse)AuthorAgeFilesLines
* tools/tests/xen-access: INT3 trap type is s/w exception.Keir Fraser2012-05-301-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* Add instruction length and trap type in HVMOP_inject_trap.Xudong Hao2012-05-301-1/+3
| | | | | | Signed-off-by: Xudong Hao <xudong.hao@intel.com> Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com> Signed-off-by: Keir Fraser <keir@xen.org>
* nstore: rename public xenstore headersIan Campbell2012-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | The xenstore header xs.h is producing conflicts with other software[1]. xs is a too short identifier and does not matche the library. Renaming the headers to xenstore.h and xenstore_lib.h is the easiest way to make them easy recognizable and prevent furthe problems. [1]: http://bugs.debian.org/668550 [ Also update QEMU_TAG, to bring in corresponding change to qemu-xen-traditional. -iwj ] Signed-off-by: Bastian Blank <waldi@debian.org> 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> --HG-- rename : tools/xenstore/xs.h => tools/xenstore/xenstore.h rename : tools/xenstore/xs_lib.h => tools/xenstore/xenstore_lib.h
* tools: xen-access: Check return values and clean up on errors during initAravindh Puthiyaparambil2012-04-241-58/+115
| | | | | | | | | | | Check the return values of the libxc mem_access calls. Free allocated structures (platform_info, domain_info) on errors during initialization and exit. Unbind VIRQ, close event channel and connection to Xen on errors during initialization Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Tools: After a helper maps a ring, yank it from the guest physmapTim Deegan2012-03-081-0/+5
| | | | | | | | | This limits the ability of the guest to play around with its own rings, and DoS itself. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Use a reserved pfn in the guest address space to store mem event ringsTim Deegan2012-03-081-43/+40
| | | | | | | | | | | | | | | | | | This solves a long-standing issue in which the pages backing these rings were pages belonging to dom0 user-space processes. Thus, if the process would die unexpectedly, Xen would keep posting events to a page now belonging to some other process. We update all API-consumers in tree (xenpaging and xen-access). This is an API/ABI change, so please speak up if it breaks your accumptions. The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Tools: Remove shared page from mem_event/access/paging interfacesTim Deegan2012-03-081-18/+4
| | | | | | | | | | | | | | | | | | | | | | Don't use the superfluous shared page, return the event channel directly as part of the domctl struct, instead. In-tree consumers (xenpaging, xen-access) updated. This is an ABI/API change, so please voice any concerns. Known pending issues: - pager could die and its ring page could be used by some other process, yet Xen retains the mapping to it. - use a saner interface for the paging_load buffer. This change also affects the x86/mm bits in the hypervisor that process the mem_event setup domctl. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* x86/mm: New sharing audit memopAndres Lagar-Cavilla2012-02-101-0/+11
| | | | | | | | | | | | | | | | | Remove costly mem_sharing audits from the inline path, and instead make them callable as a memop. Have the audit function return the number of errors detected. Update memshrtool to be able to trigger audits. Set sharing audits as enabled by default. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Use memops for mem paging, sharing, and access, instead of domctlsAndres Lagar-Cavilla2012-02-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Per page operations in the paging, sharing, and access tracking subsystems are all implemented with domctls (e.g. a domctl to evict one page, or to share one page). Under heavy load, the domctl path reveals a lack of scalability. The domctl lock serializes dom0's vcpus in the hypervisor. When performing thousands of per-page operations on dozens of domains, these vcpus will spin in the hypervisor. Beyond the aggressive locking, an added inefficiency of blocking vcpus in the domctl lock is that dom0 is prevented from re-scheduling any of its other work-starved processes. We retain the domctl interface for setting up and tearing down paging/sharing/mem access for a domain. But we migrate all the per page operations to use the memory_op hypercalls (e.g XENMEM_*). Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* Tools: Make xen-access test compile in 32 bits modeAndres Lagar-Cavilla2012-02-092-12/+13
| | | | | Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Keir Fraser <keir@xen.org>
* Tools: build testsAndres Lagar-Cavilla2012-02-061-0/+21
| | | | | | | | | | | | | Build tests as part of the tools build. It is enabled with CONFIG_TESTS in Config.mk Currently disabled build of tests/regressions and tests/xen-access (in 32-bit mode) as they fail. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* tools: memshrtool: tool to test and exercise the sharing subsystemAndres Lagar-Cavilla2012-01-272-0/+191
| | | | | | | | | | | | This is demo code meant to showcase how to perform sharing operations. It is useful for testing. [ Added appropriate lines to .hgignore and .gitignore -iwj ] Signed-off-by: Adin Scannell <adin@scannell.ca> Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* X86-MCE: fix a bug of xen-mceinj toolLiu, Jinsong2011-12-181-1/+5
| | | | | | | Fix a bug of xen-mceinj tool which used to test mce by software way. Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/emulator: workaround for AMD erratum 573Jan Beulich2011-12-161-0/+2
| | | | | | | | | | | | | | | | | The only cases where we might end up emulating fsincos (as any other x87 operations without memory operands) are - when a HVM guest is in real mode (not applicable on AMD) - between two half page table updates in PAE mode (unlikely, and not doing the emulation here does affect only performance, not correctness) - when a guest maliciously (or erroneously) modifies an (MMIO or page table update) instruction under emulation (unspecified behavior) Hence, in order to avoid the erratum to cause harm to the entire host, don't emulate fsincos on the affected AMD CPU families. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/emulator: add emulation of SIMD FP movesJan Beulich2011-12-011-0/+54
| | | | | | | | | | Clone the existing movq emulation to also support the most fundamental SIMD FP moves. Extend the testing code to also exercise these instructions. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86/emulator: generalize movq emulation (SSE2 and AVX variants)Jan Beulich2011-12-011-0/+187
| | | | | | | | | | | | Extend the existing movq emulation to also support its SSE2 and AVX variants, the latter implying the addition of VEX decoding. Fold the read and write cases (as most of the logic is identical), and add movntq and variants (as they're very similar). Extend the testing code to also exercise these instructions. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* test_x86_emulator: add a "run" target to the test code makefileJan Beulich2011-11-161-0/+4
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* x86_emulate: Define and use BUG() and bool_t.Keir Fraser2011-11-161-0/+6
| | | | | Original patch by Jan Beulich <jbeulich@suse.com> Signed-off-by: Keir Fraser <keir@xen.org>
* test_x86_emulate: Get public Xen headers via tools/include.Keir Fraser2011-11-163-4/+6
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86-64/test_x86_emulate: fix blowfish testJan Beulich2011-11-161-1/+1
| | | | | | | | Incorrect register usage in the _start() wrapper caused the 64-bit execution emulation to fail. Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* mem_event: use different ringbuffers for share, paging and accessOlaf Hering2011-09-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Up to now a single ring buffer was used for mem_share, xenpaging and xen-access. Each helper would have to cooperate and pull only its own requests from the ring. Unfortunately this was not implemented. And even if it was, it would make the whole concept fragile because a crash or early exit of one helper would stall the others. What happend up to now is that active xenpaging + memory_sharing would push memsharing requests in the buffer. xenpaging is not prepared for such requests. This patch creates an independet ring buffer for mem_share, xenpaging and xen-access and adds also new functions to enable xenpaging and xen-access. The xc_mem_event_enable/xc_mem_event_disable functions will be removed. The various XEN_DOMCTL_MEM_EVENT_* macros were cleaned up. Due to the removal the API changed, so the SONAME will be changed too. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Tim Deegan <tim@xen.org>
* tools/tests/xen-access: minor bug fixesAravindh Puthiyaparambil2011-05-091-5/+2
| | | | | | | | Fix a couple of minor bugs in xen-access test program: * Fix -m option handling. * Fix a segfault that was occurring during program exit. Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com>
* tools: remove pattern matched linking rulesIan Campbell2011-03-312-12/+7
| | | | | | | | | Most subdirs only build a single tool to start with and those which build multiple tools often have different linkage requirements. 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>
* tools: Remove $(CFLAGS) from links lines.Ian Campbell2011-03-312-9/+3
| | | | | | | | The relevant variable in these circumstances is called $(LDFLAGS). 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>
* tools: consistently use $({CFLAGS,LDLIBS}_libxenctrl) instead of open coding.Ian Campbell2011-03-212-2/+2
| | | | | | 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>
* tools: consistently use $(CFLAGS_xeninclude) instead of open coding.Ian Campbell2011-03-212-2/+2
| | | | | | | | Renamed from the slightly ambiguous CFLAGS_include. 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>
* tools: Drop XEN_XC variableIan Campbell2011-03-212-2/+0
| | | | | | | | | There is nothing to include in the python bindings source directory and likely never was/will be ... 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>
* tools: Drop use of $(INCLUDES)Ian Campbell2011-03-212-10/+8
| | | | | | | | | | Several places include it in CFLAGS even though it is never defined. A few others use it as nothing more than a gathering point for CFLAGS. Get rid of it. 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>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-174-4/+4
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* mem_access test tool: xen-accessJoe Epstein2011-01-082-0/+704
| | | | | | | | Added a test tool to let the memory access APIs be tested. This tool logs to stdout the memory accesses that the domain given is performing. Signed-off-by: Joe Epstein <jepstein98@gmail.com> Signed-off-by: Keir Fraser <keir@xen.org>
* tools/tests: Move x86 emulator tests into a subdirKeir Fraser2011-01-085-2/+2
| | | | | | | | | | | Signed-off-by: Keir Fraser <keir@xen.org> --HG-- rename : tools/tests/Makefile => tools/tests/x86_emulator/Makefile rename : tools/tests/blowfish.c => tools/tests/x86_emulator/blowfish.c rename : tools/tests/blowfish.mk => tools/tests/x86_emulator/blowfish.mk rename : tools/tests/test_x86_emulator.c => tools/tests/x86_emulator/test_x86_emulator.c rename : tools/tests/x86_emulate.c => tools/tests/x86_emulator/x86_emulate.c
* Xen MCE test: all test casesKeir Fraser2010-12-2411-0/+795
| | | | | | | | | | Implement the test cases. Each of cases will call the common function, then call mce inject tool. README for Xen MCE test suite, include the framwork and test instruction. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Haicheng Li<haicheng.li@intel.com> Signed-off-by: Xudong Hao <xudong.hao@intel.com>
* Xen MCE test: common functions to be used for test casesKeir Fraser2010-12-242-0/+286
| | | | | | | | | | Implement some common shell functions and variable definitions are defined to be used by test cases Verify fuctions include domain0 user space tool mcelog, Xen dmesg and guest kernel log verification. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Haicheng Li<haicheng.li@intel.com> Signed-off-by: Xudong Hao <xudong.hao@intel.com>
* Xen MCE test: utilities to inject fake MCE for X86Keir Fraser2010-12-243-0/+696
| | | | | | | | | | | A software MCE injection tool, which is based on Xen MCE injection mechanism. It fake MCE error and inject this error to a assigned Domain Physical Address. Makefile make sure the tool can be built on Xen. A README explain the usage for this tool. Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Haicheng Li<haicheng.li@intel.com> Signed-off-by: Xudong Hao <xudong.hao@intel.com>
* tools/tests: Test 64-bit x86 emulation in test_x86_emulate.Keir Fraser2010-10-114-393/+417
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded ↵Keir Fraser2010-07-251-4/+1
| | | | | | targets. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* xend: Add support for URI ('file:' and 'data:' scheme) for PV/kernelKeir Fraser2009-08-255-0/+566
| | | | | | | | | | | | | | | | | | | | | and PV/ramdisk Add support for 'file:' and 'data:' URI schemes for the parameters 'PV/kernel' and 'PV/ramdisk' in the VM.create() call. The 'data:' scheme handling enables using a file which is stored inside the management system (from where the XenAPI call is send) as kernel or ramdisk. Notes: o all included: a detailed description can be found in the xenapi documentation o bumped up the version of the API document to 1.0.8 (because of (minimal) interface extension) o Future enhancements (like http:, ftp: schemes) fit seamlessly into the current design / classes o Unittest cases and xm-test case included Signed-off-by: Andreas Florath <xen@flonatel.org>
* x86: miscellaneous emulator adjustmentsKeir Fraser2009-08-191-1/+1
| | | | | | | | | | | | | | | | | | Defer fail_if()-s as much as possible (in favor of possibly generating exceptions), and avoid generating exceptions when not strictly necessary. Avoid fail_if()-s for simple return code checks (making the code that used them consistent with other, longer existing code). Eliminate redundant generate_exception_if()-s checking lock_prefix (which is already covered by the general check prior to decoding operands). Also fix the testing code to add PROT_EXEC for the mapping that is intended to have instruction executed from. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* tools/tests/regression/: Fix some paths and scripts.Keir Fraser2009-08-024-52/+67
| | | | | | | | | o scripts and Makefile are mostly location independent now (exception XEN_ROOT in Makefile) o use of $() instead of ${} in Makefile From: Andreas Florath <xen@flonatel.org> Signed-off-by: Keir Fraser <Keir.Fraser@eu.citrix.com>
* tools/tests: Add syntax check for different versions of pythonKeir Fraser2009-07-285-0/+177
| | | | | From: Andreas Florath <xen@flonatel.org> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* build: Define cc-option-add to immediately add options to CFLAGSKeir Fraser2009-01-131-3/+3
| | | | | | | without deferring the test execution of CC. This avoids extra executions of CC every time CFLAGS is expanded. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tools: Don't turn CFLAGS into a := (immediate evaluation) variable asKeir Fraser2009-01-121-1/+1
| | | | | | this breaks 'CFLAGS += -MMD -MF .$(@F).d' Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: read/write/insn_fetch emulation hooks now all take aKeir Fraser2008-06-301-5/+4
| | | | | | | pointer to emulator data buffer, and an arbitrary byte count (up to the size of a page of memory). Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Support CMPXCHG16B.Keir Fraser2008-04-221-42/+6
| | | | | | | | Also clean up cmpxchg() callback handling so we can get rid of teh specific cmpxchg8b handler. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Implement a more dynamic interface for handling FPUKeir Fraser2008-04-161-6/+0
| | | | | | exceptions, which will allow emulation stubs to be built dynamically in a future patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 firmware: Consolidate firmware common build rules.Keir Fraser2008-04-021-4/+4
| | | | | | Also avoid overriding global optimisation default (-O1, -O2, etc.) Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Remove environment-specific definitions from coreKeir Fraser2008-03-313-22/+30
| | | | | emulator source files. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Allow writeback-avoidance optimisation to be defeated byKeir Fraser2008-02-211-0/+1
| | | | | | | | | | the caller. This is used in cases where the writeback may be to an MMIO region with side effects (the APIC EOI register is the main example of this). Also fix up build of the x86_emulate user-space test harness. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* tools: Avoid -nostdlib argument to $(LD).Keir Fraser2007-11-131-2/+1
| | | | | This interacts badly with GNU ld on Solaris. Signed-off-by: Keir Fraser <keir@xensource.com>
* solaris: Fix Solaris tools build.Keir Fraser2007-11-021-1/+0
| | | | | Signed-off-by: John Levon <john.levon@sun.com> Signed-off-by: Keir Fraser <keir@xensource.com>