Keir Fraser [Tue, 25 May 2010 08:08:34 +0000 (09:08 +0100)]
xend: Add interface name definition support for xend-relocation-address
Add a new feature for xend-relocation-address option to support
definition by interface name which can be useful for people having
e.g. a cluster environment with multiple network interfaces on all of
the machines with only one reserved to be registered to a private
cluster network. This way they won't need to specify the relocation
address manually on all the machines but just simple providing the
interface name to get the IP address from would do the job (all the
machines have to have this interface named the same to make it
working, of course).
Technically it reads the interface name and gets its IP address using
ioctl call of SIOCGIFADDR and if the interface doesn't have the
address, i.e. if non-existing interface or hostname was provided the
original ifname is returned to preserve the old behaviour.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Keir Fraser [Sat, 22 May 2010 05:31:47 +0000 (06:31 +0100)]
x86: TSC handling cleanups (version 2)
"I am removing the tsc_scaled variable that is never actually used
because when tsc needs to be scaled vtsc is 1. I am also making this
more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz
that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta,
&d->arch.ns_to_vtsc) to scale the tsc value before returning it to the
guest like in the pv case. I added a feature flag to specify that the
pvclock algorithm is safe to be used in an HVM guest so that the guest
can now use it without hanging."
Keir Fraser [Fri, 21 May 2010 14:25:10 +0000 (15:25 +0100)]
xl: fix block-attach command parsing
Fix two command-line parsing problems:
- the argc check is wrong: it must be provided with the frontend
device
- the ro/rw mode is optional, so default to rw if it is absent
Also, update the usage message accordingly.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Keir Fraser [Thu, 20 May 2010 13:12:14 +0000 (14:12 +0100)]
ocaml: fix ocaml xc compilation on 32 bit
cc1: warnings being treated as errors
xc_lib.c: In function 'xc_domain_get_pfn_list':
xc_lib.c:1217: error: assignment from incompatible pointer type
The XEN_DOMCTL_getmemlist interface has been 32/64 invariante since
13594:30af6cfdb05c and uint64_t is now the correct type for the PFN
list on all word sizes.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Keir Fraser [Wed, 19 May 2010 14:42:03 +0000 (15:42 +0100)]
x86: Streamline the CPU early boot process.
Mainly this involves getting rid of a bunch of cpumasks and replacing
with a single 'cpu_state' enumeration to track progress and allow
master-slave handshaking.
Cleaning this stuff up is a prerequisite for safely handling slave
failure (e.g., out of memory, invalid slave CPU capabilities,
...). This will get fixed up in a future patch.
Keir Fraser [Wed, 19 May 2010 07:22:06 +0000 (08:22 +0100)]
VT-d: Fix ATS enabling for device assignment
Currently, Xen only enables ATS in Xen booting. When an ATS capable
device is assigned to guest, ATS is actually not enabled because FLR
before assignment causes it to be disabled. Thus ATS cannot be used in
guest. This patch enables ATS in domain_context_mapping. This ensures
ATS is enabled in assignment because FLR is earlier than
domain_context_mapping call. Therefore ATS can be used in guest. This
patch also implements disable_ats_device to disable ATS when the
device is deassigned from a domain.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Wed, 19 May 2010 07:20:46 +0000 (08:20 +0100)]
libxl: Compilation and other small fixes
* Some of the library functions such as fscanf, system, and asprintf
are declared with warn_unused_result (ubuntu server 9.10), causing
compilation errors in libxl.
* When using asprintf, the caller is responsible for freeing the
memory.
* memset takes wrong size argument in one of the places (caught by
a builtin gcc check).
Keir Fraser [Tue, 18 May 2010 14:05:54 +0000 (15:05 +0100)]
x86: Pull dynamic memory allocation out of do_boot_cpu().
This has two advantages:
(a) We can move the allocations to a context where we can handle
failure.
(b) We can implement matching deallocations on CPU offline.
Only the idle vcpu structure is now not freed on CPU offline. This
probably does not really matter.
Keir Fraser [Tue, 18 May 2010 10:38:12 +0000 (11:38 +0100)]
xl: allow scaling suffix on memory sizes in mem-set and mem-max
Allow mem-set and mem-max to take 'b', 'k', 'm', 'g' and 't' as
scaling suffixes for bytes, kilobytes, mega, etc. An unadorned number
is still treated as kilobytes so no existing users should be affected.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 18 May 2010 10:24:04 +0000 (11:24 +0100)]
x86: Allow PV superpages to work with live migration
PV superpages currently do not work with live migration. They fall
over dead when the shadow page table is enabled for dirty tracking.
The HVM support for superpages in this code has been tested and found
to work just fine for PV superpages. This patch modifies the test
macro to allow the code to work with PV superpages.
Keir Fraser [Tue, 18 May 2010 10:21:25 +0000 (11:21 +0100)]
svm: Fix for AMD erratum 383 on Family 10h CPUs
This patches implements the workaround of AMD erratum 383 on family
10h CPUs. It destroys the guest VM when a MC error with a special
pattern is detected. Without this patch, a guest VM failure can
potentially crash Xen hypervisor and the whole system. The erratum
will be published in next version of guide.
Keir Fraser [Mon, 17 May 2010 15:28:56 +0000 (16:28 +0100)]
x86: Remove special-case paths for start-of-day SMP bringup.
All CPUs are now brought up in __cpu_up(), in the correct order for
cpu-bringup notifiers.
Notably ganged TSC calibration is removed. This was another
start-of-day-specific aspect of bringup. If we really need
calibration, I think we can come up with an efficient method for APs
to calibrate themselves against PIT during their bringup (even
asynchronously, if required for efficiency).
Keir Fraser [Mon, 17 May 2010 10:05:21 +0000 (11:05 +0100)]
intel_txt: to fix intel txt S3 resume failure since c/s 21108
This patch is to fix S3 resume failure with Intel TXT/tboot launched,
brought by c/s 21108. Don't printk anything between two
tboot_gen_xenheap_integrity() calls for release build or debug build.
Or else xen heap will be changed, which causes that memory integrity
will be lost on S3 resume.
Keir Fraser [Fri, 14 May 2010 16:07:52 +0000 (17:07 +0100)]
Move cpu hotplug routines into common cpu.c file.
Also simplify the locking (reverting to use if spin_trylock, as
returning EBUSY/EAGAIN seems unavoidable after all). In particular
this should continue to ensure that stop_machine_run() does not have
cpu_online_map change under its feet.
Keir Fraser [Fri, 14 May 2010 06:53:16 +0000 (07:53 +0100)]
libxl: Adjustments to memset/memmax handling
I think xl memset should change the memory currently used by the guest
and xl memmax should change the size of the guest's address space and
not the population. For this reason libxl_set_memory_target should
provide a way to enforce the memory target, calling
xc_domain_setmaxmem. On the other hand xl memmax shouldn't call
xc_domain_setmaxmem because that is the upper bound of the memory
reservation, it should just change static-max, that at the moment
wouldn't do much, but we can imagine that in the future could trigger
something useful in the guest.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Jonathan Knowles <Jonathan.Knowles@eu.citrix.com>=20
Keir Fraser [Thu, 13 May 2010 09:09:02 +0000 (10:09 +0100)]
Even 'dummy' domains (e.g., dom_xen a.k.a. DOMID_XEN) must have valid I/O caps.
Ensure the rangesets are always initialised. Certain (privileged)
invocations of hypercalls such as mmu_update can end up interrogating
these special domains for possible I/O capabilities.
Keir Fraser [Wed, 12 May 2010 07:51:26 +0000 (08:51 +0100)]
vmx: Change the default Pause-Loop-Exiting "Gap" parameter
PLE_Gap controls teh maximum allowable time between executions of
PAUSE in a busy loop. Essentially this controls the sensitivity of the
processor's busy-loop detection.
Changed the default PLE_Gap to 128 for
1. not using odd number like 41
2. getting a little bit more PLE vmexits to improve performance
Keir Fraser [Wed, 12 May 2010 07:49:13 +0000 (08:49 +0100)]
xs: avoid pthread_join deadlock in xs_daemon_close
Doing a pthread_cancel and join on the reader thread while holding all
the request/reply/watch mutexes can deadlock if the thread needs to
take any of those mutexes to exit. Kill off the reader thread before
taking any mutexes (which should be redundant if we're
single-threaded at that point).
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>