Commit Graph
22770 Commits
Author SHA1 Message Date
Christoph Egger 95dca036a5 tools/hotplug/NetBSD: update netbsd scripts (interface names)
sysctl fail due to the '.' in the interface name:

Jan 10 00:02:26 paris /netbsd: xvif108.0: could not attach sysctl nodes
Jan 10 00:02:57 paris /netbsd: sysctl_createv: sysctl_create(xvif108.0)
returned 22

The kernel driver have recently been fixed and attached patch updates
to the hotplug scripts accordingly.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-17 17:31:24 +00:00
Daniel De Graaf 618a3fb38b libxc: Remove set_max_grants in linux
The maximum number of grants is now constrained domain-wide in linux,
so set_max_grants should be a noop there. Previously, this constraint
was per-file-description.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-17 17:28:30 +00:00
Ian Jackson 38da12ffee Merge 2011-01-17 17:24:21 +00:00
Christoph Egger 85b9116223 libxl: fix guest networking on NetBSD
As previously reported when I start guests with xl then the
guest network does not work because the qemu-ifup script
no longer runs.

NetBSD doesn't have something like udev. Changing xm/xend,
libxl and xenbackendd to make everything behave the same way
is a lot more intrusive than enabling it for NetBSD again.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-17 17:18:38 +00:00
Ian Campbell a4f86af3e4 tools/blktap, blktap2: include <sys/mount.h> instead of <linux/fs.h>
The former is a userspace sanitised header which contains the
definitions we need. In some distros linux/fs.h defines WRITE which
conflicts with blktaps own use of that name.

Also there is no reason to use <linux/errno.h> over the more normal
<errno.h>.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-17 17:14:20 +00:00
Keir Fraser e7adac50b0 rcupdate: Make rcu_barrier() more paranoia-proof
I'm not sure my original barrier function is correct. It may allow a
CPU to exit the barrier loop, with no local work to do, while RCU work
is pending on other CPUs and needing one or more quiescent periods to
flush the work through.

Although rcu_pending() may handle this, it is easiest to follow
Linux's example and simply call_rcu() a callback function on every
CPU. When the callback has executed on every CPU, we know that all
previously-queued RCU work is completed, and we can exit the barrier.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 16:38:51 +00:00
Liu, Jinsong ecc523710a PoD: Fix two code comments
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
2011-01-14 15:47:01 +00:00
Keir Fraser 23b4cad2cd hvmloader: Fixes to printf() implementation.
1. Remove unportable O and D format specifiers
2. Fix X format specifier to print upper-case hex characters
3. Fix d format specifier to print -ve numbers
4. Fix handling of int vs. long (although not actually an issue
   for the i386 compile target)
