Tim Deegan [Wed, 1 Sep 2010 10:23:47 +0000 (11:23 +0100)]
x86 shadow: for multi-page shadows, explicitly track the first page
(where the refcounts are) and check that none of the routines
that do refcounting ever see the second, third or fourth page.
This is just stating and enforcing an existing implicit requirement.
x86 mm: revert check in clear_mmio_p2m_entry() changed in 21940:e7afe98afd43
valid_mfn() cannot be used here as MMIO pages are always above max_mem.
Also added sanity checking for type == p2m_mmio_direct before clearing
page table entry. This should fix both VT-d and SR-IOV issues reported
recently as there are no SR-IOV specific code in Xen. As far as Xen
is concern, SR-IOV virtual function is just another PCI device.
Signed-off-by: Allen Kay allen.m.kay@intel.com Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Ian Campbell [Tue, 31 Aug 2010 18:16:23 +0000 (19:16 +0100)]
libxl: builtin list types should be pass-by-reference
This makes all _destroy functions consistent wrt freeing the actual
reference passed in. Previously we were relying on the reference
contained within the type itself which worked but was semantically a
little confusing.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Christoph Egger [Tue, 31 Aug 2010 16:51:51 +0000 (17:51 +0100)]
libxl: run libxlgentypes with $(PYTHON)
Attached patch fixes libxl build that broke in
changeset 22032:fa82b0540e8c.
It is common these days to use $(PYTHON) in the build system.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Daniel De Graaf [Mon, 30 Aug 2010 12:58:07 +0000 (13:58 +0100)]
libxl: fix xenstore connection when run in domU
When used in a domain other than the one running xenstore,
libxl_ctx_init will fail to connect even when xenstore is actually
available. Add a call to xs_domain_open to handle this case.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Keir Fraser [Mon, 30 Aug 2010 07:39:52 +0000 (08:39 +0100)]
ept: Put locks around ept_get_entry
There's a subtle race in ept_get_entry, such that if tries to read an
entry that ept_set_entry is modifying, it gets neither the old entry
nor the new entry, but empty. In the case of multi-cpu
populate-on-demand guests, this manifests as a guest crash when one
vcpu tries to read a page which another page is trying to populate,
and ept_get_entry returns p2m_mmio_dm.
This bug can also be fixed by making both ept_set_entry and
ept_next_level access-once (i.e., ept_next_level reads full ept_entry
and then works with local value; ept_set_entry construct the entry
locally and then sets it in one write). But there doesn't seem to be
any major performance implications of just making ept_get_entry use
locks; so the simpler, the better.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 30 Aug 2010 07:31:57 +0000 (08:31 +0100)]
Update MAINTAINERS file with AMD maintainers
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Andre Przywara <andre.przywara@amd.com> Acked-by: Wei Huang <wei.huang2@amd.com> Acked-by: Wei Wang <wei.wang2@amd.com> Acked-by: Mark Langsdorf <mark.langsdorf@amd.com>
Relicense these two libraries under LGPL v2.1 only except where
individual files already included the "or later" provision.
Copyright holders have been contacted by Stephen Spector and have all
agreed this change.
Removed tools/libxc/ia64/aclinux.h since it appeared to be
unused. There is a separate, more up to date, copy in
xen/include/acpi/platform/aclinux.h which does appear to be used.
Clarify the license of MiniOS privcmd.h under the same terms as other
tools/include/xen-sys headers.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stephen Spector <stephen.spector@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 24 Aug 2010 17:34:46 +0000 (18:34 +0100)]
libxc: remove xc_ptrace
It has been unused since 21732:eb34666befcc. There was no response to
my RFC regarding its removal
http://marc.info/?l=xen-devel&m=128170404422822 and unfortunately we
have not been able to trace down all copyright holders of this code
for the purposes of relicensing libxc.
The code will be available in mercurial if we need to retrieve it in
the future.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Tue, 24 Aug 2010 17:33:25 +0000 (18:33 +0100)]
tools/xenpaging: call pageout policy function in xenpaging_evict_page
Notify policy about a page that was just paged out to disk.
Up to now the code called the opposite function, which clears the
(xenpaging internal) reference bit, instead of setting it and marking
the page as gone.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Patrick Colp <pjcolp@cs.ubc.ca> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 24 Aug 2010 17:30:07 +0000 (18:30 +0100)]
xl: treat sub-command main function like a regular C main() function
Currently xl passes the entire argc+argv to each subcommand and relies
on the preservation of the global optind variable to ensure that the
subcommand correctly handles argument parsing (e.g. accounting for "xl
[command]" vs "xl -v [command]").
This requirement for individual sub-commands to parse arguments
relative to optind is subtle and prone to being forgotten (or simply
not expected). Several sub-commands have recently been broken in this
way (now fixed).
Therefore arrange that the argv+argc passed to the sub-commands looks
like you would expect for a regular C main function and includes
argv[0] equal to the command name with command specific arguments in
argv[1] onwards.
Since all sub-commands (currently) correctly obey the optind it is
sufficient to reset it to 1 (as described in getopt(3)) in order to
not break the sub-commands' own argument parsing.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 24 Aug 2010 17:29:21 +0000 (18:29 +0100)]
xl: correct argument parsing for some sub-commands.
XL sub-commands are expected to parse their arguments relative to the
global variable "optind" rather than treating argc+argv as zero
based. This is because the argc+argv passed to sub-commands include
the entire original command line, not just the sub command specific bits.
Not all commands do this and they are therefore broken if the user
uses "xl -v command", correct such problems
dump-core:
- did not handle "-h" option.
{network,network2,block}-{attach,list,detach} :
- handled arguments without reference to optind
- checked number of arguments before processing getopt loop,
breaking "-h" option handling
An example of the breakage:
# xl -v block-list d32-2
Vdev BE handle state evt-ch ring-ref BE-path
block-list is an invalid domain identifier
51712 0 1 4 13 8 /local/domain/0/backend/vbd/1/
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Sun, 22 Aug 2010 08:52:18 +0000 (09:52 +0100)]
Implement ACPI APEI ERST feature
APEI are ACPI4.0 new features. It consists of ERST, BERT, HEST, and
EINJ. ERST is used to save fault error log to a platform persistent
storage, so that when reboot os can retrieve the error log and handle
it.
This patch is used to implement ERST feature to Xen. It consists of
3-level hierarchy: operation level, action level, and instru= ction
level. Instruction do basic io; Action done by sequential
instructions parsed from ACPI ERST table; Operation done by
sequential actions defined by ACPI spec, providing erst_write/
erst_read/ erst_clear interfaces to MCE/ NMI/ PCIe error handling
mechanism, etc.
Gianni Tedesco [Fri, 20 Aug 2010 16:12:00 +0000 (17:12 +0100)]
xl: poison data objects in auto-generated destructors
Increase the probability of blowing up badly up during any
use-after-destroy scenarios.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
The aforementioned patch missed several calls to read_exact, causing spurious
timeouts under Remus.
Also add a couple of additional error reports to rdexact.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca> Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Michael Young [Thu, 19 Aug 2010 16:09:30 +0000 (17:09 +0100)]
tools/python: fix xm list for Python 2.7
This patch fixes
Unexpected error: <type 'exceptions.AttributeError'>
This is due to xmlrpc changes in Python 2.7. This patch should
fixe it for both old and new versions.
Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 19 Aug 2010 14:32:56 +0000 (15:32 +0100)]
libxl/xl: Use libxl_vcpuinfo_destroy
Replaces libxl_free_vcpu_list.
The ->cpumap field is now always a unique allocation rather than each
being an offset into the cpumap allocated in the first
libxl_device_pci in the list.
Refactor vcpulist so that the two cases can share more code.
[PATCH 15 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 19 Aug 2010 14:29:57 +0000 (15:29 +0100)]
xl: free the libxl types contained in struct domain_config
Resolves the following leaks found using "valgrind xl create -n ..."
(plus presumably others which didn't trigger because I have no devices
of that type)
[PATCH 10 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
==21241== 5 bytes in 1 blocks are definitely lost in loss record 1 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804E56B: parse_config_data (xl_cmdimpl.c:760)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 6 bytes in 1 blocks are definitely lost in loss record 2 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804DAAA: parse_config_data (xl_cmdimpl.c:586)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 24 bytes in 1 blocks are definitely lost in loss record 3 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804E51F: parse_config_data (xl_cmdimpl.c:754)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 27 bytes in 1 blocks are definitely lost in loss record 4 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804DF4A: parse_config_data (xl_cmdimpl.c:664)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 28 bytes in 1 blocks are definitely lost in loss record 5 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x410C1A7: vasprintf (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x40EE59A: asprintf (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804CA8B: init_nic_info (xl_cmdimpl.c:322)
==21241== by 0x804E6FF: parse_config_data (xl_cmdimpl.c:791)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
==21241==
==21241== 44 bytes in 1 blocks are definitely lost in loss record 6 of 6
==21241== at 0x4022F0A: malloc (vg_replace_malloc.c:236)
==21241== by 0x411B22F: strdup (in /lib/i686/cmov/libc-2.7.so)
==21241== by 0x804E168: parse_config_data (xl_cmdimpl.c:694)
==21241== by 0x8056B04: create_domain (xl_cmdimpl.c:1357)
==21241== by 0x8057ECE: main_create (xl_cmdimpl.c:3154)
==21241== by 0x804B2FB: main (xl.c:76)
Ian Campbell [Thu, 19 Aug 2010 14:24:41 +0000 (15:24 +0100)]
libxl: do not generate a destructor for data types which do not require one
libxl_dominfo, libxl_poolinfo, libxl_vminfo, libxl_domain_build_state,
libxl_physinfo and libxl_sched_credit contain no members which require
destruction so omit the auto generated destructor.
As an exception continue to generate destructors for libxl_device_*
and libxl_{devtype}* even if they have no interesting members so that
all device types can be treated the same without special knowledge
about the type contents being required.
[PATCH 08 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 19 Aug 2010 14:21:01 +0000 (15:21 +0100)]
libxl: libxl_device_console.build_state is const
This field always refers to a libxl_domain_build_state structure which
is managed already by the caller, therefore it is incorrect to free it
as part of libxl_device_console_destroy.
(arguably this field should be a copy of, not a reference too, the original)
[PATCH 06 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 19 Aug 2010 14:20:22 +0000 (15:20 +0100)]
libxl: generate destructors for each libxl defined type
I chose the name "_destroy" rather than "_free" because the destructor
functions will free only the members of a type recursively but will
not free the actual type structure itself. The allocation of the type
is typically done by the caller and may not be a single allocation,
e.g. lists/arrays of types or embedded in other structures etc.
The exceptions to this rule are libxl_string_list_destroy and
libxl_key_value_list_destroy but I'm not 100% convinced they are
exceptions (since they are kind-of opaque) and I couldn't see a
cleanerway to express this concept. I have made a best effort attempt
to implement these functions sanely but since as far as I can tell
nothing in the current code base ever sets
libxl_domain_create_info.{xsdata,platformdata} I'm flying somewhat
blind.
[PATCH 05 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 19 Aug 2010 14:15:55 +0000 (15:15 +0100)]
libxl: autogenerate _libxl_types.h
The libxl interface types are represented by a simple python data
structure (which could be parsed from a bespoke language in the
future).
This will allow the autogeneration of functions to free the component
members of the libxl types. In the future it may also enable auto
generation of type marshalling code for language bindings.
The generated file should be identical to before with the exception of
the "DO NOT EDIT" header.
It was unfortunately necessary to add explcit an dependency on
_libxl_types.h (indirectly via libxl.h) to all C files since the
autogenerated dependencies are not available in time.
[PATCH 04 of 16 of
libxl: autogenerate type definitions and destructor functions]
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Wed, 18 Aug 2010 16:09:59 +0000 (17:09 +0100)]
tools/libxl: fix "xl console" for primary console
libxl_console_constype is an enum and can therefore be unsigned so
using -1 as a sentinel for unset in main_console fails to work as
expected.
Arrange for all valid enum values to be > 0 and use 0 as the sentinal
instead.
If the user does not request a specific type then always use the
primary console since using "-n" but not "-t" is not meaningful as we
do not know which type to request.
Also make libxl_console_exec reject invalid values of type.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Wed, 18 Aug 2010 16:09:25 +0000 (17:09 +0100)]
tools/libxc: free thread specific hypercall buffer on xc_interface_close
The per-thread hypercall buffer is usually cleaned up on pthread_exit
by the destructor passed to pthread_key_create. However if the calling
application is not threaded then the destructor is never called.
This frees the data for the current thread only but that is OK since
any other threads will be cleaned up by the destructor.
Changed since v1:
* Ensure hcall_buf_pkey is initialised before use. Thanks to
Christoph Egger for his help diagnosing this issue on NetBSD.
* Remove redundant if (hcall_buf) from xc_clean_hcall_buf since
_xc_clean_hcall_buf includes the same check.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Brendan Cully [Wed, 18 Aug 2010 13:50:51 +0000 (14:50 +0100)]
tools/hotplug: 21549:8bcaec29574e breaks vif-script with arguments.
For example, (vif-script 'vif-bridge bridge=eth1') in xend-config.sxp will
cause vif-setup to attempt to execute 'vif-bridge bridge=eth1' due to a
quoting mismatch. The fix appears to be to remove the extra quotes around
"$script" in vif-setup.
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Tue, 17 Aug 2010 18:32:37 +0000 (19:32 +0100)]
x86 cpuidle: check whether cpu is online in cpu idle control
We observed a 2.6.18.8 dom0 kernel crash when Xen has maxcpus < num
of physical cores (maxcpus=3D4 for a 12-core system). It appeared that
hypervisor doesn't check whether CPU is online or not. This small
patch fixed the issue.
Ian Jackson [Tue, 17 Aug 2010 16:20:53 +0000 (17:20 +0100)]
tools/libxl: compile with -Wmissing-declarations
Since the recent build error caused by mismatch of symbol types due to
missing declarations, build libxl with -Wmissing-declarations.
The patch is mostly straightforward, a one liner in the makefile enables
the flag, a lot of functions in xl_cmdimpl.c needed to be made static
and libxl_paths.c needed to include libxl.h.
The one wart on the patch-set is that flex has a bug where it emits code
with missing declarations for yy(set|get)_column. This can be worked
around by providing the declarations ourselves regardless.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Mon, 16 Aug 2010 14:31:04 +0000 (15:31 +0100)]
libxl: move various enum and #defines above datastructure definitions.
These are left behind when the datastructures move to _lixl_types.hg
in a following patch and moving them first makes that pure code motion
patch more obviously correct.
Gianni Tedesco [Mon, 16 Aug 2010 16:15:04 +0000 (17:15 +0100)]
xl: make libxl_uuid2string internal to libxenlight
libxenlight exports a function libxl_uuid2string which is used
internally in several places but has one external caller in xl.
This means that libxl internal callers leak since they were not
expecting to have to free() the UUID since the per-api-call-gc-lifetime
patch.
Convert libxl_uuid2string to be an internal function which participates
in the callers garbage collection. Eliminate string_of_uuid() macro in
favour of "format" and "arguments" macros suitable for printf()-like
functions which are made part of the libxl API and fix-up xl callers to
use that to avoid code duplication and enhance readability.
Values of cpu_weight and cpu_cap are lost after xend restart
For managed domains in state 'halted' I always get default values
for cpu_cap / cpu_weight after xend restart.
This is because the names of parameters differ between a SXP file to
create a VM (here the parameter names are cpu_cap / cpu_weight) and
a SXP file of a managed VM (here vcpus_params (cap 0) (weight 0)).
But XendConfig.py reads only cpu_cap / cpu_weight and if not found,
default values are used.
The patch reads first vcpus_params (cap, weight), if not found then cpu_cap,
cpu_weight and if both parameters are missing it uses the default values.
eXeC001er [Mon, 16 Aug 2010 16:11:30 +0000 (17:11 +0100)]
Fix "Error: Device 51952 not connected" error when using pygrub
The following is the process of booting a DomU with 'mounted-blktap2' (VHD
for example) and 'pygrub' as bootloader:
1. Connect boot-device to Dom0 as '/dev/xpvd'
2. Pygrub get info for load DomU
3. Disconnect boot-device from Dom0
4. Boot DomU
During step 3 the created device is disconnected from Dom0, but
xenstore does not scrape away after the device is disconnected so you
get the following error:
"Error: Device /dev/xvdp (51952, tap2) is already connected."
During step 3 xend calls destroyDevice always with 'tap' as argument.
Gianni Tedesco [Mon, 16 Aug 2010 12:39:19 +0000 (13:39 +0100)]
tools/libxl: remove libxl_free() since there are no more callers
libxl_free() allows allocated memory to be explicitly free'd from a
libxl_gc. Every previous use of this function has now been made
redundant and therefore has been removed. We can safely kill it and
amend the policy accordingly.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Gianni Tedesco [Mon, 16 Aug 2010 12:37:58 +0000 (13:37 +0100)]
tools/libxl: fix memory management bugs in libxl_device_disk_list()
fix invalid free segfault and use-after-free in libxl_device_disk_list()
Gah, libxl_device_disk_list() is returning a lot of pointers to free'd
data. Fix that by replacing libxl_xs_read() with xs_read() in line with
the policy.
Also fix a segfault caused by an erroneous free of the last disk-list
array element rather than the first one. This was causing xl create to
segfault when using the new qemu-dm code-base. Fix that and add a
comment about the fact that this libxl API requires a corresponding
libxl_device_disk_free() function.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools: xenconsole[d] and libxl: multiple console support
This patch implements the new protocol for handling pv consoles and
emulated serials as described in the document docs/misc/console.txt.
The changes are:
- xenconsoled: do not write the pty under serial in xenstore if
xenconsoled is handling a consolepath;
- xenconsole: implement support for an explicit console type parameter;
the parameter can be "pv", to specify that the user wants to
connect to a pv console, or "serial", to specify that the user wants to
connect to an emulated serial. If the type parameter hasn't been
specified be the user, xenconsole tries to guess which type of console
it has to connect to, defaulting to pv console for pv guests and
emulated serial for hvm guests.
- xenconsole: use the new xenstore paths;
- libxl: rename libxl_console_constype to libxl_console_consback:
constype is used to to specify whether qemu or xenconsoled provides the
backend, so I renamed it to libxl_console_consback to make it more
obvious that we are talking about backends;
- libxl: add a new libxl_console_constype to specify if the console is
an emulated serial or a pv console;
- libxl: support the new xenconsole "type" command line parameter;
- libxl: use the "output" node under console in xenstore to tell qemu
where do we want the output of this pv console to go;
- remove the legacy "serialpath" from xenconsoled altogether
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Also: update the QEMU_TAG to pull in the qemu part of these changes.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
After animated discussion with several libxl developers we seem to have
agreed on a policy for memory management within libxenlight. These
comments document the policy which is mostly implemented since
21977:51147d5b17c3 but some aspects (comments, function naming) are
guidelines to be followed in future functionality and perhaps to be
implemented by search/replace in future patches.
The document is mostly authored by Ian Jackson but with modifications to
reflect the slightly different functionality that has been implemented
since this was proposed.
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Fri, 13 Aug 2010 13:59:03 +0000 (14:59 +0100)]
x86: eliminate bogus IRQ restrictions
As pointed out in
http://lists.xensource.com/archives/html/xen-devel/2010-07/msg00077.html
the limits introduced in c/s 20072 are at least
questionable. Eliminate them in favor of a more dynamic approach:
There's no real need for an upper limit on nr_irqs (as anything beyond
nr_irqs_gsi isn't visible to domains anyway), and the split point (and
hence ratio) between GSI and MSI/MSI-X IRQs doesn't need to be hard
coded, but can instead be controlled on the command line in case there
are *very* many GSIs.
The default used for nr_irqs will be rather large with this patch, so
it may not be acceptable without also switching to a sparse irq_desc[]
as was done not so lomg ago in Linux.
The added capping of any domain's nr_pirqs is based on the observation
that no domain can possibly have more than the system wide number of
IRQs. The opposite case may in fact also require some adjustment:
Defaulting the number of non-GSI IRQs available (namely to Dom0) to a
fixed value may not be the best choice going forward, since if there
indeed are very many non-GSI interrupt sources, it won't be possible
for the kernel to make use of them without giving
"extra_guest_irqs=" on the command line (but the goal should be to
allow things to work right by default even on large systems).
Keir Fraser [Fri, 13 Aug 2010 13:58:06 +0000 (14:58 +0100)]
x2APIC: Improve x2APIC suspend/resume
x2apic depends on interrupt remapping, so it should disable interrupt
remapping behind x2apic disabling. And also this patch wraps
__enable_x2apic to get rid of duplicated code.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Fri, 13 Aug 2010 13:57:35 +0000 (14:57 +0100)]
Fix IOAPIC S3 with interrupt remapping enabled
In ioapic_suspend, it reads and saves ioapic RTEs. But when interrupt
remapping is enabled, io_apic_read will call io_apic_read_remap_rte to
convert remapped format interrupt to compatible format, this results
in 'dest' field may be changed in remap_entry_to_ioapic_rte. When in
ioapic_resume, it will write the saved RTEs with incorrect 'dest' to
interrupt remapping table.
Actually it needn't to convert RTEs regardless interrupt remapping is
enabled or not. It just needs to save and restore RTE values
directly. This patch just uses __io_apic_read and __io_apic_write,
which won't call Interrupt remapping functions to convert, to save and
restore RTEs in ioapic_suspend and ioapic_resume. Thus fix this issue.
Signed-off-by: Weidong Han <weidong.han@intel.com>
Keir Fraser [Fri, 13 Aug 2010 13:56:15 +0000 (14:56 +0100)]
sysctl: Return physinfo.max_{cpu,node}_id as maximum *possible* IDs.
In particular, this fixes setting vcpu affinities via
libxl. Previously, the affinity mask would be narrowed to the maximum
currently-online CPU. So future hotplugged CPUs could not be
expressed.
Removing the include of sys/ptrace.h and threaddb.h exposed a few
places which were using time(2) or gettimeofday(2) without including
time.h or sys/time.h respectively and were relying on an include.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>