Commit Graph
3127 Commits
Author SHA1 Message Date
Keir Fraser 8c5fdc54a7 xend: passthrough: also do_FLR when a device is assigned.
To workaround a race condition about guest hotplug, c/s
18338:7c10be016e4 disabled do_FLR when we create guest or 'xm
pci-attach' device into guest, so now we actually only do_FLR when a
guest is destroyed or 'xm pci-detach'.

By moving the FLR-related checking/do_FLR logic a little earlier, this
patch re-enables do_FLR in these 2 cases disabled by 18338.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2010-01-06 08:17:20 +00:00
Keir Fraser 9b0440ff26 xend: Pass -vcpu-avail option to QEMU now it is supported.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-05 08:36:54 +00:00
Keir Fraser f3c8a24596 xend: Allow disable QEMU monitor by settinbg option to 0 in config file.
Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2010-01-04 09:04:53 +00:00
Keir Fraser f0a326072f XendAPI: After VBD_destroy and VIF_destroy the managed config must be saved
...otherwise already deleted devices appear again in configuration
after a xend restart.

Signed-off-by: Lutz Dube <Lutz.Dube@ts.fujitsu.com>
2009-12-29 15:04:17 +00:00
Keir Fraser 3781952178 xend: Fix 'monitor' domain config parameter.
Introduce new 'monitor_path' parameter, so that 'monitor' can revert
to its old type and meaning.

Fixes domain reboot and save/restore.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-24 08:59:47 +00:00
Keir Fraser b4b0f9dcc4 xend: Extra qemu options: parallel,serial,monitor
Allows par/ser ports to be configured with a path to backing device.
Allows qemu monitor to be disabled or redirected.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2009-12-23 07:36:33 +00:00
Keir Fraser b8ae241fc9 Remove videoram option from vfb config.
This option is only valid in main config.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
2009-12-23 07:26:31 +00:00
Keir Fraser 70248054c9 Revert 20709:085627544270 2009-12-21 16:51:40 +00:00
Keir Fraser 9ffb378fde xend: Enable vHPET in HVM guests by default.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-21 10:50:28 +00:00
Keir Fraser 57ea955dd3 Adds 'memory_sharing' option to domain config scripts. It passes domain id to
the tapdisk2 process if sharing is enabled (tapdisk2 is not normally aware what
domain it is working for).

Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
2009-12-17 06:27:57 +00:00
Keir Fraser 37f8a59c7c Fix bug in c/s 20332 "Add commands to hotplug usb devices to hvm guests"
Signed-off-by: James Song Wei <jsong@novell.com>
2009-12-14 09:36:26 +00:00
Keir Fraser b8a087fb41 HVM vcpu add/remove: parse vcpu_avail to Qemu
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>

Disable qemu cmdline option until our qemu supports it.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:31:00 +00:00
Keir Fraser cf75018188 HVM vcpu add/remove: parse 'vcpu_avail' to firmware and set up madt
accordingly

-- currently firmware has got 'vcpus' from xend, this patch add parse
   'vcpu_avail' to firmware;
-- setup madt 'lapic' subitems of processors accoring to vcpus and
   vcpu_avail which finally come from config;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-12-14 09:25:47 +00:00