5. Don't use the antiquated C 'register' type attribute.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 15:21:24 +00:00
Keir Fraser 48f902c059 x86 hvm: Do not check-and-fail on in_atomic() in hvm_copy().
Stub this out for 4.0, as PV-on-HVM drivers hit this case when
performing grant-table hypercalls. Grant-table code currently accesses
guest memory under bug per-domain lock. The test in hvm_copy() is not
necessary until the xenpaging implementation is more complete, which
will not now be until after 4.1.0.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 15:18:02 +00:00
Jan Beulich 5d7db6a945 x86-64: pci_probe must be resident
... now that we reference it from emulate_privileged_op().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-01-14 14:26:11 +00:00
Ian Campbell 2f95efa271 libxc: build fix with debugging disabled.
Currently hypercalls have only 5 arguments, hypercall->arg[0..4]. Do
not try and print arg[5] else:

        cc1: warnings being treated as errors
        xenctrl_osdep_ENOSYS.c: In function
        'ENOSYS_privcmd_hypercall':
        xenctrl_osdep_ENOSYS.c:30: error: array subscript is above
        array bounds

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-01-14 14:25:31 +00:00
Keir Fraser 00e9c7bcb6 x86: On CPU online/offline from dom0, try flushing RCU work on EBUSY.
Although the caller should react appropriately to EBUSY, if the error
is due to pending RCU work then we can help things along by executing
rcu_barrier() and then retrying. To this end, this changeset is an
optimisation only.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 14:19:55 +00:00
Keir Fraser 9d9af7dca8 x86 acpi: Fix crash in enable_nonboot_cpus() on wakeup from S3/S4
Bringing a CPU back online can require RCU work to be flushed, because
the per-cpu data from last time the CPU was online may not yet be
deallocated. Use the new rcu_barrier() interface function to achieve
this.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 14:18:31 +00:00
Keir Fraser 24273c92be rcupdate: Implement rcu_barrier() to synchronously flush RCU work.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 14:16:42 +00:00
Keir Fraser 28c7ad54f5 stop_machine: Allow specified function to run on all CPUs.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 14:16:04 +00:00
Keir Fraser 22154402c7 x86 sysctl: Remove unused CPU hotplug status stuff.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 14:07:39 +00:00
Keir Fraser f573a5226a tools/misc/xen-hptool: Silently retry on CPU hotplug EBUSY failure.
EBUSY is a legitimate soft failure, due to inability to acquire a
lock, or because RCU work has not been done since a CPU was last
offlined.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 09:53:22 +00:00
Keir Fraser 2d87af888f cpu hotplug: Core functions are quiet on failure.
This was already inconsistent, so make them consistently quiet and
leave it to callers to log an error. Add suitable error logging to the
arch-specific CPU bringup loops,

In particular this avoids printing error on EBUSY, in which case
caller may want a silent retry loop.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 09:52:02 +00:00
Keir Fraser 835e8cf959 x86 fpu: Code clean up. Eliminate per-cpu xsave init verbosity.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 09:11:28 +00:00
Keir Fraser 5a96732bd4 x86: Avoid calling xsave_alloc_save_area before xsave_init
Currently, xsave_alloc_save_area will be called in
init_idle_domain->scheduler_init->alloc_vcpu->vcpu_initialise calls
with xsave_cntxt_size=0, it is earlier than xsave_init called in
identity_cpu(). This may causing buffer overflow on xmem_pool.

Idle domain isn't using FPU,SSE,AVX or any such extended state and
doesn't need it saved. xsave_{alloc,free}_save_area() should
test-and-exit on is_idle_vcpu(), and our context switch code should
not be doing XSAVE when switching out an idle vcpu.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-14 08:34:53 +00:00
Allen Kay 91fa20635a vt-d: quirks for Sandybridge errata workaround, WLAN, VT-d fault escalation
Adding errata workaround for newly released Sandybridge processor
graphics, additional WLAN device ID's for WLAN quirk, a quirk for
masking VT-d fault escalation to IOH HW that can cause system hangs on
some OEM hardware where the BIOS erroneously escalates VT-d faults to
the platform.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2011-01-14 08:11:46 +00:00
Keir Fraser a8cc5c12fb vt-d: Fix crash issue when not sharing EPT and VT-d tables.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2011-01-14 08:08:37 +00:00
Keir Fraser 0023f32c80 pv-drivers: use PCI interfaces to request IO and MEM resources on platform device
This is the correct interface to use and something has broken the use
of the previous incorrect interface (which fails because the request
conflicts with the resources assigned for the PCI device itself
instead of nesting like the PCI interfaces do).

pci_request_region() has been available since at least Linux 2.6.5.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-01-14 08:02:26 +00:00
Keir Fraser 342e60022d Update Xen version to 4.1.0-rc2-pre 2011-01-13 16:00:59 +00:00
Tim Deegan 4e985437cc x86/mm: make page-sharing use the proper typecount functions
instead of having its own cmpxchg loops.

