Commit Graph
22939 Commits
Author SHA1 Message Date
Stefano Stabellini 7b289f9e42 libxl: create xenstore backend for empty disks
We still need to create the vbd backend in xenstore even if the disk
format is DISK_FORMAT_EMPTY.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:49:57 +00:00
Stefano Stabellini 1c0d8c69ec xl: fix cdrom_insert parsing
Reuse the same code used to parse the disk line from the VM config file
in cd_insert.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:49:00 +00:00
Ian Jackson 72d528b057 docs: vbd-interface.txt: correct behaviour for modern Linux pv-on-hvm
Modern PV on HVM kernels map hd* devices to corresponding xvd*.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:48:05 +00:00
Ian Campbell 51b85cf4a6 libxl: do slow resume after failed migration attempt
both of the current callers for libxl_domain_resume are calling after
a migration has failed, one is failure to suspend on the sender and
the other is failure to start on the destination, both leading to a
resume attempt on the sender.

However in the first case, failure to suspend, there is no guarantee
that the guest has made it as far as the suspend hypercall and
therefore the fast resume method, which frobs the hypercall return to
indicate a cancelled suspend, cannot safely be used since it will
corrupt %eax/%rax.

For the second case, failure to start on destination, I don't think it
really matters if the resume is fast or slow.

Therefore always use the slow/uncooperative version of xc_domain_resume from
libxl_domain_resume.

