Commit Graph
22660 Commits
Author SHA1 Message Date
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
Keir Fraser 52c139177c credit2: On debug keypress print load average as a fraction
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:32:43 +00:00
Keir Fraser 194b5dc413 credit2: Different unbalance tolerance for underloaded and overloaded queues
Allow the "unbalance tolerance" -- the amount of difference between
two runqueues that will be allowed before rebalancing -- to differ
depending on how busy the runqueue is.  If it's less than 100%,
default to a difference of 1.0; if it's more than 100%, default to a
tolerance of 0.125.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:32:20 +00:00
Keir Fraser 32c670623f credit2: Introduce a loadavg-based load balancer
This is a first-cut at getting load balancing.  I'm first working on
looking at behavior I want to get correct; then, once I know what kind
of behavior works well, then I'll work on getting it efficient.

The general idea is when balancing runqueues, look for the runqueue
whose loadavg is the most different from ours (higher or lower).
Then, look for a transaction which will bring the loads closest
together: either pushing a vcpu, pulling a vcpu, or swapping them.
Use the per-vcpu load to calculate the expected load after the
exchange.

The current algorithm looks at every combination, which is O(N^2).
That's not going to be suitable for workloads with large numbers of
vcpus (such as highly consolidated VDI deployments).  I'll make a more
efficient algorithm once I've experimented and determined what I think
is the best load-balancing behavior.

At the moment, balance from a runqueue every time the credit resets.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:31:54 +00:00
Keir Fraser bc24ee5757 credit2: Use loadavg to pick cpus, instead of instantaneous load
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:31:24 +00:00
Keir Fraser 32a7d56158 credit2: Migrate request infrastructure
Put in infrastructure to allow a vcpu to requeset to migrate to a
specific runqueue.  This will allow a load balancer to choose running
VMs to migrate, and know they will go where expected when the VM is
descheduled.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:31:04 +00:00
Keir Fraser b423d447aa credit2: Track expected load
As vcpus are migrated, track how we expect the load to change.  This
helps smooth migrations when the balancing doesn't take immediate
effect on the load average.  In theory, if vcpu activity remains
constant, then the measured avgload should converge to the balanced
avgload.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:30:42 +00:00
Keir Fraser f467b7d703 credit2: Track average load contributed by a vcpu
Track the amount of load contributed by a particular vcpu, to help
us make informed decisions about what will happen if we make a move.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:30:15 +00:00
Keir Fraser d7f899bcfc credit2: Calculate load average
Calculate a per-runqueue decaying load average.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:29:53 +00:00
Keir Fraser cbce336827 credit2: Detect socket layout and assign one runqueue per socket
Because alloc_pdata() is called before the cpu layout information is
available, we grab a callback to the newly-created CPU_STARTING
notifier.

cpu 0 doesn't get a callback, so we simply hard-code it to runqueue 0.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:29:27 +00:00
Keir Fraser e94b917271 credit2: Simple cpu picker based on instantaneous load
In preparation for multiple runqueues, add a simple cpu picker that
will look for
the runqueue with the lowest instantaneous load to assign the vcpu to.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:29:00 +00:00
Keir Fraser 90ef5664db credit2: Calculate instantaneous runqueue load
Add hooks in the various places to detect vcpus becoming active or
inactive.  At the moment, record only instantaneous runqueue load;
but this lays the groundwork for having a load average.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:28:35 +00:00
Keir Fraser e8599ead72 credit2: Handle runqueue changes
In preparation for cross-runqueue migration, make changes to make that
more robust.
Changes include:
* An up-pointer from the svc struct to the runqueue it's assigned to
* Explicit runqueue assign/desassings, with appropriate ASSERTs
* cpu_pick will de-assign a vcpu from a runqueue if it's migrating,
and wake will re-assign it

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:28:10 +00:00
Keir Fraser 8a2042db62 credit2: Refactor runqueue initialization
Several refactorizations:
* Add prv->initialized cpu mask
* Replace prv->runq_count with active_queue mask
* Replace rqd->cpu_min,cpu_mask with  active cpu mask
* Put locks in the runqueue structure, rather than borrowing the
existing cpu locks
* init() initializes all runqueues to NULL, inactive, and maps all
pcpus to runqueue -q
* alloc_pcpu() will add cpus to runqueues, "activating" the runqueue
if necessary.  All cpus are currently assigned to runqueue 0.

End-to-end behavior of the system should remain largely the same.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2010-12-24 08:27:42 +00:00