Keir Fraser a4a7c638f7 xend: fix empty 'cpus' parsing
/etc/xen/xmexample.hvm says "" means "leave to Xen to pick", but we
get a "Error: string index out of range" currently.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-14 07:59:12 +00:00
Keir Fraser 51dfdb01ad xend: fix a typo introduced by changeset 20621:f9392f6eda79
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-14 07:58:47 +00:00
Keir Fraser 30acac4606 Fix bug in c/s 20332 "Add commands to hotplug usb devices to hvm guests"
Signed-off-by: James Song Wei <jsong@novell.com>
2009-12-14 07:58:15 +00:00
Keir Fraser b501c6cfa8 tools: improve NUMA guest placement when ballooning
the "guest to a single NUMA node" constrain algorithm does not work
well when we do ballooning. Ballooning and NUMA don't play together
anyway, as Dom0 and thus ballooning is not NUMA aware, I am working on
this but it will not be ready for the Xen 4.0 release window.  The
usual ballooning situation will result in an empty candidate list, as
no node has enough free memory to host the guest. In this case the
code will simply pick the first node: again and again, because all
nodes without enough memory will be ultimately penalized with the same
maxint value (regardless of the actual load).  The attached patch will
change this to use a relative penalty in case of not-enough memory, so
that low-load low-memory nodes will be used at one point. A half
loaded node has shown to be a good value, as an unbalanced system is
much worse than non-local memory access for guests.  Regardless of
that you should restrict the Dom0 on a NUMA system to a reasonable
memory size, so that ballooning is not necessary most of the time. In
this case the guest's memory will be NUMA local.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-11 08:59:54 +00:00
Keir Fraser fc63162a09 PVUSB: xm/xend support
You can see the following slides to understand the usage.
http://www.xen.org/files/xensummit_intel09/PVUSBStatusUpdate.pdf
Limitations:
"xm usb-hc-create" accepts up to 16 ports, but, current usbfront
can work with up to 15 ports. This may be bug and I'm preparing
to fix it.

This xm/xend support requires linux-2.6.18-xen.hg c/s 939 or above.
I recommend latest tip.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
2009-12-11 08:52:17 +00:00
Keir Fraser 80b20a2fa0 tools: simplify PYTHON_PATH computation (and fixes for NetBSD)
Doesn't work when build-time python path differs from install-time. Do
we care about this given tools should be packaged/built for the
specific run-time distro?

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-12-09 10:58:52 +00:00
Keir Fraser ef86b9f18b xend: Add keymap to vfb config for existing hvm guests
I submitted a patch a while back to add keymap to vfb config for hvm
guests.  This patch works fine for new config (xm create|new) but not
existing, managed guests.  To cover the latter case I've introduced a
validator method in XendConfig.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-12-08 07:49:54 +00:00
Keir Fraser 78eed7d044 xend: Fix parameters to PyArg_ParseTupleAndKeywords()
The kwd_list parameter PyArg_ParseTupleAndKeywords() must be a
NULL-terminated list.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-12-04 07:00:25 +00:00
Keir Fraser f5772cd764 xend: Add GPL license stanza to MemoryPool.py
Signed-off-by: James Song (Wei) <jsong@novell.com>
2009-12-03 13:51:20 +00:00
Keir Fraser 0436d361aa Remus: fall back to xenstore if necessary
This is primarily for pvops until it gets a dedicated suspend
event channel.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:43 +00:00
Keir Fraser ba4d310958 Remus: fix shadow memory allocation, broken by 20558:4ed3b9b1de3f
This approach is perhaps a little cleaner than directly calling
balloon.free.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-12-03 13:50:14 +00:00
Keir Fraser fe356defec xend, vt-d: do not reserve vtd_mem if iommu is not enabled
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-12-02 13:43:37 +00:00
Keir Fraser e45215a3fe xend: Memory pool for pv guest on systems with >128G memory
The main idea of this patch is:

1) The admin sets aside some memory below 128G for 32-bit paravirtual
domain creation (via dom0_mem=-<value> in kernel comand line).

2) The admin also explicitly states to the tools (i..e xend) how much
memory is supposed to be left untouched by 64-bit domains

3) If a 32-bit pv DomU gets created, no ballooning ought to be
necessary (since if it is, no guarantee can be made about the address
range of the memory ballooned out), and memory gets allocated from the
reserved range.

4) Upon 64-bit (or 32-bit HVM or HVM) DomU creation, the tools
determine the amount of memory to be ballooned out of Dom0 by adding
the amount needed for the new guest and the amount still in the
reserved pool (and then of course subtracting the total amount of
memory the hypervisor has available for guest use).

