Commit Graph
22673 Commits
Author SHA1 Message Date
Joe Epstein cd0e05deeb mem_access: added trap injection to libxc
* Carries forward the trap injection hypercall into libxc

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
2011-01-07 11:54:50 +00:00
Joe Epstein df402bb9f0 mem_access: added INT3/CRx capture
* Allows a memory event listener to register for events on changes to
  CR0, CR3, and CR4, as well as INT3 instructions, as a part of the
  mem_access mechanism.  These events can be either synchronous or
  asynchronous.

* For INT3, the logic works independent of a debugger, and so both can
  be supported.

* The presence and type of listener are stored and accessed through
  HVM params.

* Changed the event mask handling to ensure that the right events are
  captured based on the listeners.

* Added the ability to inject HW/SW traps into a VCPU when it next
  resumes (rather than try to modify the existing IRQ injection
  code paths).  Only one trap to inject can be outstanding at a time.

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-07 11:54:48 +00:00
Joe Epstein 81f8af44ba mem_access: HVMOPs for setting mem access
* Creates HVMOPs for setting and getting memory access.  The hypercalls
  can set individual pages or the default access for new/refreshed
  pages.

* Added functions to libxc to access these hypercalls.

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-07 11:54:45 +00:00
Joe Epstein b405792883 mem_access: access listener can be required
* Adds the ability to set that a domain that an access listener;
  that is, it pauses the VCPU if there is no memory event listener.

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-01-07 11:54:42 +00:00
Joe Epstein fbbedcae8c mem_access: mem event additions for access
* Adds an ACCESS memory event type, with RESUME as the action.

* Refactors the bits in the memory event to store whether the memory event
  was a read, write, or execute (for access memory events only).  I used
  bits sparingly to keep the structure somewhat the same size.

* Modified VMX to report the needed information in its nested page fault.
  SVM is not implemented in this patch series.

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-07 11:54:40 +00:00
Joe Epstein a6cdb95450 mem_access: introduce P2M mem_access types
* Introduces access types for each page, giving independent read, write, and
  execute permissions for each page.  The permissions are restrictive from
  what the page type gives: for example, a p2m_type_ro page with an access of
  p2m_access_rw would have read-only permissions in total, as p2m_type_ro
  removed write access and p2m_access_rw removed execute access.

* Implements the access flag storage for EPT, moving some bits from P2M type,
  which had 10 bits of storage, to the four bits for access.

* Access flags are stored according to a loose consistency contract, where
  pages can be reset to the default access permissions at any time.  Right
  now, that happens on page type changes, where one would want to reevaluate
  whether permissions make sense for that page as they are anyway.

Signed-off-by: Joe Epstein <jepstein98@gmail.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-01-07 11:54:36 +00:00
Keir Fraser 84be7c5af4 kexec: correct _domain offset info in elf-notes
The hypervisor writes some data structure infos into the elf note
section of the vmcore to enable interpretation of the xen structures
by kexec/kdump.

The info of the offset of _domain in page_info was just wrong on
non-ia64 systems.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-01-06 19:02:36 +00:00
Anthony PERARD 5f96182f5c libxl: Lists qdisk device in libxl_device_disk_list
As libxl switch to qdisk when blktap isn't available, this patch makes
libxl_device_disk_list also list qdisk device. So
libxl_build_device_model_args_new will be able to add qdisk device to
the command line options of Qemu.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 18:04:48 +00:00
Anthony PERARD 8e173f3bc3 libxl: Factorize function libxl_device_disk_list
This patch adds function libxl_append_disk_list_of_type to get disks
parameter of one backend type.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 18:03:11 +00:00
Ian Campbell 30cbc3ec4b ocaml: evtchn+xc bindings: use libxenctrl and libxenguest
Now that tools/libxc is licensed under LGPL I don't think there is any need for
an LGPL reimplementation under tools/ocaml.

For the most part the conversion to the up-to-date libxc API (xc_lib.c
essentially implemented the same interface as an older libxc) was pretty
automatic. There are some functions which appear to no longer exist in libxc
which I therefore simply removed the bindings for and a small number of
interfaces which had changed.