This should remove some confusion about the use of PGT_none,
and also makes page-sharing participate properly in the TLB
flushing discipline.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-13 15:46:13 +00:00
Tim Deegan 281e68cc33 x86/mm: fix EPT PoD locking to match the normal p2m case.
This recursive-locking bug was fixed in the main p2m code in
20269:fd3d5d66c446 (in October 2009) but has lurked unseen in
the EPT side since then.  Copy the fix across.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-01-13 15:46:13 +00:00
Keir Fraser fb3420e086 Added signature for changeset 2a60be40e2cb 2011-01-13 15:38:48 +00:00
Keir Fraser 1ef35c24b0 Added tag 4.1.0-rc1 for changeset 2a60be40e2cb 2011-01-13 15:38:38 +00:00
Keir Fraser d7bcf432a2 Update Xen version to 4.1.0-rc1 4.1.0-rc1 2011-01-13 15:38:29 +00:00
Ian Jackson 6e7334338f xl: correct test for domid on error exit from domain_create
The previous changeset 22739:d839631b6048 changed the initialisation
of domid without changing the corresponding cleanup test.  Oops.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-13 01:26:44 +00:00
Ian Jackson 8636567f45 xl: save domain config (userdata) under correct domid/uuid
Recent changes caused the domain config file to be saved under dom0's
filename in /var/lib/xen.  This was due to the config file being saved
before the domain was created and thus before the domid and uuid were
known.

Fix this by moving the saving code to after creation.

Also, change the "default" initialisation of domid in
xl_cmdimpl.c:create_domain to be domid=-1.  That provides a more
obviously wrong value than 0 (which refers to dom0) so that other bugs
of this kind would be more likely to show up.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-13 00:18:35 +00:00
Ian Jackson 42c08220dd libxl: config parser: Rebuild config file parser scanner (rerun flex)
The scanner from c/s 22735:cb94dbe20f97 is buggy and crashes with a
segmentation fault.  Rebuilding the sanner appears to fix the problem
so it appears that I somehow accidentally checked in a scanner which
doesn't correspond to the committed scanner source code.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-12 14:14:13 +00:00
Keir Fraser b10319695f Revert 22706:ca10302ac285 "xenpaging: update machine_to_phys_mapping[] during page deallocation"
Crashes during boot, due to m2p tables not being set up early enough.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-01-12 10:53:56 +00:00
Ian Jackson cce0d574d1 Merge 2011-01-11 19:41:53 +00:00
Ian Jackson 54fbaf446b libxl: config parser: print warning for apparent arbitrary python
The characters - + . ( ) : are not legal in xl config files but are
valid Python and use of at least one of them is almost essential for
writing arbitrary Python in the config file.

So if we see one of these during lexing, note it, and then after the
parse is complete if it failed we print a special extra warning.

Currently this warning refers to the nonexistent wiki page
  http://wiki.xen.org/xenwiki/PythonInXlConfig
which will have to be written (and/or given a better name) before the
actual 4.1 release.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 19:31:41 +00:00
Ian Jackson 3e58e5d9c1 libxl: config parser: rerun flex (Debian lenny 2.5.35)
We are going to need to rerun flex to generate new lexer code.  So
rerun it now to separate out the irrelevant from the relevant changes
to the generated files.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 19:30:16 +00:00
Ian Jackson 6615a0a173 libxl: config parser: make CfgParseContext initialisation common
xlu_cfg_readfile and xlu_cfg_readdata had some somewhat-boilerplate
code for initialisation, parsing, and cleanup.  Make that common.

No functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 19:29:05 +00:00
Ian Jackson 1d80237d14 libxl: config parser: do not segfault in some error paths
In error paths, xlu__cfg_set_free can be called on NULL.
So check for that rather than segfaulting.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2011-01-11 19:28:22 +00:00
Gianni Tedesco 0479adbbc3 tools/python/pyxl: Updates to builtin-type marshalling functions
Allow setting a string field to None as a way to zero it out.
Implement setting/getting libx_file_references as strings.
Produce relevant Exceptions marshallers which remain unimplemented.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:58:02 +00:00
Gianni Tedesco 56994c4fb3 tools/python/pyxl: Export PCI passthrough related libxl functions
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:57:37 +00:00
Gianni Tedesco a174473317 tools/python/pyxl: Allow subclassing of auto-generated python types
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:57:16 +00:00
Gianni Tedesco e1d9a99f18 tools/python/pyxl: Export relevant integer constants from python wrapper
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:56:48 +00:00
Gianni Tedesco 61097895f0 tools/python/pyxl: Un-muddle libxl_domain_(pause|unpause) wrappers
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:55:24 +00:00
Gianni Tedesco 5644ab84f7 tools/python/pyxl: Fix reference counting of Py_(None|True|False)
The incorrect refcounting causes the python interpreter to crash

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:54:44 +00:00
Ian Jackson bdf80c61cb QEMU_TAG update 2011-01-11 18:52:21 +00:00
Michal Novotny a7eac41469 tools/xend: check for device model if path is not specified
this is the patch to check for device model (in XendConfig.py) when the
device_model had no path specified, i.e. XenD was trying to read the
file on the auxbin path. Without this patch applied the meaningless
python error "coercing to Unicode: need string or buffer, NoneType
found" occurred:

[2010-11-30 13:56:47 5255] ERROR (xmlrpclib2:181) Internal error
handling xend.domain.create
Traceback (most recent call last):
   File "/usr/lib64/python2.4/site-packages/xen/util/xmlrpclib2.py",
line 134, in _marshaled_dispatch
     response = self._dispatch(method, params)
   File "/usr/lib64/python2.4/SimpleXMLRPCServer.py", line 406, in _dispatch
     return func(*params)
   File
"/usr/lib64/python2.4/site-packages/xen/xend/server/XMLRPCServer.py",
line 80, in domain_create
     info = XendDomain.instance().domain_create(config)
   File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomain.py",
line 1001, in domain_create
     dominfo = XendDomainInfo.create(config)
   File "/usr/lib64/python2.4/site-packages/xen/xend/XendDomainInfo.py",
line 97, in create
     domconfig = XendConfig.XendConfig(sxp_obj = config)
   File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py",
line 367, in __init__
     self.validate()
   File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py",
line 558, in validate
     self._platform_sanity_check()
   File "/usr/lib64/python2.4/site-packages/xen/xend/XendConfig.py",
line 502, in _platform_sanity_check
     if not os.path.exists(self['platform']['device_model']):
   File "/usr/lib64/python2.4/posixpath.py", line 171, in exists
     st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

This patch raises VmError with message that no valid device model was
specified if None type was found in the device_model specification.

It's been tested on non-existing device model where the message is being
printed. If an invalid (but existing) device_model is set in the
configuration file the domain was destroyed because it crashed. If there
is a path specified (i.e. it's not using auxbin path) it bails with
error that the device model was not found (which was already implemented
there).

Signed-off-by: Michal Novotny <minovotn@redhat.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:51:28 +00:00
Christoph Egger cdca3dd8ed libxl: fix missing include of <signal.h>
libxl_dm.c:713: warning: implicit declaration of function 'kill'

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:44:41 +00:00
Gianni Tedesco 9bdd55b787 libxl: move domain struct init functions from xl to libxl
This allows libxl users to get some sane default values for this complex
set of structures. This is purely code movement and there are no
functional changes except for a trivial error handling change in nic
device init.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:32:32 +00:00
Gianni Tedesco 760b359388 libxl: Introduce libxl_domain_create_new() and libxl_domain_create_restore()
These functions are introduced as the new way to create domains with libxl
they prevent the callers from need to know about low-level implementation
details such as:
 - libxl_domain_make()
 - libxl_domain_build()
 - libxl_domain_restore()
 - when to attach the console
 - how to start the device model

Above mentioned functions and all API's for the device model, which are now
redundant, have been made internal to libxl and no longer accessible.

The ocaml binding for libxl has not been properly updated to reflect the
changes, wrappers for the old functions have been removed but the code to wrap
the new functions has not been added.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:29:43 +00:00
Ian Campbell 64bc47d9a1 libxl: refactor code which adds per-PCI device backend nodes in xenstore
libxl_create_pci_backend and libxl_device_pci_add_xenstore contains
identical code to setup the per device xenstore nodes in the backend.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-01-11 18:16:45 +00:00