Signed-off-by: james song (wei) <jsong@novell.com>
2009-12-02 08:51:12 +00:00
Keir Fraser 2cdc56dff4 xm: fix message in OptionError deprecated since Python 2.6
BaseException.message has been deprecated since Python 2.6.  To
prevent DeprecationWarning from popping up over this pre-existing
attribute, use a new property that takes lookup precedence.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-12-02 08:47:49 +00:00
Keir Fraser fc50aaf0d8 xentop: Add tmem-freeable info when tmem is active
(No change to xentop output when tmem is inactive.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-12-01 13:38:18 +00:00
Keir Fraser cfbf78694e tools: avoid cpu over-commitment if numa=on
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-12-01 13:35:28 +00:00
Keir Fraser c1fcbadd2c xend: fix bugs in c/s 20321:7a69f773548e "add a config description item for each guest"
Signed-off-by: james song (wei)<jsong@novell.com>
2009-11-30 10:57:42 +00:00
Keir Fraser ad86c7de55 xm: Allow detaching vif by MAC address
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-27 08:09:26 +00:00
Keir Fraser f0e8b55eb1 xm: Fix maxvcpus support
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-11-26 10:57:26 +00:00
Keir Fraser f9abceac96 xend: little fix for tap
Need get dev type after create tap device as device_create did.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>
2009-11-26 10:56:49 +00:00
Keir Fraser 68a94cf528 xm: Add maxvcpus support
this is patch to add maxvcpus support to xen xm command. It's using
vcpu_avail bitmask and sets the number of vcpus to maxvcpus if
present.  If it's not present, old behavior is preserved.

In domain config file you can define it as follows:

maxvcpus = 4
vcpus = 2

this automatically sets vcpus to 4 and corresponding bitmask to
present 2 vcpus in the guest with option to increase it up to 4
vcpus. If maxvcpus is not present, the old behavior for vcpus is
preserved, ie.  you can set vcpus to some number of vcpus to be used
and the vcpu_avail is set appropriately to use all of them. Only when
you use maxvcpus and vcpus new vcpu_avail value is calculated to show
PV guest the desired number of vcpus only.

It's been tested using RHEL-5 32-bit PV guest with maxvcpus = 4 and
vcpus = 2 and also the previous setup of vcpus = 2 only... In both
cases I was able to use 'xm vcpu-set {domainId} {numberOfVCPUs}' to
increase move vcpu count from 0 to maxvcpus/vcpus so it was working as
designed.

Signed-off-By: Michal Novotny<minovotn@redhat.com>
2009-11-25 14:11:02 +00:00
Keir Fraser 08a0b4ab0d Replace tsc_native config option with tsc_mode config option
(NOTE: pvrdtscp mode not finished yet, but all other
modes have been tested so sooner seemed better than
later to submit this fairly major patch so we can get
more mileage on it before next release.)

New tsc_mode config option supercedes tsc_native and
offers a more intelligent default and an additional
option for intelligent apps running on PV domains
("pvrdtscp").

For PV domains, default mode will determine if the initial
host has a "safe"** TSC (meaning it is always synchronized
across all physical CPUs).  If so, all domains will
execute all rdtsc instructions natively; if not,
all domains will emulate all rdtsc instructions but
providing the TSC hertz rate of the initial machine.
After being restored or live-migrated, all PV domains will
emulate all rdtsc instructions.  Hence, this default mode
guarantees correctness while providing native performance
in most conditions.

For PV domains, tsc_mode==1 will always emulate rdtsc
and tsc_mode==2 will never emulate rdtsc.  For tsc_mode==3,
rdtsc will never be emulated, but information is provided
through pvcpuid instructions and rdtscp instructions
so that an app can obtain "safe" pvclock-like TSC information
across save/restore and live migration. (Will be completed in
a follow-on patch.)

For HVM domains, the default mode and "always emulate"
mode do the same as tsc_native==0; the other two modes
do the same as tsc_native==1.  (HVM domains since 3.4
have implemented a tsc_mode=default-like functionality,
but also can preserve native TSC across save/restore
and live-migration IFF the initial and target machines
have a common TSC cycle rate.)

** All newer AMD machines, and Nehalem and future Intel
machines have "Invariant TSC"; many newer Intel machines
have "Constant TSC" and do not support deep-C sleep states;
these and all single-processor machines are "safe".

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-11-25 14:05:28 +00:00
Keir Fraser a9c7cc22db xend: pci: show error msg properly if pciback/pci-stub are not loaded
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-11-23 07:23:07 +00:00
Keir Fraser 0f761fab23 xend: Add support for XCP Windows PV drivers
This patch adds support for XCP Windows paravirtual drivers to run on
Xen. The drivers are currently provided in binary-only format from
Citrix. At a minimum, this patch is useful for performance comparisons
vs GPLPV drivers.

Live migration and save/resume are functional but set the guest clock
to the 1970's. The clock must be manually adjusted for the guest's ntp
to resume accurate timekeeping.

Before rebooting windows at the end of driver installation create the
registry key
HKLM\System\CurrentControlSet\Services\xenevtchn\Parameters. Add to it
a DWORD called SetFlags with a value of 0x10000000.

Signed-off-by: Keith Coleman <keith@scaltro.com>
2009-11-23 07:12:06 +00:00
Keir Fraser 998479ef8f Remus: remove Py_RETURN_NONE for Python 2.3
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:10:56 +00:00
Keir Fraser fa249f4edc Remus: fix a warning
This patch fixes the following warning:
  xen/lowlevel/checkpoint/libcheckpoint.c: In function
  `delete_suspend_timer':
  xen/lowlevel/checkpoint/libcheckpoint.c:352: warning: assignment
  makes integer from pointer without a cast

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2009-11-23 07:07:08 +00:00
Keir Fraser 1e4968503b xend: Remove tab indents
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-23 06:52:35 +00:00
Keir Fraser f60cd0f902 xend: Remove extraneous logging from pyxc_physinfo().
Also fixes 32-bit build.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 10:25:19 +00:00
Keir Fraser f481a3f9c3 xend: Balloon down memory to achive enough DMA32 memory for PV guests
with PCI pass-through to succesfully launch.

If the user hasn't used dom0_mem=3D bootup parameter, the privileged
domain usurps all of the memory. During launch of PV guests with PCI
pass-through we ratchet down the memory for the privileged domain to
the required memory for the PV guest. However, for PV guests with PCI
pass-through we do not take into account that the PV guest is going to
swap its SWIOTLB memory for DMA32 memory - in fact, swap 64MB of
it. This patch balloon's down the privileged domain so that there are
64MB of DMA32 memory available.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-14 08:09:50 +00:00
Keir Fraser 42b2352e01 xend: call xc_assign_device for all the devices to hotplug
this patch fixes a couple of issues with pci passthrough in xend,
previously reported by Cui Dexuan.
The main problem is that xc_assign_device is called only for the first
device hotplugged into the guest and not the followings.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-11-13 21:54:44 +00:00
Keir Fraser 04d6becec1 remus: Add missing python __init__.py file
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 21:09:33 +00:00
Keir Fraser 113d3d76a6 remus: Add missing unistd.h include from libcheckpoint.c
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-11-13 17:21:13 +00:00
Keir Fraser 1a38c03675 Remus: add python control extensions
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-13 15:33:37 +00:00
Keir Fraser f8a685ad57 A few trivial cleanups
Alphabetize object files and guest config options for better
readability. Also remove svm interrupt prototypes which do not
exist.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-11-12 11:42:02 +00:00
Keir Fraser a7cbf88f59 xend/xm: Add PSCSI_HBA class and DSCSI_HBA class to XenAPI
XenAPI (not xapi) has supported only LUN assignment mode for pvSCSI.
But at last, HOST assignment mode also is supported by these patches.
To support HOST assignment mode, these patches add PSCSI_HBA class
and DSCSI_HBA class to XenAPI.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-11-12 11:40:44 +00:00
Keir Fraser 85f5921bdf blktap2: add remus driver
Blktap2 port of remus disk driver. Backwards compatable with blktap1
implementation.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:45:06 +00:00
Keir Fraser 61e986758d Remus: Fixup for tap:tapdisk syntax in remus uname
Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2009-11-09 19:41:16 +00:00