Many of the functions bound by the stubs have no in-tree users (which I think
is fine for a language binding) so I have no way to confirm correctness other
than by eye. I was however able to confirm that oxenstored still worked and to
build a XCP toolstack which could successfully start a PV guest.

Uses the new XC_OPENFLAG_NON_REENTRANT option to avoid potential conflicts
between pthreads and the ocaml runtime.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Vincent Hanquez <Vincent.Hanquez@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:37:00 +00:00
Ian Campbell daec2beeaf ocaml: rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virq
Rename Evtchn.bind_virq as Evtchn.bind_dom_exc_virq
to reflect its actual behaviour.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:34:46 +00:00
Ian Campbell 2bdf003296 ocaml: add dependency to module metadata
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:33:39 +00:00
Ian Campbell c49dd14bb2 ocaml: resynchronise uuid library with xen-api-libs.hg
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:33:00 +00:00
Eamon Walsh e65f8bcea1 libxl: Correct paths in libxl__fill_dom0_memory_info function
Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:28:13 +00:00
Ian Jackson 6d719d6028 Merge 2011-01-06 17:26:53 +00:00
Christoph Egger f1223b4eec libxc: portability fixes for NetBSD
Attached patch makes libxc build again on NetBSD after the recent rework.

[ Modified by iwj:

I changed the name of the new make variable from LIBDL to DLOPEN_LIBS.
The latter conforms to the naming scheme for similar variables found
in config/*.mk - PTHREAD_LIBS et al.

Also I moved the setting of the variable to -dl from Linux to StdGNU
(which makes it apply more widely) and also added it to SunOS.mk
(based on pure guesswork). ]

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 17:26:26 +00:00
Tim Deegan 6b43e7533c mem_sharing: fix race condition of nominate and unshare
(1) When updating/checking p2m type for mem_sharing, we must hold shr_lock
(2) For nominate operation, if the page is already nominated, return the
    handle from page_info->shr_handle
(3) For unshare operation, it is possible that multiple users unshare a
    page via hvm_hap_nested_page_fault() at the same time. If the page
    is already un-shared by someone else, simply return success.

Signed-off-by: Jui-Hao Chiang <juihaochiang@gmail.com>
Signed-off-by: Han-Lin Li <Han-Lin.Li@itri.org.tw>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-06 16:58:48 +00:00
Anthony PERARD 7e600e4485 libxl: Specify the target ram size to Qemu (new) when calling it
This patch adds target_ram in device_model_info structure, to be used in
libxl_build_device_model_args_new. Qemu upstream needs to know about it.

It introduces also libxl__sizekb_to_mb to convert size from KB to MB by
rounding up the result.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 14:27:33 +00:00
Christoph Egger d8318dc19b libxl: Implement libxl_basename()
This patch implements libxl_basename() as a portable replacement
for GNU vs. POSIX basename.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-06 14:25:10 +00:00
Ian Jackson f1bbc236c6 QEMU_TAG update 2011-01-05 23:54:15 +00:00
Yang Z Zhang 24a51dd87a libxl: fix free of uninitialised "disks" variable
Reported-by: Wei Huang <wei.huang2@amd.com>
Reported-by: Christoph Egger <Christoph.Egger@amd.com>
Author: Yang Z Zhang <yang.z.zhang@intel.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-05 23:37:32 +00:00
Ian Jackson 2cf5846885 tools/xend: drbd: fix things by reverting 20158
drbd's block-drbd script handles all of the details that c/s 20158
introduces within xend :-(.  This c/s should be reverted as it causes
a regression.  Jim Fehlig tested drbd without 20158 and it works fine.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Jim Fehlig <jfehlig@novell.com>
2011-01-05 23:31:24 +00:00
Gianni Tedesco 1edf1ea47c xl: don't segfault parsing disk configs, support NULL physpath and ioemu:
Switch to a state machine parser since it's easier to handle all these
exotic cases without segfaulting. NULL physpaths are now allowed and a
dodgy hack is introduced to skip over the "ioemu:" prefix for a
virtpath. Also fixes a leak of buf2.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-05 23:13:07 +00:00
Keir Fraser cc0854dd57 relax vCPU pinned checks
Both writing of certain MSRs and VCPUOP_get_physid make sense also for
dynamically (perhaps temporarily) pinned vcpus.

Likely a couple of other MSR writes (MSR_K8_HWCR, MSR_AMD64_NB_CFG,
MSR_FAM10H_MMIO_CONF_BASE) would make sense to be restricted by an
is_pinned() check too, possibly also some MSR reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-01-05 09:57:15 +00:00
Keir Fraser 866cfd2c22 x86 hvm: Add a missing line to record the type passed into register_io_handler()
Add a missing line to record the type passed into
register_io_handler()

Without this line, the BUFFERED_IO handler was never called.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2011-01-05 09:52:54 +00:00
Keir Fraser 1693185272 x86: Allow dom0 to write MSR IA32_ENERGY_PERF_BIAS
Allow dom0 to write MSR IA32_ENERGY_PERF_BIAS

There is a new hardware feature, which lets system software to set
Energy Performance Preference. This is a opaque knob in the form of
IA32_ENERGY_PERF_BIAS MSR, which has a 4 bit Energy Performance
Preference Hint.

The support for this feature is indicated by CPUID.06H.ECX.bit3. Refer
to Intel Architectures Software Developer's Manual for more info.

Let dom0 tools to control it.

Signed-off-by: Wei Gang <gang.wei@intel.com>
2011-01-05 09:52:18 +00:00
Keir Fraser ac05bf03bc [VTD] added WLAN device ID on Fujitsu's platform in quirks.c
Added WLAN device ID 0x422C that was found on Fujitsu's Calpella
system to WLAN quirk.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2011-01-05 09:50:21 +00:00
Keir Fraser 6844375d3d x86 amd: Revert 6382:b74c15e4dd4f (AMD flush filter configuration)
Flush filter is not reliably supported by any processor, we already
have code to unconditionally disable the filter, so we don't need the
command-line config option. Remove it.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-05 09:48:43 +00:00
Tim Deegan 89b5470762 Enable 1GB HAP support by default.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2011-01-05 09:41:28 +00:00
Mukesh Rathor 2a5c8ad466 tools/gdbsx: Update gdbsx README
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-04 15:40:00 +00:00
Ian Campbell 6162c530ff tools/hotplug/Linux: only apply dummy MAC address to virtual devices.
Avoid applying to the bridge and physical network device.

This should un-break dom0 networking in the old xend-creates-bridge
setup (problem introduced in 22493:937488219719).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-04 15:26:02 +00:00
Tim Deegan b211f07fd5 x86/mm: Add p2m_lock in set_shared_p2m_entry
This avoids the immediate problem (calling set_p2m_entry() without the
lock held) but leaves the underlying problem (no consistent locking
order between page-sharing and p2m code) for later.

Signed-off-by: Jui-Hao Chiang <juihaochiang@gmail.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-04 11:32:20 +00:00
Keir Fraser fa39212af9 x86 hvm: Missing chunk from TSC-deadline support patch.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-27 08:00:09 +00:00
Keir Fraser bea241417b credit2: Fix x86_32 build.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-24 10:56:29 +00:00
Keir Fraser 1fe3155693 Xen MCE test: all test cases
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>
2010-12-24 10:23:08 +00:00
Keir Fraser bb400f3043 Xen MCE test: common functions to be used for test cases
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>
2010-12-24 10:22:23 +00:00
Keir Fraser b6982669e8 Xen MCE test: utilities to inject fake MCE for X86
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>
2010-12-24 10:21:27 +00:00
Keir Fraser 39810ac59b libxc: Use .opic to build xenctrl_osdep_ENOSYS.so
Resolves build error:
    /usr/bin/ld: xenctrl_osdep_ENOSYS.o: relocation R_X86_64_32
    against `a local symbol' can not be used when making a shared
    object; recompile with -fPIC
    xenctrl_osdep_ENOSYS.o: could not read symbols: Bad value
    collect2: ld returned 1 exit status

Clean up object files correctly too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2010-12-24 10:17:49 +00:00
Keir Fraser 500483a215 ACPI: __init-annotate APEI code
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 10:14:58 +00:00
Keir Fraser 746a4c7dd8 x86: a little bit of genapic cleanup
Eliminate redundancy among the individual handler functions, and mark
init-only functions as such.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 10:14:36 +00:00
Keir Fraser 3f7f21343b VT-d: fix and improve print_vtd_entries()
Fix leaking of mapped domain pages (root_entry and ctxt_entry when
falling out of the level traversing loop). Do this by re-arranging
things slightly so that a mapping is retained only as long as it
really is needed.

Fix the failure to use map_domain_page() in the level traversing loop
of the function.

Add a mssing return statement in one of the error paths.

Also I wonder whether not being able to call print_vtd_entries() from
iommu_page_fault_do_one() in ix86 is still correct, now that
map_domain_page() is IRQ safe.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 10:14:01 +00:00
Keir Fraser 7e509984bd re-add calls accidentally deleted from run_all_nonirq_keyhandlers()
c/s 22538:a3a29e67aa7e, having got applied in a form different from
the one submitted, resulted in the calls to
console_{start,end}_log_everything() getting removed without
replacement. Add them back since, other than run_all_keyhandlers(),
this doesn't run with log-everything already in effect.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 10:12:58 +00:00
Keir Fraser 5814ca6b9c Use bool_t for various boolean variables
... decreasing cache footprint. As a prerequisite this requires making
cmdline_parse() a little more flexible.

Also remove a few variables altogether, and adjust sections
annotations for several others.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-12-24 10:10:45 +00:00
Keir Fraser 53ecc28f0e x86: link-time .data section adjustments
Fold compiler generated sections (mostly due to -fPIC on x86-64) into
the general .data and .data.read_mostly sections.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 08:47:59 +00:00
Keir Fraser 0c4ff0fb92 x86-64: use PC-relative exception table entries
... thus allowing to make the entries half their current size. Rather
than adjusting all instances to the new layout, abstract the
construction the table entries via a macro (paralleling a similar one
in recent Linux).

Also change the name of the section (to allow easier detection of
missed cases) and merge the final resulting output sections into
.data.read_mostly.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 08:47:23 +00:00
Keir Fraser abf60d3612 make sort() generally available
Rather than having this general library function only on ia64, move it
into common code, to be used by x86 exception table sorting too.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 08:46:46 +00:00
Keir Fraser 98592ae8b7 blkif: add placeholder for packet extension to block interface
While the corresponding implementation has been in our trees for quite
a while, it's in a state that doesn't make it suitable for submission,
and the original author having left the company leaves open to find
someone to complete this work. Yet to prevent problems with other
interface extensions we'd like to keep the slot in the number space
reserved for the purpose it has been serving here.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-12-24 08:42:52 +00:00
Keir Fraser 25121ee23d x86 xsave: supports xsave (CPUID:0xD) enumeration for all sub-leaves.
In specific, it fixes the following issues:

1. The sub-leaves of CPUID:0x0000000D aren't contiguous. Hypervisor
shouldn't use register values to stop the enumeration. This patch
moves checking on XSAVE sub-leaves out of if-else statement. It also
bumps up sub-leaves to 63.
2. It creates a common function for xsave.
3. The main leaf 0 of CPUID:0x0000000D in current Xen is broken,
especially ECX and EBX registers. This patch cleans it up.
4. It adds support to detects EBX value of CPUID:0x0000000D main leaf
0 on-the-fly.

Signed-off-by: Wei Huang2 <wei.huang2@amd.com>
2010-12-24 08:39:42 +00:00
Keir Fraser 96727f7148 x86 xsave: Enable xsave_feature[62] (AMD Lightweight Profiling)
The spec of LWP is available at
http://developer.amd.com/cpu/lwp/Pages/default.aspx.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-24 08:38:22 +00:00
Keir Fraser 40aca4eccb x86 xsave: Fix 64bit xsave_feature support for set_xcr0().
Signed-off-by: Wei Huang <wei.huang2@amd.com>
2010-12-24 08:37:34 +00:00