Olaf Hering [Sat, 2 Apr 2011 14:50:19 +0000 (15:50 +0100)]
xentrace: correct formula to calculate t_info_pages
The current formula to calculate t_info_pages, based on the initial
code, is slightly incorrect. It may allocate more than needed.
Each cpu has some pages/mfns stored as uint32_t.
That list is stored with an offset at tinfo.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Allen Kay [Sat, 2 Apr 2011 14:49:25 +0000 (15:49 +0100)]
[VTD] check BIOS settings before enabling interrupt remapping or x2apic
Check flags field in ACPI DMAR structure before enabling interrupt
remapping or x2apic. This allows platform vendors to disable
interrupt remapping or x2apic features if on board BIOS does not
support them.
Ian Campbell [Thu, 31 Mar 2011 18:39:30 +0000 (19:39 +0100)]
libxl: typedef libxl_action_on_shutdown
This is the libxl convention. By using the "typedef enum foo { } foo;"
syntax we can retain backwards compatibility with existing users.
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, 31 Mar 2011 18:35:27 +0000 (19:35 +0100)]
tools: remove some .o and binary files on clean
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, 31 Mar 2011 18:34:56 +0000 (19:34 +0100)]
tools: remove pattern matched linking rules
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>
Ian Campbell [Thu, 31 Mar 2011 18:32:18 +0000 (19:32 +0100)]
tools: Remove $(CFLAGS) from links lines.
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>
David Scott [Thu, 31 Mar 2011 18:19:16 +0000 (19:19 +0100)]
libxl: fix memory management in "xl network-attach"
The libxl_device_nic struct has strings which are initially strdup()ed
and then free()ed in libxl_device_nic_destroy(). In the
"network-attach" parser we need to free() the existing string and
strdup((*argv) + N), rather than just copying the pointer.
Signed-off-by: David Scott <dave.scott@eu.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 31 Mar 2011 18:07:06 +0000 (19:07 +0100)]
tools: ocaml: do not try to link dynamic objects into .a libraries
lib<foo>_stubs.a was linking against $(LIBS_<foo>) which only includes
dynamic linkage information which is not useful for a static library.
$(LIBS_<foo>) is still used when linking <foo>.cmxa
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, 31 Mar 2011 18:04:19 +0000 (19:04 +0100)]
libxl: use system include for libxl_uuid.h
We install libxl_uuid.h into the system include directory and refer to
it from libxl.h, hence we should include with <> not "".
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, 31 Mar 2011 17:13:50 +0000 (18:13 +0100)]
tools: blktap2: copy xenstore/hashtable.h into blktap2
hashtable.c has already been copied, forked and modified, there
doesn't seem much point in avoiding the same for the header until
someone feels motivated to properly refactor.
Add comments to the various duplicated files cross-referencing each
other for future reference and as a barrier to forking again...
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, 31 Mar 2011 17:12:07 +0000 (18:12 +0100)]
tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings.
22166:251694a87f1d changed the libxl interface to remove the need for
users to understand BDF encoding but did not propagate the change to
the ocaml bindings. Do that now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 31 Mar 2011 17:11:25 +0000 (18:11 +0100)]
libxl: remove "reg" and "enable" fields from PCI device.
The structure of the BDF argument used with PCI passthrough related
hypercalls was taken from the structure of the PCI config_address
register (I/O port 0xCF8) which allows I/O mapped access to PCI
configuration space but these fields have no meaning in the context of
PCI passthrough configuration and hence do not need to be exposed via
libxl.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
current check includes ingress and pfifo_fast.
Add mq to the list of allowed qdiscs already installed
on ifb. This patch fixes cases where remus fails to start,
due to an mq qdisc already present on the vif.
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Mon, 28 Mar 2011 11:07:52 +0000 (12:07 +0100)]
x86: cleanup after tboot fix (c/s 23101:dd386a4b6595)
When submitting the patch that became 23101:dd386a4b6595 I forgot that
I actually intended to remove the pointless IRQ disabling and
restoring (and the then pointless comment). Pointless because the
code, other than its pre-23013:65d26504e843 original, now runs before
interrupts get enabled for the first time.
A bool_t is a single byte, and needs a 'q' register constraint. Avoid
the whole issue by changing the variable to an int, and explicitly
specify the operand suffix as 'l' for good measure.
Jan Beulich [Sat, 26 Mar 2011 09:30:04 +0000 (09:30 +0000)]
x86: fix tboot after c/s 23013:65d26504e843 (ACPI cleanup)
TXT code calls acpi_parse_dmar() with a transient copy of the DMAR
table, and hence storing the pointer for later reference was wrong.
Obtain the pointer in acpi_dmar_init() instead.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Tested-by: Gang Wei <gang.wei@intel.com>
Keir Fraser [Sat, 26 Mar 2011 08:27:41 +0000 (08:27 +0000)]
Remove spin_barrier_irq(). It is pointless.
Add a barrier-appropriate consistency check to spinlock.c, and add
code comments to explain why barrier operations are more relaxed than
lock-acquisition operations.
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>