This makes a PV domain which failed to suspend (e.g. because the core
Linux PM infrastructure within the guest didn't allow it) recover
gracefully.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:40:17 +00:00
Juergen Gross a9dd01431a xl cpupool-numa-split: reduce number of Dom0 vcpus
When reducing the number of physical cpus available for Domain-0 by xl
cpupool-numa-split, reduce the number of vcpus accordingly.

Signed-off-by: juergen.gross@ts.fujitsu.com
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:39:13 +00:00
Stefano Stabellini 8f4208be5d xl daemon: fix some memory leaks
If we are watching multiple disks we have to free multiple waiters.

Free the event before continuing the loop.

Destroy the disk device returned by libxl_event_get_disk_eject_info.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-17 19:12:45 +00:00
Keir Fraser d25ba26a9a tools/examples: Remove obsolete bochsrc example file.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-17 12:18:01 +00:00
Keir Fraser 59148b51df Update Xen version to 4.1.0-rc6-pre 2011-02-16 18:23:48 +00:00
Keir Fraser aa87a33ad2 Added signature for changeset d2d27d989ebc 2011-02-16 18:23:24 +00:00
Keir Fraser 5c881903f3 Added tag 4.1.0-rc5 for changeset d2d27d989ebc 2011-02-16 18:23:14 +00:00
Keir Fraser 317f9f334f Update Xen version to 4.1.0-rc5 4.1.0-rc5 2011-02-16 18:23:07 +00:00
Keir Fraser 436de2833f x86 p2m: Reinstate || errneously removed by 22924:86000076dcee
Fixes x86_32 build.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-16 16:20:36 +00:00
Ian Campbell 037cbc775a MAINTAINERS: Explicitly list architecture maintainers and lists.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-02-16 09:49:33 +00:00
Tim Deegan bc6595da1a x86/shadow: unconditionally set the p2m/log-dirty allocation functions.
Otherwise enabling log-dirty mode on a PV guest that already has
a shadow allocation can leave the alloc/free functions pointers NULL,
and later try to dereference them.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-16 09:48:05 +00:00
Tim Deegan b58852fcd8 x86/mm: partially revert 21093:4a3e131f7498
p2m internals should always gate on whether HAP is enabled for the
domain, not whether a HAP paging mode is currently advertised.
This lets us revert the change to hap_enable() that advertises the
new mode before it's safe to use it.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-16 09:47:37 +00:00
Kamala Narasimhan 73b16b07ca docs: document disk configuration string syntax (particularly, xl's syntax)
Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-15 20:02:44 +00:00
Kamala Narasimhan 583d10aea0 libxl: disk specification: special case vhd
Special case how we validate vhd image files.  Without this patch when
tap:aio:vhd prefixed image files are specified in the config file,
disk validation and thus vm creation will fail.

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-15 20:00:33 +00:00
Kamala Narasimhan 546a764045 libxl: disk specification interface change
Currently we pile all the backend and format information pertaining to
disk option in a single enum.  This check-in separates the two and
uses two enums, one for disk format and another for disk backend.
This helps clearly differentiate between disk format and backend
within the implementation and also helps cleanup the code in this area
in preparation for the impending parser revamping to be done post 4.1.
Along with separating format and backend, this check-in also removes
unwanted types and renames variables in the disk interface and fixes
the code affected by the interface changes.

In specific, here are the disk interface changes made - In
libxl_device_disk structure physpath was renamed to pdev_path,
virtpath was renamed to vdev, phystype was removed and replaced with
backend and format enums.  Also previously a single enum
libxl_disk_phystype held the values for qcow, qcow2, vhd, aio, file,
phy, empty and that got refactored into two enums, libxl_disk_format
to hold unknown, qcow, qcow2, vhd, raw, empty and libxl_disk_backend
to hold unknown, phy, tap and qdisk.

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-15 19:59:37 +00:00
George Dunlap a7fd96dfbd tools: Include cpupool example in /etc/xen
xl cpupool-create at the moment requires a config file.  Make
sure to include the example config file in the install.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-15 19:39:05 +00:00
Ian Campbell 6589a2fe4e libxl: fix migrate for HVM guests
Prior to 22909:6868f7f3ab3f libxl would loop waiting simultaneously
for the domain the acknowledge a PV suspend request (by clearing the
XenStore node) and for the domain to actually suspend. For HVM guests
without PV drivers this same loop was simply waiting for the domain to
suspend.

In 22909:6868f7f3ab3f the original loop was split into two loops
(first waiting for the acknowledgement and then for the actual
suspend). This caused libxl to incorrectly wait for an HVM guest
without PV drivers to acknowledge the XenStore request, which is not
something it would ever do.

Fix this by only waiting for an acknowledgement from a guest which
contains PV drivers.

Previously we were also making the request regardless of whether the
guest had PV drivers, change that to only make the request if the
guest has PV drivers.

Lastly there is no need to sample HVM_PARAM_ACPI_S_STATE twice and not
doing so simplifies the test for PVHVM vs. normal HVM guests.

Tested with:
	Windows with GPL PV drivers (event channel suspend mode)
	Windows without PV drivers (xc_domain_shutdown mode)
	Linux PV (PV with XenBus control node mode)
	Linux HVM (PVHVM with XenBus control node mode (*))
	Linux HVM (xc_domain_shutdown mode)

(*) In this case the kernel didn't actually suspend, due to:
	PM: Device input1 failed to suspend: error -22
	xen suspend: dpm_suspend_start -22
    which may be a misconfiguration in my setup or may be a kernel
    bug, but the libxl side dealt with this as gracefully as it could.

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>
2011-02-14 17:02:55 +00:00
Juergen Gross fb37da1031 xl: Support more than 32 vcpus for xl vcpu-set
xl vcpu-set currently uses a 32 bit mask for specifying which cpus are to be
set online. This restricts the number of cpus supported by this command.

The patch switches to libxl_cpumap, the interface of libxl_set_vcpuonline()
is changed accordingly.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-14 16:56:20 +00:00
Juergen Gross b948a2f41a xl: correct xl cpupool-create with extra parameters
xl cpupool-create won't take always extra parameters specified on the command
line, as a 0-byte is missing at the end of the configuration file contents.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-14 16:55:00 +00:00
Stefano Stabellini 7a52b5c131 libxl: implement trigger s3resume
This is the equivalent of xm trigger s3resume and it is implemented the
same way: using an ACPI state change.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-14 16:49:03 +00:00
Wei Gang f2cc804445 x86: Fix S3 resume for HPET MSI IRQ case
Jan Beulich found that for S3 resume on platforms without ARAT feature
but with MSI capable HPET, request_irq() will be called in
hpet_setup_msi_irq() for irq already setup(no release_irq() called
during S3 suspend), so that always falling back to using
legacy_hpet_event.

Fix it by conditional calling request_irq() for 4.1. Planned to split
the S3 resume path from booting path post 4.1, as Jan suggested.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
2011-02-14 10:41:12 +00:00
Ian Campbell fb6b4152c9 MAINTAINERS: Update Remus paths
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
2011-02-14 10:39:34 +00:00
Keir Fraser 3931199e49 MAINTAINERS: Add Remus maintainer.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2011-02-14 09:10:22 +00:00
Keir Fraser 0d1f62735d Revert 22900:a0ef80c99264
The check it adds is already present in the function's sole caller.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-14 09:05:14 +00:00
Ian Jackson 9b908cbbcf QEMU_TAG update 2011-02-11 18:22:37 +00:00
Ian Jackson cd98e00714 tools/hotplug/Linux: Use correct device name for vifs in setup scripts
In vif-common.sh, set the shell variable "dev" to the new interface
name when interfaces are renamed, and consistently use this variable
in all the vif scripts.

This fixes hotplug of renamed interfaces.

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
From: Patrick Scharrenberg <pittipatti@web.de>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Patrick Scharrenberg <pittipatti@web.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-11 18:21:35 +00:00
Ian Campbell f393b48c18 libxl/xl: improve behaviour when guest fails to suspend itself.
The PV suspend protocol requires guest co-operating whereby the guest
must respond to a suspend request written to the xenstore control node
by clearing the node and then making a suspend hypercall.

Currently when a guest fails to do this libxl times out and returns
a generic failure code to the caller.

In response to this failure xl attempts to resume the guest. However
if the guest has not responded to the suspend request then the is no
guarantee that the guest has made the suspend hypercall (in fact it is
quite unlikely). Since the resume process attempts to modify the
return value of the hypercall (to indicate a cancelled suspend) this
results in the guest eax/rax register being corrupted!

To fix this change libxl to do the following:
   * Wait for the guest to acknowledge the suspend request.
     - on timeout cancel the suspend request.
       - if cancellation is successful then return a new error code to
         indicate that the guest is not responding.
       - if the cancel does not succeed then we raced with the guest
         which actually did acknowledge at the last minute, so
         continue.
   * Wait for the guest to suspend.
     - on timeout return the standard error code as before
   * Guest successfully suspended, return success.

Lastly in xl do not attempt to resume a guest if it has not responded
to the suspend request.

Tested by live migration of PVops kernels which either ignore the
suspend request, have already crashed and those which suspend/resume
correctly. In the first two cases the source domain is left alone (and
continues to function in the first case) and in the third the
migration is successful.

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>
2011-02-11 17:57:32 +00:00
Ian Campbell 9d60f0d3de libxl: allow guest to write "control/shutdown" xenstore node.
The PV shutdown/reboot/suspend protocol requires that the guest
acknowledge a request by clearing the node therefore it is necessary
to allow the guest to write to the node.

Currently libxl is quite relaxed about this protocol and doesn't
reeally seem to mind that the guest is unable to write the node to
perform the acknowledgement. However in a followup patch libxl needs
to be able to detect that a guest has acknowledged a suspend request.

A side effect of this change is that an empty "control/shutdown" node
is created upon domain creation instead of only being created when a
shutdown/reboot/suspend is requested. This should not (and does not
in my tests) have any negative impact on the guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-11 17:56:24 +00:00
Stefano Stabellini 33c82cfa48 libxl: do not call libxl__file_reference_unmap twice
Fix double free due to libxl__file_reference_unmap(&info->kernel) called
multiple times: first at the end of libxl__domain_build and then in
libxl_domain_build_info_destroy.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-11 17:53:08 +00:00
Ian Jackson a14b0eb584 libxc: increase lzma max memory constant to 128Mby
According to lzma's configure.ac (!) the minimum memory limit to cope
with arbitrary input is 128Mby (!)

This is obviously an unreasonable amount of memory for this kind of
task, but we need to increase the constant limit for it not to
randomly fail.  So do so.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-11 17:49:13 +00:00
Tim Deegan f54e9ea9c4 x86/mm: fix typo in 22897:21df67ee7040
that caused the wrong page to be freed.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-11 16:51:44 +00:00
Keir Fraser 48f73c3dea Update Xen evrsion to 4.1.0-rc5-pre 2011-02-10 17:24:41 +00:00
Keir Fraser effe2763b8 Added signature for changeset 8df0c7f9cda6 2011-02-10 17:24:11 +00:00
Keir Fraser 9115622791 Added tag 4.1.0-rc4 for changeset 8df0c7f9cda6 2011-02-10 17:24:02 +00:00
Keir Fraser 4e0f60c5ad Update Xen version to 4.1.0-rc4 4.1.0-rc4 2011-02-10 17:23:57 +00:00
Keir Fraser 1accdcc8c3 x86: suppress HPET broadcast initialization in the presence of ARAT
This follows Linux commit 39fe05e58c5e448601ce46e6b03900d5bf31c4b0,
noticing that all this setup is pointless when ARAT support is there,
and knowing that on SLED11's native kernel it has actually caused S3
resume issues.

A question would be whether HPET legacy interrupts should be forced
off in this case (rather than leaving whatever came from firmware).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-02-10 14:19:54 +00:00
Keir Fraser 68ef426319 x86: tighten conditions under which writing certain MSRs is permitted
MSRs that control physical CPU aspects generally are pointless (and
possibly dangerous) to be written when the writer isn't sufficiently
aware that it's running virtualized.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-02-10 14:19:23 +00:00
Keir Fraser 8ad67c8e05 ix86: re-do permanent disabling of x2apic
Move logic into check_x2apic_preenabled() (to make sure
generic_apic_probe() doesn't see genapic already set).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-10 14:14:24 +00:00
Tim Deegan 1146a5b639 x86/mm: make log-dirty code do all its allocations outside the lock
to avoid taking the shadow/EPT lock with the lgd lock held.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-10 11:27:52 +00:00
Tim Deegan 17f709bb8d x86/mm: shuffle log-dirty code so only one path allocates memory
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-10 11:27:51 +00:00
Juergen Gross 32e7954462 Cpupools: vcpu affinity handling
If a vcpu is pinned to multiple physical cpus, the pinning is not
removed if all those physical cpus are removed from the cpupool. When
disabling the scheduler on a cpu, the affinity mask must be checked
against the cpumask of the cpupool.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-10 09:02:50 +00:00
Tim Deegan ebe3e6440c x86/mm/shadow: fix unlocking on error path in p2m allocator
One unlock path wasn't gated to match the lock.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-09 12:03:09 +00:00
Wei Gang aa479ce9d1 x86: reduce magic number usage in XSAVE code
Signed-off-by: Wei Gang <gang.wei@intel.com>
2011-02-09 08:58:11 +00:00
Wei Wang 76bb33a03e amd iommu: dynamic page table depth adjustment.
IO Page table growth is triggered by amd_iommu_map_page and grows to
upper level. I have tested it well for different devices (nic and gfx)
and different guests (linux and Win7) with different guest memory
sizes (512M, 1G, 4G and above).

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2011-02-09 08:57:12 +00:00
Ian Jackson 45c717772e docs: document vbd numbering and naming
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-09 08:54:37 +00:00
Keir Fraser 7fc001c2c2 cpupool: Fix __cpupool_find_by_id(), clean up accessor functions.
Firstly, __cpupool_find_by_id() would dereference NULL, at the end of
an exact search if the search loop exited with *q==NULL. Fix this.

Secondly, provide suitable accessor functions so that no caller needs
to use the __-prefixed versions which take a boolean flag.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-09 08:53:43 +00:00
Keir Fraser 657c5ca696 cpupool: Strict parameter checking for cpupool operations
Some cpupool actions didn't check the cpupool_id exactly. For some
actions this doesn't make any sense, so refuse those actions if the
specified cpupool doesn't exist.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-09 08:44:38 +00:00