Keir Fraser [Fri, 25 Mar 2011 21:59:20 +0000 (21:59 +0000)]
tools: vnet: Remove
Build has been broken since at least 18969:d6889b3b6423 (early
2009) and it has been unhooked from the top level build since forever
AFAICT. The last actual development (as opposed to tree wide
cleanups and build fixes) appears to have been 11594:6d7bba6443ef in
2006. The functionality of vnet has apparently been superceded by
VLANs, ebtables, Ethernet-over-IP etc all of which are well integrated
with upstream kernels and distros.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Keir Fraser <keir@xen.org>
Jan Beulich [Fri, 25 Mar 2011 09:03:17 +0000 (09:03 +0000)]
x86/hpet: eliminate cpumask_lock
According to the (now getting removed) comment in struct
hpet_event_channel, this was to prevent accessing a CPU's
timer_deadline after it got cleared from cpumask. This can be done
without a lock altogether - hpet_broadcast_exit() can simply clear
the bit, and handle_hpet_broadcast() can read timer_deadline before
looking at the mask a second time (the cpumask bit was already
found set by the surrounding loop).
Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Gang Wei <gang.wei@intel.com>
Ian Campbell [Thu, 24 Mar 2011 13:35:58 +0000 (13:35 +0000)]
tools/xenstat: 23075:b4351d57464b added libxenstat.so but didn't build fPIC
This broke on x86_64.
Reported-by: Olaf Hering 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>
Ian Campbell [Wed, 23 Mar 2011 16:55:56 +0000 (16:55 +0000)]
tools/libxl: move uuid wrapper functions out of line.
This isolates users of libxenlight from the need to know about the
different OS schemes for UUIDs, in particular the 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>
Ian Campbell [Wed, 23 Mar 2011 15:56:46 +0000 (15:56 +0000)]
tools: drop further uses of -Wp,-MD,.$(@F).d to generate dependencies.
19025:bd78714b8594 switched to "-MMD -MF" in preference, adding the
correct runes to tools/Rules.mk but appears to have missed some other
uses of -Wp,...
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>
Ian Campbell [Wed, 23 Mar 2011 15:55:13 +0000 (15:55 +0000)]
libxl: remove XS transaction from public API.
All external users pass 0 anyway so make the version of
libxl_domain_rename which takes a transaction internal and provide an
external facing function which does not expose a transaction.
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>
Ian Campbell [Wed, 23 Mar 2011 15:52:28 +0000 (15:52 +0000)]
libxl: drop protype for libxl_ctx_set_log
Nothing defines or uses 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>
Ian Campbell [Wed, 23 Mar 2011 15:50:29 +0000 (15:50 +0000)]
tools: provide generic rules for compiling .S files
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>
Ian Campbell [Wed, 23 Mar 2011 15:42:48 +0000 (15:42 +0000)]
tools: flask: remove $(LOADLIBES)
Probably a typo and never defined, I can't tell what it was supposed
to 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>
Ian Campbell [Wed, 23 Mar 2011 15:42:01 +0000 (15:42 +0000)]
tools: flask: Remove BASECFLAGS, just use CFLAGS
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>
Ian Campbell [Wed, 23 Mar 2011 15:37:04 +0000 (15:37 +0000)]
tools: users of libxl currently need to see libxc and libxenstore
headers
So add them to CFLAGS_libxenlight
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>
Ian Campbell [Wed, 23 Mar 2011 15:24:19 +0000 (15:24 +0000)]
tools: ocaml: link evtchn bindings against libxenctrl
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>
Ian Campbell [Wed, 23 Mar 2011 15:22:38 +0000 (15:22 +0000)]
tools: ocaml: link xl bindings against libxl
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>
Ian Campbell [Wed, 23 Mar 2011 15:22:10 +0000 (15:22 +0000)]
tools: allow Makefiles to define CFLAGS_foo.o
To provide per-file flags.
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>
Ian Campbell [Wed, 23 Mar 2011 15:20:44 +0000 (15:20 +0000)]
tools: Drop $(X11_LDPATH) from build.
Nothing uses 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>
Ian Campbell [Wed, 23 Mar 2011 15:18:46 +0000 (15:18 +0000)]
tools: xenstat: install and use shared library
Remove .so files from the .a file.
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>
Ian Campbell [Mon, 21 Mar 2011 18:07:06 +0000 (18:07 +0000)]
tools: consistently use $({CFLAGS,LDLIBS}_libxenlight) instead of open coding.
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>
Ian Campbell [Mon, 21 Mar 2011 18:06:27 +0000 (18:06 +0000)]
tools: consistently use $({CFLAGS,LDLIBS}_libxenstore) instead of open coding.
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>
Ian Campbell [Mon, 21 Mar 2011 18:05:49 +0000 (18:05 +0000)]
tools: consistently use $({CFLAGS,LDLIBS}_libxenctrl) instead of open coding.
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>
Ian Campbell [Mon, 21 Mar 2011 18:04:59 +0000 (18:04 +0000)]
tools: consistently use $(CFLAGS_xeninclude) instead of open coding.
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>
Ian Campbell [Mon, 21 Mar 2011 18:00:17 +0000 (18:00 +0000)]
tools: Drop XEN_XC variable
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>
Ian Campbell [Mon, 21 Mar 2011 17:58:52 +0000 (17:58 +0000)]
tools: remove unnecessary uses of -I.
It's not needed unless you are including headers in the current
directory _and_ you can't use "" instead of <> because the headers are
to be installed.
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>
Ian Campbell [Mon, 21 Mar 2011 17:58:23 +0000 (17:58 +0000)]
tools: remove unnecessary uses of -L.
It's not needed unless you are linking against a library in the
current directory.
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>
Ian Campbell [Mon, 21 Mar 2011 17:46:28 +0000 (17:46 +0000)]
tools: vtpm: Use $(BINDIR) rather than a privately defined variable
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>
Ian Campbell [Mon, 21 Mar 2011 17:45:50 +0000 (17:45 +0000)]
tools: Drop use of $(INCLUDES)
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>
Ian Campbell [Mon, 21 Mar 2011 17:40:18 +0000 (17:40 +0000)]
tools: libxc: drop rpm.spec
Last updated in 2004, doesn't even use the right library names.
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>
Ian Campbell [Mon, 21 Mar 2011 17:39:41 +0000 (17:39 +0000)]
libxc: remove dependency on xenstore headers.
xc_offline_page doesn't really need xs.h.
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>
Ian Campbell [Mon, 21 Mar 2011 14:52:27 +0000 (14:52 +0000)]
xl: link against libxenctrl
As well as the indirect dependency (via libxl) the xl binary also uses
libxenctrl directory (for xtl_createlogger_stdiostream etc) and
therefore must link against the library directly too.
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>
Jan Beulich [Fri, 18 Mar 2011 17:15:19 +0000 (17:15 +0000)]
x86/mce: CPU notifiers must not be registered a second time during resume
While c/s 22964:f71212f712fd and 23051:93c864c16ab1 fixed issues with
CPU onlining, they introduced a problem with resume: mcheck_init() is
also being called on that path, and hence checking whether it's
running on CPU 0, which is generally not a really good thing, is
particularly inappropriate here.
Jan Beulich [Fri, 18 Mar 2011 16:31:11 +0000 (16:31 +0000)]
Rules.mk: adjustments to the .o -> .init.o build rule
First, $(shell ...) getting executed before the containing command gets
invoked doesn't have the intended effect when the inner command wants
variables of the outer command expanded. This needs to be done by the
shell executing the entire command.
Second, pattern rules for intermediate files with their targets not
mentioned explicitly result in them getting deleted. Since the .*.o.d
files get generated on the first make run and included for the second,
the second run sees them mentioned explicitly and re-builds them (and
the final *.init.o files), which is particularly annoying if the second
build is actually an install (as root) while normal builds get run as
ordinary user: Some of the output files will suddenly be root owned,
possibly causing permission issues on a later rebuild.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 17 Mar 2011 19:38:05 +0000 (19:38 +0000)]
tools: do not link against unused libraries.
A fair few things under tools link against libraries which they don't
even use.
Most of this appears to come from copy-and-pasting previous Makefile
snippets and cargo-culting plus the tendency to define global $(LIBS)
even for Makefiles which build multiple separate utilities or
libraries.
Identified by comparing a build with --as-needed to one without by
looking at the NEEDED header of all ELF objects.
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>
Ian Campbell [Thu, 17 Mar 2011 19:15:42 +0000 (19:15 +0000)]
tools: support building with --as-needed
Tested by forcing --as-needed via tools/Rules.mk but this is included
since the intention is simply to support diustros which default to
--as-needed, not to enable it everywhere.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 17 Mar 2011 19:15:18 +0000 (19:15 +0000)]
tools: link each shared library or binary only against the libraries it uses
In particular if binary A uses libB and libB uses libC entirely
internally then A does not need to link against libC only libB.
However when linking binary A the linker does need to have visibility
of the libraries which libB links against (libC in this example). For
out of tree uses this is achieved without fuss due because the
libraries are installed in a standard path. However in the case of
in-tree users the linker needs a hint in the form of the -rpath-link
option. Therefore a new class of build variable, $(SHLIB_FOO), is
introduced which includes the linker options needed to link against a
library which uses libFOO. The intention is that $(LDLIBS_bar) will
include the $(SHLIB_foo)s which it uses where necessary rather
requiring that users are aware of this.
For the python extensions this change appears particularly large since
previously each of python bindings were linked against the union of
all possible libraries used by all bindings instead of just what they
individually needed.
This change removes a dependency on libdl.so from nearly everything
in the system, only libxenctrl actually uses it.
In the context of xl/libxl the intention of libxl is to remove any
need for a user of libxl to know about libxenstore or libxenctrl,
however in the current build it is xl which links against those
libraries rather than libxl (which only links against libc). After
this change libxl correctly depends on the libraries it uses and xl
does not depend on libraries which it is not support to be required to
know about. Note that xl does depend on libxenctrl.so since it uses
xtl_* directly.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 17 Mar 2011 19:14:57 +0000 (19:14 +0000)]
tools/blktap2/libvhd: move uuid wrapper functions out of line.
This isolates users of libvhd from the need to know about the
different OS schemes for UUIDs.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Daniel Stodden <daniel.stodden@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Thu, 17 Mar 2011 13:32:41 +0000 (13:32 +0000)]
x86/HPET: fix oversight in 23033:84bacd800bf8 (2nd try)
Clearly for the adjusted BUG_ON()s to not yield false positives
num_hpets_used (rather than num_chs_used, as done mistakenly in
23042:599ceb5b0a9b) must be incremented before setting up an IRQ (and
decremented back when the setup failed). To avoid further confusion,
just eliminate the local variable altogether.
Liu, Jinsong [Thu, 17 Mar 2011 13:31:43 +0000 (13:31 +0000)]
x86: mce cleanup for both Intel and AMD mce logic
c/s 22964 fixed a mce memory leaks bug which may trigger xen crash
when cpu online. However, there are 2 mce memory leaks: 1 at mce
level (arch independent), 1 at mce_intel level (arch dependent). At
c/s 22964, it free both leaks at mce_intel level, which would has
problem under AMD arch.
This patch fix this issue.
It alloc/free poll_bankmask (arch independent) at mce level,=20 and
add a notifier block at mce level to avoid xmalloc risk when irq
disable.
With this patch, both Intel and AMD mce works OK in a clean way.
Olaf Hering [Thu, 17 Mar 2011 13:29:01 +0000 (13:29 +0000)]
xentrace: dynamic tracebuffer allocation
Allocate tracebuffers dynamically, based on the requested buffer size.
Calculate t_info_size from requested t_buf size.
Fix allocation failure path, free pages outside the spinlock.
Remove casts for rawbuf, it can be a void pointer since no math is
done.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Thu, 17 Mar 2011 10:36:25 +0000 (10:36 +0000)]
build: Make XEN_ROOT an absolute path.
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).
Ian Jackson [Wed, 16 Mar 2011 16:44:25 +0000 (16:44 +0000)]
libxl: provide full path to vif hotplug script script
This improves compatibility with xm style config files since xend does
this (see NetifController.getDeviceDetails() in
tools/python/xen/xend/server/netif.py) and
tools/hotplug/Linux/vif-setup expects an absolute path to the script.
This patch supports both absolute and relative paths in the
configuration. Also, if somehow nic->script==NULL, don't add write
the entry to xenstore at all (rather than crashing due to the new
check for absolute vs relative path).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tim Deegan [Wed, 16 Mar 2011 09:35:32 +0000 (09:35 +0000)]
This fixes a bug in changeset 22526:7a5ee3800417, where the wrong
value is read when deciding whether to flush the VTd tables. The
effect is minor: in situations where the p2m entry is changed but the
mfn is the same, the VTd tables will be unnecessarily flushed.
old_entry is left untouched in the second case, since having a present
old_entry will cause the an unnecessary check to be taken at the end
of the function.
Spotted-by: Zhang, Peng Fei <zpfalpc23@gmail.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Ian Campbell [Tue, 15 Mar 2011 18:20:46 +0000 (18:20 +0000)]
libxl: Make all hidden/static functions take a gc not a ctx
Also ensure that static and hidden functions use the libxl__ prefix
not just libxl_ (in the case of static functions only when they use a
libxl prefix to start with).
This follows the policy described in libxl.h "libxl memory
management".
Based on a manual audit of:
grep ^static tools/libxl/libxl*.[ch]| grep libxl_ctx
grep libxl__ tools/libxl/*.h| grep libxl_ctx
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 15 Mar 2011 18:19:47 +0000 (18:19 +0000)]
libxl: do not start a xenpv qemu solely for tap devices if blktap is available
qemu is used as a fallback for DISK_BACKEND_TAP if no blktap is
available but if blktap is available, or for DISK_BACKEND_PHY, we
don't need a qemu process.
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>
Clearly for the adjusted BUG_ON()s to not yield false positives
num_chs_used must be incremented before setting up an IRQ (and
decremented back when the setup failed).
Jan Beulich [Mon, 14 Mar 2011 17:19:47 +0000 (17:19 +0000)]
_csched_cpu_pick(): don't write idle bias more than once
For the bias to be really meaningful, it should be updated only when
the CPU selected will indeed be returned (and hence used for placing
the vCPU in question).
Gianni Tedesco [Mon, 14 Mar 2011 17:13:15 +0000 (17:13 +0000)]
Allow tools to map arbitrarily large machphys_mfn_list on 32bit dom0
This permits suspend/resume to work with 32bit dom0/tools when system
memory extends beyond 160GB (and up to 1TB).
AFAICT the limit to MACH2PHYS_COMPAT_NR_ENTRIES is redundant since
that refers to a limit in 32bit guest compat mappings under 64bit
hypervisors, not userspace where there may be gigabytes of useful
virtual space available for this.
Suggested-by: Ian Campbell <Ian.Campbell@eu.citrix.com> Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Jan Beulich [Mon, 14 Mar 2011 17:05:21 +0000 (17:05 +0000)]
x86: fix cpu_sibling_map initialization when topology CPUID leaf is present
c/s 21811:12f0618400de broke this by not properly initializing struct
cpuinfo_x86's x86_num_siblings member (other than Linux, where this is
a global variable, it is being maintained per CPU by Xen).
Hyper-threaded CPUs with CPUID leaf 0xb present had therefore all
cpu_sibling_map-s with just a single bit set, thus improperly feeding
the scheduler.
Wei Gang [Mon, 14 Mar 2011 17:04:42 +0000 (17:04 +0000)]
x86: add volatile prefix for cpuid asm clauses
cpuid results are possible to be changed now. For example, changing
CR4.OSXSAVE bit or setting MSR XCR_XFEATURE_ENABLED_MASK may change
XSAVE related cpuid leave return values.
The volatile prefix is required to avoid the second cpuid calls
following some possible changing operations being optimized in
incorrect way by compiler.
The sample bug is in xsave_init while debug=3Dn. The second call to
cpuid_count() may be optimized and lead to a BUG_ON case while compare
xsave_cntxt_size with ebx.
Jan Beulich [Mon, 14 Mar 2011 17:02:50 +0000 (17:02 +0000)]
Force out-of-line instances of inline functions into .init.text in init-only code
Some compiler versions may choose to not inline certain functions, but
the check introduced in c/s 23003:768269c43914 wants .text to be
empty.
Also make sure an eventual error gets properly propagated even on the
first section of an object (.text typically being the first one), and
cover a broader set of sections.
Jan Beulich [Sat, 12 Mar 2011 13:20:51 +0000 (13:20 +0000)]
x86/HPET: adjust types
'unsigned int' is better suited as an array index on x86-64.
'u32' produces better code than 'unsigned long' on x86-64, so use the
former for storing 32-bit values read from the hardware.
this_cpu() uses an implicit smp_processor_id(), and hence using
per_cpu() when the result of smp_processor_id() is already available
is more efficient.
Fold one case of cpu_isset()+cpu_clear() into cpu_test_and_clear().
Drop the unused return value of evt_do_broadcast().
Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Wei Gang <gang.wei@intel.com>
Jan Beulich [Sat, 12 Mar 2011 13:19:34 +0000 (13:19 +0000)]
x86/HPET: cleanup
- separate init and resume code paths (so that the [larger] init parts
can go init .init.* sections)
- drop the separate legacy_hpet_event object, as we can easily re-use
the first slot of hpet_events[] for that purpose (the whole array is
otherwise unused when the legacy code is being used)
- use section placement attributes where reasonable
Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Wei Gang <gang.wei@intel.com>
Jan Beulich [Sat, 12 Mar 2011 13:19:02 +0000 (13:19 +0000)]
x86/HPET: fix initialization order
At least the legacy path can enter its interrupt handler callout while
initialization is still in progress - that handler checks whether
->event_handler is non-NULL, and hence all other initialization must
happen before setting this field.
Do the same to the MSI initialization just in case (and to keep the
code in sync).
libxl_device_disk_add tries to use blktap when available even for qdisk
devices, this patch fixes it.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Liu, Jinsong [Fri, 11 Mar 2011 17:18:53 +0000 (17:18 +0000)]
x86: Fix cpu offline bug: add clflush inside dead loop
At some platform (like Xen 7400), when hyperthreading, an offlined
thread may waked spuriously up by its brother, and returning around
the loop. This patch explicitly clflush the cache line in a light
weight way to workaround potential issue. Unlike wbinvd, clflush is
not serializing instruction, hence memory fence is necessary to make
sure all load/store operation visible before flush cache line.
Liu, Jinsong [Fri, 11 Mar 2011 17:18:01 +0000 (17:18 +0000)]
x86: Fix cache flush bug of cpu offline
Current xen cpu offline logic flush cache too early, which potentially
break cache coherency. wbinvd should be the last ops before cpu going
into dead, otherwise cache may be dirty, i.e, something like setting
an A bit on page tables. Pointed out by Arjan van de Ven.
Liu, Jinsong [Fri, 11 Mar 2011 16:27:33 +0000 (16:27 +0000)]
x86: Fix cpu offline bug: cancel SYSIO method when play dead
Play dead is a fragile and tricky point of cpu offline logic. For how
to play cpu dead, linux kernel changed several times: Very old kernel
support 3 ways to play cpu dead: mwait, SYSIO, and halt, just like
what cpuidle did when enter C3; Later, it cancel mwait and SYSIO
support, only use halt to play dead; Latest linux 2.6.38 add mwait
support when cpu dead.
This patch cancel SYSIO method when cpu dead, keep same with latest
kernel.
SYSIO is an obsoleted method to enter deep C, with some tricky
hardware behavior, and seldom supported in new platform. Xen
experiment indicate that when cpu dead, SYSIO method would trigger
unknown issue which would bring strange error. We now cancel SYSIO
method when cpu dead, after all, correctness is more important than
power save, and btw new platform use mwait.
Ian Campbell [Thu, 10 Mar 2011 18:21:42 +0000 (18:21 +0000)]
libxl: do not rely on guest to respond when forcing pci device removal
This is consistent with the expected semantics of a forced device
removal and also avoids a delay when destroying an HVM domain which
either does not support hot unplug (does not respond to SCI) or has
crashed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jim Fehlig [Thu, 10 Mar 2011 18:17:16 +0000 (18:17 +0000)]
libxl: Call setsid(2) before exec'ing device model
While doing development on libvirt libxenlight driver I noticed
that terminating a libxenlight client causes any qemu-dm
processes that were indirectly created by the client to also
terminate. Calling setsid(2) before exec'ing qemu-dm resolves
the issue.
Signed-off-by: Jim Fehlig <jfehlig@novell.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
update README: we are missing few compile time dependencies and a link
to the pvops kernel page on the wiki.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Introduce flexarray_append_pair: a simple syntactic sugar to add a pair
of pointers to a flexarray, very useful when adding pairs of strings to
xenstore.
Replace flexarray_vappend calls (and one pair of flexarray_append)
with flexarray_append_pair calls when dealing with flexarrays that are
going to be used with libxl__xs_kvs_of_flexarray:
NULL is a valid pointer value in these cases while flexarray_vappend
uses NULL as vargs terminator, so the old code is buggy.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Wed, 9 Mar 2011 16:28:58 +0000 (16:28 +0000)]
x86: IO-APIC cleanup
Remove unused and pointless bits from IO-APIC handling code. Move
whatever possible into .init.*, and some data items into
.data.read_mostly. Adjust some types.
Jan Beulich [Wed, 9 Mar 2011 16:23:09 +0000 (16:23 +0000)]
x86: cleanup mpparse.c
Remove unused and pointless bits from mpparse.c (and other files where
they are related to it). Of what remains, move whatever possible into
.init.*, and some data items into .data.read_mostly.
Jan Beulich [Wed, 9 Mar 2011 16:20:13 +0000 (16:20 +0000)]
Move more kernel decompression bits to .init.* sections
Based on how c/s 22986:076b63b74cf6 changed xen/libelf/Makefile I
suppose this is compatibile with those clang/llvm changes, but I
didn't actually test it.
Jan Beulich [Wed, 9 Mar 2011 16:17:26 +0000 (16:17 +0000)]
x86: make mod_l2_entry() return a proper error code
... so that finally all mod_lN_entry() functions behave identically,
allowing some cleanup in do_mmu_update() (which no longer needs to
track both an okay status and an error code).