aboutsummaryrefslogtreecommitdiffstats
path: root/tools/tests
Commit message (Collapse)AuthorAgeFilesLines
* x86_emulate: fix flag setting for 8-bit signed multiplicationJan Beulich2013-09-201-0/+2
| | | | | | | | | | | | | | | We really need to check for a signed overflow of 8 bits, while the previous check compared the sign-extended 8-bit result with the zero-extended 16-bit one (which was wrong for all negative results). Once at it - also adjust the 16-bit comparison for symmetry - improve the 8-bit multiplication (no need to zero-extend to 32-bits the sign-extended to 16 bits original 8-bit value) - fold both signed multiplication variants Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86_emulate: MOVSXD must read source operand just onceJan Beulich2013-09-201-4/+62
| | | | | | | | | | | | ... for the case of accessing MMIO. Also streamline the ARPL emulation a little, and add tests for both instructions (the MOVSXD one requires a few other adjustments, as we now need to run in a mode where the emulator's mode_64bit() returns true). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: fix dependencies of emulator testJan Beulich2013-09-201-6/+5
| | | | | | | | | | | | Rather than mentioning the (linked) directory, mention the files thus making sure things get rebuild as needed when the core emulator files change. Also enable debug info generation unconditionally, as this is testing stuff only anyway. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: AVX instruction emulation fixesJan Beulich2013-08-281-6/+138
| | | | | | | | | | | | | | | | | | | - we used the C4/C5 (first prefix) byte instead of the apparent ModR/M one as the second prefix byte - early decoding normalized vex.reg, thus corrupting it for the main consumer (copy_REX_VEX()), resulting in #UD on the two-operand instructions we emulate Also add respective test cases to the testing utility plus - fix get_fpu() (the fall-through order was inverted) - add cpu_has_avx2, even if it's currently unused (as in the new test cases I decided to refrain from using AVX2 instructions in order to be able to actually run all the tests on the hardware I have) - slightly tweak cpu_has_avx to more consistently express the outputs we don't care about (sinking them all into the same variable) Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* tools: xen-mceinj: Add missing return value checksBastian Blank2013-08-191-2/+4
| | | | | | | | | | | The return value of vasprintf must be checked. This check is enforced with the compiler options used in Debian by request and in Ubuntu by default. Check the return value and abort on error. Signed-off-by: Bastian Blank <waldi@debian.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xen, libxc: rename xenctl_cpumap to xenctl_bitmapDario Faggioli2013-04-171-1/+1
| | | | | | | | | | | | | | | | | | More specifically: 1. replaces xenctl_cpumap with xenctl_bitmap 2. provides bitmap_to_xenctl_bitmap and the reverse; 3. re-implement cpumask_to_xenctl_bitmap with bitmap_to_xenctl_bitmap and the reverse; Other than #3, no functional changes. Interface only slightly afected. This is in preparation of introducing NUMA node-affinity maps. Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Keir Fraser <keir@xen.org>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* tools/tests: Restrict some tests to x86 onlyIan Campbell2012-12-211-2/+2
| | | | | | | | MCE injection and x86_emulator are clearly x86 specific. 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>
* x86: save/restore only partial register state where possibleJan Beulich2012-10-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | ... and make restore conditional not only upon having saved the state, but also upon whether saved state was actually modified (and register values are known to have been preserved). Note that RBP is unconditionally considered a volatile register (i.e. irrespective of CONFIG_FRAME_POINTER), since the RBP handling would become overly complicated due to the need to save/restore it on the compat mode hypercall path [6th argument]. Note further that for compat mode code paths, saving/restoring R8...R15 is entirely unnecessary - we don't allow those guests to enter 64-bit mode, and hence they have no way of seeing these registers' contents (and there consequently also is no information leak, except if the context saving domctl would be considered such). Finally, note that this may not properly deal with gdbstub's needs, yet (but if so, I can't really suggest adjustments, as I don't know that code). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* 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>