Functions to setup pagetables, handle the p2m, map and unmap domain
pages, copy data to/from guest addresses.
The implementation is based on the LPAE extension for ARMv7 and makes
use of the two level transtion mechanism.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Functions to build dom0: memory allocation, p2m construction, mappings
of the MMIO regions, ATAG setup.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Low level assembly routines, including entry.S and head.S.
Also the linker script and a collection of dummy functions that we plan
to reduce to zero as soon as possible.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Santosh Jodh [Tue, 7 Feb 2012 18:46:50 +0000 (18:46 +0000)]
libxc: Replace malloc with alloca in hot path
Replace malloc with alloc in hot paths for improved performance.
Signed-off-by: Santosh Jodh <santosh.jodh@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Tue, 7 Feb 2012 17:21:27 +0000 (17:21 +0000)]
pygrub: extlinux parsing correctness
The "in" operator should be used instead of the find method, since
we are only interested in knowing whether the line contains "initrd=",
but we don't care about it's position. Also fixes an error that
happens when initrd= it's at the start of the line, since find returns
0 and is evaluated as False.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Tue, 7 Feb 2012 17:18:10 +0000 (17:18 +0000)]
libxl: remove shebang from bash_completion helper
Fix rpmlint warning:
xen-tools.x86_64: W: sourced-script-with-shebang
/etc/bash_completion.d/xl.sh /bin/bash
This text file contains a shebang, but is meant to be sourced, not executed.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 7 Feb 2012 17:01:57 +0000 (17:01 +0000)]
xl: use json output by default
Move the sxp producing code off into a separate file. It is supported
for legacy reasons and needn't be updated other than the improve
compatibility with xm.
libxl_domain_config is not currently generated by the IDL (adding the
necessary support for Array types is on my to do list) so hand code
the json generation function for now.
Since this rather directly exposes a libxl data structure it's not
clear what sort of forward compatibility guarantees we can
make. However it seems like it should be as stable as libxl's own API
(which we are looking to stabilise)
(Gratuitous string.h include needed for memset in libxl_util.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 [Tue, 7 Feb 2012 16:50:17 +0000 (16:50 +0000)]
xl: Drop -l option to xl cpupool-list
The implementation (which was a nop) was removed back in 22838:aab67c1c6b87 but
this now causes "set but not used" warnings from some compilers. Might as well
just nuke the option entirely.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Boris Ostrovsky [Tue, 7 Feb 2012 14:05:19 +0000 (15:05 +0100)]
x86/AMD: Add support for AMD's OSVW feature in guests.
In some cases guests should not provide workarounds for errata even when the
physical processor is affected. For example, because of erratum 400 on family
10h processors a Linux guest will read an MSR (resulting in VMEXIT) before
going to idle in order to avoid getting stuck in a non-C0 state. This is not
necessary: HLT and IO instructions are intercepted and therefore there is no
reason for erratum 400 workaround in the guest.
This patch allows us to present a guest with certain errata as fixed,
regardless of the state of actual hardware.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Acked-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
Haoyu Zhang [Mon, 6 Feb 2012 21:23:41 +0000 (13:23 -0800)]
Fix error recovery path in __gnttab_map_grant_ref
In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.
Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com> Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com> Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Keir Fraser <keir@xen.org>
Andrew Cooper [Mon, 6 Feb 2012 21:17:46 +0000 (13:17 -0800)]
IO-APIC: Reformat IO-APIC RTE debug info (v2)
Having the columns aligned makes for much easier reading. Also remove
the commas which only add to visual clutter in combination with
spaces.
Furthermore, printing fewer characters makes it less likely that the
serial buffer will overflow resulting in loss of critical debugging
information.
Changes since v1:
* Format vector as hex rather than dec
* Contract some names
* destination mode uses 'L' or 'P' instead of full words
* trigger mode uses 'L' or 'E' instead of full words
* delivery mode uses short string instead of a number
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
David Vrabel [Thu, 2 Feb 2012 15:28:58 +0000 (15:28 +0000)]
x86: avoid deadlock after a PCI SERR NMI
If a PCI System Error (SERR) is asserted it causes an NMI. If this NMI
occurs while the CPU is in printk() then Xen may deadlock as
pci_serr_error() calls console_force_unlock() which screws up the
console lock.
printk() isn't safe to call from NMI context so defer the diagnostic
message to a softirq.
Signed-off-by: David Vrabel <david.vrabel@citrix.com> Tested-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:24:53 +0000 (15:24 +0000)]
flask: add flask-{get,set}-bool tools
These utilities can be used to modify policy booleans, which allow
minor policy changes without reloading the security policy. This can
be used to make security policy change based on external information
such as time of day, user physical presence, completion of system
boot, or other relevant variables.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:23:43 +0000 (15:23 +0000)]
xsm/flask: allow policy booleans to be addressed by name
Booleans are currently only addressable by using a sequence number
that is not easily accessible to tools. Add new FLASK operations to
get/set booleans by name, and to get the name of a boolean given its
ID.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:23:04 +0000 (15:23 +0000)]
xen/xsm: fix incorrect handling of XSM hook return
If the XSM hook denied access, the execution incorrectly continued on
after an extra unlock domain.
Reported-by: John McDermott <john.mcdermott@nrl.navy.mil> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:21:13 +0000 (15:21 +0000)]
flask/policy: Add user and constraint examples
These examples show how to use constraints and the user field of the
security label to prevent communication between virtual machines of
different customers in a multi-tenant environment.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:20:40 +0000 (15:20 +0000)]
flask/policy: Policy build updates
Eliminate temporary files used in creating FLASK policy to improve
error reporting during policy build. Syntax errors now point to the
file and line number visible to the user, not the intermediate
temporary file.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:19:24 +0000 (15:19 +0000)]
xsm/flask: Improve error reporting for ocontexts
Instead of returning -EINVAL for all errors, return -EEXIST if adding
an entry that overlaps with an existing entry, and -ENOENT if
attempting to remove an entry that does not exist. Adding an ocontext
that already exists with the same SID is no longer an error.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:18:19 +0000 (15:18 +0000)]
xsm: Add xsm_map_domain_pirq hook
When checking permissions in map_domain_pirq, the msi_desc field of
the irq_desc is not yet populated with the PCI device being used. Pass
in the msi_info structure which contains the intended PCI device whose
label will be used in the security check.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:17:46 +0000 (15:17 +0000)]
xsm/flask: Use PCI device label for PCI-MSI IRQs
Because the PCI-MSI IRQ numbers are allocated dynamically, labeling
them by number is not useful. Instead, for all IRQs beyond
nr_irqs_gsi, use the associated msi_desc to find the PCI device and
use the label of the PCI device for the IRQ.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
Daniel De Graaf [Thu, 2 Feb 2012 15:16:34 +0000 (15:16 +0000)]
xsm: Add security labels to event-channel dump
In FLASK, event channel labels are distinct from the labels of the
domain using them. When debugging policy issues, it is useful to be
able to view the current label of event channels; add this label to
the event channel dump.
This patch also adds the IRQ associated with a PIRQ for event channels
bound to a PIRQ, and moves the xen_consumer flag to the front to
create more consistent alignment in the output.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Committed-by: Keir Fraser <keir@xen.org>
x86/mm: Reorder locks used by shadow code in anticipation of synchronized p2m lookups
Currently, mm-locks.h enforces a strict ordering between locks in the mm
layer lest there be an inversion in the order locks are taken and thus
the risk of deadlock.
Once p2m lookups becoming synchronized, get_gfn* calls take the p2m lock, and a
new set of inversion arises. Reorder some of the locks in the shadow code so
that even in this case no deadlocks happen.
After this, synchronized p2m lookups are in principle ready to be enabled in
shadow mode.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
x86/mm: Don't fail to nominate for paging on type flag, rather look at type count
Xen doesn't clean the type flag when dropping the type count for a page to
zero. So, looking at the type flag when nominating a page for paging it's
incorrect. Look at the type count instead.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Signed-off-by: Adin Scannell <adin@scannell.ca> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Ian Campbell [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
xl: allow enable automatic fallback to ACPI events if PV control not available.
Add a -F (fallbacks) option to xl destroy|reboot to cause an ACPI shutdown or
reset event to be sent to the guest in the event that the guest does not
support the PV control interface.
This is not the default because the response to these triggers is an
guest-internal configuration.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
docs: document /etc/xen/xl.conf
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
libxl: add named enum for timer mode.
Unlike previous iterations of this patch the enum values now match the
underlying domctl values.
I looked at updating xl.cfg(5) for these while I was here but frankly, even
after reading the comment in xen/include/public/hvm/params.h, I don't have a
clue what they mean, no_missed_ticks_pending in particular might as well be
written in klingon...
For the same reason I didn't try and give the enum more user-friendly 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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
libxl: drop libxl_cpuarray -- topology was the only user.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
libxl: expose cpu topology as a single list of cpu->{node,core,socket} maps.
Rather than the previous tripple list which is more complicated to work with
and harder for language bindings.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
ocaml: Topology.get returns an array not a single element.
The stub implementation appears to already be correct.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
ocaml: add helpers for Some/None option types.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
libxl: remove libxl_button_press in favour of libxl_send_trigger.
send_trigger already included all the operations covered by button_press.
Rework send_trigger to take an enum instead of a string.
I stopped short at removing the xl "button-press" command but instead have
marked it as deprecated.
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 [Tue, 31 Jan 2012 16:34:39 +0000 (16:34 +0000)]
libxl: de-hard-tabbify idl.txt
Hard tabs were in the minority, nuke them.
Also we no longer supply the inaddr_ip builtin.
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 [Tue, 31 Jan 2012 16:34:38 +0000 (16:34 +0000)]
libxl: Rename libxl IDL infrastructure.
Originally libxltypes.py provided the infrastructure and libxl.idl provided the
specific types.
In 23887:a543e10211f7 libxl.idl became libxl_types.idl (to allow for
libxl_types_internal.idl) which means we now have libxl_types.FOO and
libxltypes.FOO providing different things and annoying people in tab
completion.
Rename the infrastructure as idl.
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 [Tue, 31 Jan 2012 16:34:38 +0000 (16:34 +0000)]
libxl: only write "disable_pf" key to xenstore when it makes sense
This key is only used by the traditional qemu-dm when servicing an HVM domain.
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 [Tue, 31 Jan 2012 16:34:38 +0000 (16:34 +0000)]
libxl: remove libxl_device_model_info.
All that is left here is the target domain's domid which we can pass around as
a parameter.
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 [Tue, 31 Jan 2012 16:34:38 +0000 (16:34 +0000)]
libxl: move "saved_state" to libxl__domain_build_state.
This is internal to the library and need not be exposed to the user.
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 [Tue, 31 Jan 2012 16:34:32 +0000 (16:34 +0000)]
libxl: move device model selection variables to b_info.
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 [Tue, 31 Jan 2012 15:21:52 +0000 (15:21 +0000)]
libxl: remove uuid from device model info.
This should be managed by libxl and need not be exposed to the user.
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 [Tue, 31 Jan 2012 15:21:52 +0000 (15:21 +0000)]
libxl: Remove libxl_device_model_info.type.
This is the type of the target guest which is part of the guest config.
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 [Tue, 31 Jan 2012 15:21:52 +0000 (15:21 +0000)]
libxl: move gfx_passthru setting to b_info->u.hvm
Although xl parsed this value for both PV and HVM domains (and then a second
time for HVM domains) inside libxl it only impacts HVM guests so I think this
is the right place for 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 [Tue, 31 Jan 2012 15:21:52 +0000 (15:21 +0000)]
libxl: HVM device configuration info build_info->u.hvm
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 [Tue, 31 Jan 2012 15:21:51 +0000 (15:21 +0000)]
libxl: move HVM emulated GFX support into b_info->u.hvm
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 [Tue, 31 Jan 2012 15:21:51 +0000 (15:21 +0000)]
libxl: use vfb[0] directly for xenpv device model
Rather than laundering it via dm info.
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 [Tue, 31 Jan 2012 15:21:51 +0000 (15:21 +0000)]
libxl: drop dm_info.dom_name
This is always the same as the c_info name which we now have available.
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 [Tue, 31 Jan 2012 15:21:51 +0000 (15:21 +0000)]
libxl: remove redundant info from dm info.
Remove "target_ram", "acpi", "vcpus" and "vcpu_avail" from device model info
and use domain_build_info instead. These must all be consistently specified to
both the domain and the device model, there is no need (and a great deal of
danger) in exposing a way for a user of libxl to set them differently.
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 [Tue, 31 Jan 2012 15:21:51 +0000 (15:21 +0000)]
libxl: now that dm creation takes domain_config stop passing down devices.
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 [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: plumb libxl_domain_config down into device model creation.
Creating the device model derives lots of bits from the guest configuration.
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 [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: define libxl_sdl_info to hold all info about the SDL config
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 [Tue, 31 Jan 2012 14:41:00 +0000 (14:41 +0000)]
libxl: define libxl_spice_info to hold all info about the spice server
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 [Tue, 31 Jan 2012 14:40:59 +0000 (14:40 +0000)]
libxl: define libxl_vnc_info to hold all info about the vnc info
Reduces duplication in libxl_vfb and libxl_device_model.
Updated bindings but the python ones in particular are unlikely to be useful
until a user presents itself and fixes them up.
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 [Tue, 31 Jan 2012 14:40:08 +0000 (14:40 +0000)]
ocaml: use libxl IDL type helpers for C argument passing
Makes handling of nested structs more correct.
Only change to the generated code right now is that the FOO_Val
(C->ocamlC) function for Enumeration types now takes the C argument by
value instead of reference.
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 [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: use keyword arguments for field definitions in aggregate types.
The original code is not so bad now that the comments are gone but this is
still a bit cleaner.
No change in the generated code.
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 [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: remove comment support from IDL
People typically don't look for comments in generated source and the syntax for
specifying them in the IDL makes things harder to follow.
Instead just use source code comments in the IDL itself.
I dropped a bunch of "foo bool # enable or disable foo" type comments. A lot of
the remainder still aren't terribly useful though.
No change to the generate code other than the comments being removed.
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 [Tue, 31 Jan 2012 14:39:57 +0000 (14:39 +0000)]
libxl: remove libxl_domain_create_info.poolname
It is redundant with poolid and allowing the user to specify both
opens up the possibility of a disconnect.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: juergen.gross@ts.fujitsu.com
[since v2 - correct default is 0 not -1] Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Roger Pau Monne [Tue, 31 Jan 2012 16:48:06 +0000 (16:48 +0000)]
libxl: add support for yajl 2.x
This patch adds support for yajl versions 2.x, while retaining 1.x
compatibility. All the needed ifdefs can be found in libxl_json.h.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Tue, 31 Jan 2012 16:06:14 +0000 (16:06 +0000)]
mini-os: use BSD sys/queue.h instead of Linux list.h
The latter is GPL which makes the whole of mini-os GPL rather than BSD
as intended. In tree users are all GPL or GPL-compatible but we should
fix this so that mini-os is BSD. Do so by using the same BSD
sys/queue.h as we use in libxl.
Tested with the builtin mini-os test app and qemu stubdomain, both of which
appear to still function as expected.
Move tools/libxl/external and the associated sed script to
tools/include/xen-external to allow more sensible access from mini-os.
Also add s/NULL/0/ in the sed script due to NULL not always being
defined in stubdom code when mini-os/wait.h is included.
As well as the obvious ABI changes there are a few API updates
associated with the change:
- struct rw_semaphore.wait_list is unused
- remove_waiter needs to take the wait_queue_head
The latter requires a qemu update, so there is also a QEMU_TAG
update in this changeset.
I sprinkled some extra-emacs local variables around the files I edited
which didn't have them.
I think this should be backported to the stable branches since
external users of mini-os may have been mislead into thinking they
could safely link mini-os against GPL-incompatible code.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Olaf Hering [Tue, 31 Jan 2012 11:35:07 +0000 (11:35 +0000)]
tools/libxc: remove volatile keyword for bitmap operations
All bitmaps maintained by xc_bitops.h are used in single threaded
applications. So nothing will change the bitmaps content, adding
volatile adds just unneeded memory reloads.
xenpaging uses bitmaps alot and using non-volatile versions will
slightly improve performance.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Keir Fraser <keir@xen.org>
Olaf Hering [Tue, 31 Jan 2012 11:33:35 +0000 (11:33 +0000)]
mini-os: convert mlock macros to C functions
mlock and munlock are implemented as macros in mini-os. Their usage
requires casting in common code. Convert them to C syntax and provide
an empty dummy function. Remove the now unneeded (void) cast from two
munlock calls.
Olaf Hering [Mon, 30 Jan 2012 12:06:34 +0000 (13:06 +0100)]
xenpaging: unify return value in nominate and evict
Let p2m_mem_paging_nominate and p2m_mem_paging_evict return just one
error number. EINVAL is not very helpful in case of nominate, it can
happen if the pager tries to nominate a ballooned page. In this case the
gfn is not backed by a mfn, the pager can not know that. Similar with
evict, anything can happen between nominate and evict.
This change helps the pager to decide if the returned error is from the
function itself, or if it happend earlier. In the latter case, it is
most likely fatal and should be handled as such.
nominate and evict return EBUSY, which is supposed to mean
"pager request reached target function, and failed."
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Committed-by: Tim Deegan <tim@xen.org>
Ian Jackson [Mon, 30 Jan 2012 15:23:39 +0000 (15:23 +0000)]
libxl: treat "dying" domains as destroyed
Rename the DOMAIN_DESTROY event to DOMAIN_DEATH and have it trigger
when the domain goes into the state indicated by the domaininfo flag
"dying".
This fixes a race which could leak a daemonised xl process, which
would have ignored the domain becoming "dying" and would then wait
forever to be told the domain was destroyed.
After the domain becomes "dying" we can't generate an event when it is
actually destroyed because xenstored will eat the relevant
VIRT_DOM_EXC virq and not generate an @releaseDomain, since xenstored
discards its own record of the domain's existence as soon as it sees
the domain "dying" and will not trigger @releaseDomain watches for
domains it knows nothing about. Arguably this is a bug in xenstored,
and the whole @releaseDomain machinery is rather poor, but let us not
fix that now.
Anyway, xl does not really want to know when the domain is ultimately
destroyed. It is enough for xl to know that it is on the way out, in
the "dying" state (which leads later to destruction by Xen).
Also fix a bug where domain_death_xswatch_callback might read one
domain beyond the valid data in its domaininfos array, by correctly
ordering the checks for empty domain list, end of domain list, and our
domain being missing.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com> Tested-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>