]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/log
people/aperard/xen-unstable.git
15 years agohvmloader: pass-through: multi-function PCI hot-plug
Keir Fraser [Sat, 27 Jun 2009 08:53:19 +0000 (09:53 +0100)]
hvmloader: pass-through: multi-function PCI hot-plug

This registers information to allow guests to recognise non-zero
functions when hot-plugged.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: use devfn instead of slots as the unit for pass-through
Keir Fraser [Sat, 27 Jun 2009 08:51:37 +0000 (09:51 +0100)]
xend: pass-through: use devfn instead of slots as the unit for pass-through

Instead of suppling a slot number to qemu-xen, supply a devfn.

This and subsequent other changes will allow xend to ask
for more than one function to be inserted into a single slot -
by specifying which function of the slot should be used.

This is a minimal patch for this change. A subsequent
patch that has a lot of noise to rename slot to devfn
is intended to follow.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoUpdate QEMU_TAG for f2e0a24d00b2f0c591719bab088fbe3654955066
Keir Fraser [Thu, 25 Jun 2009 17:31:10 +0000 (18:31 +0100)]
Update QEMU_TAG for f2e0a24d00b2f0c591719bab088fbe3654955066

15 years agop2m hap: Fix dirty vram tracking function
Keir Fraser [Thu, 25 Jun 2009 17:28:59 +0000 (18:28 +0100)]
p2m hap: Fix dirty vram tracking function

This patch fixes an incorrect mode conversion when disable vram
dirty tracking.

Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
15 years agominios: add few missing constants in limits.h
Keir Fraser [Thu, 25 Jun 2009 13:30:00 +0000 (14:30 +0100)]
minios: add few missing constants in limits.h

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agox86 hvm: Make sure port 0x80 in hvm_io_table[] is set correctly
Keir Fraser [Thu, 25 Jun 2009 12:51:40 +0000 (13:51 +0100)]
x86 hvm: Make sure port 0x80 in hvm_io_table[] is set correctly
regardless of execution order of hvm_enable() and check_port80().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools: fix inverted logic check
Keir Fraser [Thu, 25 Jun 2009 12:15:32 +0000 (13:15 +0100)]
tools: fix inverted logic check

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agostubdom: use XENFIRMWAREDIR
Keir Fraser [Thu, 25 Jun 2009 12:14:37 +0000 (13:14 +0100)]
stubdom: use XENFIRMWAREDIR

Attached patch installs ioemu-stubdom into XENFIRMWAREDIR
analogous to what we do with hvmloader.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoxend: create /var/lock/subsys at startup
Keir Fraser [Thu, 25 Jun 2009 12:14:03 +0000 (13:14 +0100)]
xend: create /var/lock/subsys at startup

Ubuntu puts /var/lock on tmpfs, so we should create /var/lock at
startup, rather than at installation time.

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
15 years agox86 hvm: Fix printf format specifier
Keir Fraser [Thu, 25 Jun 2009 12:12:32 +0000 (13:12 +0100)]
x86 hvm: Fix printf format specifier

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
15 years agoVT-d: remove debug prints and turn on qinval read/write drains
Keir Fraser [Thu, 25 Jun 2009 12:06:44 +0000 (13:06 +0100)]
VT-d: remove debug prints and turn on qinval read/write drains

This cleanup patch removes debug prints and turn on read and write
drains for VT-d queue invalidation if HW supports them.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
15 years agotools: add SHAREDIR to buildmakevars2file
Keir Fraser [Thu, 25 Jun 2009 12:05:10 +0000 (13:05 +0100)]
tools: add SHAREDIR to buildmakevars2file

c/s 19818 dropped SHAREDIR from xen/util/path.py, which broke the "xm
new" command. This patch adds SHAREDIR back to the new
buildmakevars2file-closure function.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
15 years agoFix buildsystem to detect udev > version 124
Keir Fraser [Thu, 25 Jun 2009 12:02:37 +0000 (13:02 +0100)]
Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
15 years agotools: fix x11 check
Keir Fraser [Thu, 25 Jun 2009 11:59:46 +0000 (12:59 +0100)]
tools: fix x11 check

X.org is installed in /usr/X11R7.
Attached patch covers this in the x11 check.
Xen has no direct X11 dependency
(it's inherited from SDL and SDL is optional for qemu-dm)
so warn but don't fail if no X11 is installed.
Fixes build problem on distributions which build their packages (*BSD
and Gentoo).

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoblktap2: A final few NetBSD fixes
Keir Fraser [Wed, 24 Jun 2009 14:24:53 +0000 (15:24 +0100)]
blktap2: A final few NetBSD fixes

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoblktap2: Further netbsd build fixes.
Keir Fraser [Wed, 24 Jun 2009 13:03:20 +0000 (14:03 +0100)]
blktap2: Further netbsd build fixes.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools: remove hard coded paths in example config files
Keir Fraser [Wed, 24 Jun 2009 10:17:11 +0000 (11:17 +0100)]
tools: remove hard coded paths in example config files

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoblktap2: Fix a & vs && typo
Keir Fraser [Wed, 24 Jun 2009 10:16:42 +0000 (11:16 +0100)]
blktap2: Fix a & vs && typo

Signed-off-by: Jun Koi <junkoi2004@gmail.com>
15 years agox86 mca: Fix typo of MCA recovery flags
Keir Fraser [Wed, 24 Jun 2009 10:16:08 +0000 (11:16 +0100)]
x86 mca: Fix typo of MCA recovery flags

The following patch fixes typo of MCA recovery flags.
It should be '<<' instead of '<'.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
15 years agoVT-d: don't disable VT-d engine in suspend for security purpose
Keir Fraser [Wed, 24 Jun 2009 10:15:31 +0000 (11:15 +0100)]
VT-d: don't disable VT-d engine in suspend for security purpose

force_iommu option is used to force enabling and using IOMMU for
security purpose. So when force_iommu is set, it shouldn't disable
VT-d engines in suspend.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoxend: Fix vbd/tapdisk device destruction
Keir Fraser [Wed, 24 Jun 2009 10:14:32 +0000 (11:14 +0100)]
xend: Fix vbd/tapdisk device destruction

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agoblktap2: Fix some printf format specifiers (PRIu64).
Keir Fraser [Wed, 24 Jun 2009 10:11:58 +0000 (11:11 +0100)]
blktap2: Fix some printf format specifiers (PRIu64).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoScaling guest's TSC when the target machine's frequency is different
Keir Fraser [Wed, 24 Jun 2009 10:05:22 +0000 (11:05 +0100)]
Scaling guest's TSC when the target machine's frequency is different
with its requirement.

Using trap&emulate for guest's each rdtsc instruction first, maybe it
can be optimized later.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
15 years agoMove muldiv64 out and make it as a public function.
Keir Fraser [Wed, 24 Jun 2009 09:57:00 +0000 (10:57 +0100)]
Move muldiv64 out and make it as a public function.

muldiv64 is used to caculate u64*u32/u32, and we
will use it for TSC scaling.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agosave/restore : Save guest's preferred TSC frequency in image
Keir Fraser [Wed, 24 Jun 2009 09:48:21 +0000 (10:48 +0100)]
save/restore : Save guest's preferred TSC frequency in image

For save/restore or live migration between two different frequency
platforms, guest's preferred TSC frequency is required to caculate
guest's TSC after resotre, so save it in the image header.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
15 years agox86 shadow: Fix a few SHOPT_OUT_OF_SYNC ifdefs.
Keir Fraser [Wed, 24 Jun 2009 09:47:07 +0000 (10:47 +0100)]
x86 shadow: Fix a few SHOPT_OUT_OF_SYNC ifdefs.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoUpdate hgignore file
Keir Fraser [Tue, 23 Jun 2009 16:32:07 +0000 (17:32 +0100)]
Update hgignore file

15 years agoxend: Fix python syntax error
Keir Fraser [Tue, 23 Jun 2009 16:27:01 +0000 (17:27 +0100)]
xend: Fix python syntax error

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agotools python: remove unused auxbin functions
Keir Fraser [Tue, 23 Jun 2009 16:26:28 +0000 (17:26 +0100)]
tools python: remove unused auxbin functions

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoGet rid of hardcoded pathes for stubdom and hotplug scripts
Keir Fraser [Tue, 23 Jun 2009 16:25:51 +0000 (17:25 +0100)]
Get rid of hardcoded pathes for stubdom and hotplug scripts

- Have the buid system generate a file which exports the install paths
   for the hotplug scripts and stubdom / stubdom-dm
- Move file generation code from tools/python/Makefile into a gmake
   macro
  in Config.mk to avoid maintenance of three duplicates each with its
   own
  tweaks and bugs
- Export gmake variables into ioemu as shell variables
  for upcoming ioemu patches
- Do above as a gmake macro to avoid maintenance of several duplicates
- Adjust hotplug scripts to find the right xen binaries from the
  install directory
- Adjust stubdom-dm to use the install directories

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoblktap2: portability fixes for NetBSD
Keir Fraser [Tue, 23 Jun 2009 16:24:14 +0000 (17:24 +0100)]
blktap2: portability fixes for NetBSD

- Use standard off_t and lseek() instead of non-portable off64_t and
  lseek64()
- Use uuid API as documented in DCE 1.1 RPC specification
- Add NetBSD implementation for blk_getimagesize() and
  blk_getsectorsize()
- Use blk_getimagesize() and blk_getsectorsize()
- Fix uuid header check

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxenconsoled: fix timestamp log
Keir Fraser [Tue, 23 Jun 2009 10:27:54 +0000 (11:27 +0100)]
xenconsoled: fix timestamp log

timestamp log is broken.
Also, xenconsoled might die with segfault.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agoVT-d: correct kill hvm_timer
Keir Fraser [Tue, 23 Jun 2009 10:26:22 +0000 (11:26 +0100)]
VT-d: correct kill hvm_timer

hvm_timer is created with the vector got from domain_irq_to_vector(),
accordingly it should use the same vector to kill the timer. The patch
corrects it in pci_clean_dpci_irqs().

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoxenconsoled: Fix rate-limit calculation overflow leading to console freezes.
Keir Fraser [Tue, 23 Jun 2009 10:25:38 +0000 (11:25 +0100)]
xenconsoled: Fix rate-limit calculation overflow leading to console freezes.

From: Eric Tessler <eric@3tera.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agotools: don't require hardcoded firmware path in guest config file
Keir Fraser [Tue, 23 Jun 2009 10:23:27 +0000 (11:23 +0100)]
tools: don't require hardcoded firmware path in guest config file

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
15 years agoFix network-bridge ifup problem when bridge has no IP address.
Keir Fraser [Tue, 23 Jun 2009 10:22:08 +0000 (11:22 +0100)]
Fix network-bridge ifup problem when bridge has no IP address.

When we want to setup a bridge without a ip address, function
do_ifup will not activate the bridge.

We should make the bridge active, then vif-bridge can work on the
bridge.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
15 years agoxend: Fix tapdisk creation for managed domains
Keir Fraser [Tue, 23 Jun 2009 10:20:10 +0000 (11:20 +0100)]
xend: Fix tapdisk creation for managed domains

The first start of a managed domain succeeds.  But the second
start of the managed domain fails as follows.  The problem occurs
when tapdisks are given to the managed domain.  I think that the
problem occurs because the uname of tapdisks is overwritten with
"phy:/dev/xen/tadisk-2/tapdev*".

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agovtd: IO NUMA support
Keir Fraser [Tue, 23 Jun 2009 10:14:24 +0000 (11:14 +0100)]
vtd: IO NUMA support

This patch adds VT-d RHSA processing for IO NUMA support.  The basic
idea is to parse ACPI RHSA structure to obtain VT-d HW to proximity
domain mapping.  This mapping is then used when allocating pages for
Vt-d HW data structures.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
15 years agotools: consistently use $(PYTHON)
Keir Fraser [Tue, 23 Jun 2009 10:13:29 +0000 (11:13 +0100)]
tools: consistently use $(PYTHON)

Signed-off-by: Christoph Egger <Christoph. Egger@amd.com>
15 years agox86: Another assign_irq_vector() cleanup.
Keir Fraser [Tue, 23 Jun 2009 10:11:46 +0000 (11:11 +0100)]
x86: Another assign_irq_vector() cleanup.

Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
15 years agoOnly allow DOMCTL_max_vcpus to increase vcpus from zero.
Keir Fraser [Tue, 23 Jun 2009 10:10:29 +0000 (11:10 +0100)]
Only allow DOMCTL_max_vcpus to increase vcpus from zero.

Otherwise reallocation of the vcpus array is unsafe.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoVT-d: fix MSI source-id of interrupt remapping
Keir Fraser [Fri, 19 Jun 2009 07:45:55 +0000 (08:45 +0100)]
VT-d: fix MSI source-id of interrupt remapping

This patch fixes an issue of MSI source-id. Currently MSI source-ids
are all set device bdf. It's incorrect for PCI (not PCIe) devices. The
patch set correct requester-ids of MSI to source-id. And also, wrap
functions to clean ioapic source-id.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoVT-d: pci code cleanup
Keir Fraser [Fri, 19 Jun 2009 07:45:20 +0000 (08:45 +0100)]
VT-d: pci code cleanup

This patch moves the pci code from iommu.c to pci.c. Instead of setup
pci hierarchy in array bus2bridge in iommu_context_mapping, use
scan_pci_devices once to add all existed PCI devices in system to
alldevs_list and setup pci hierarchy in array bus2bridge. In addition,
implement find_upstream_bridge to find the upstream PCIe-to-PCI/PCIX
bridge or PCI legacy bridge for a PCI device, therefore it's cleanly
to handle context map/unmap for PCI device, even for source-id
setting.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoxend: fix a regression in c/s 19791.
Keir Fraser [Fri, 19 Jun 2009 07:44:33 +0000 (08:44 +0100)]
xend: fix a regression in c/s 19791.

Using changeset 19791:c0d2838fc10f, I can't create an HVM.
xend.log shows:

  File "usr/lib64/python2.4/site-packages/xen/xend/image.py", line
  759, in configure
    store_dmargs.remove('-sdl')
ValueError: list.remove(x): x not in list

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agox86: Fix legacy irq allocation issue
Keir Fraser [Fri, 19 Jun 2009 07:43:58 +0000 (08:43 +0100)]
x86: Fix legacy irq allocation issue

When try to assign vector for irq, we should not assign vector for
legacy irq, which has fixed mapped irq<->vector relationship.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
15 years agoxend: fix BlktapController's device creation
Keir Fraser [Fri, 19 Jun 2009 07:43:28 +0000 (08:43 +0100)]
xend: fix BlktapController's device creation

Reset BlktapController's device class back to 'tap' once the device
has been created. This fixes save/restore for VMs with blktap2 disks.

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
15 years agoP2M: check whether hap mode is enabled before using 2mb pages
Keir Fraser [Fri, 19 Jun 2009 07:42:58 +0000 (08:42 +0100)]
P2M: check whether hap mode is enabled before using 2mb pages

This small patch checks whether hap mode is enabled when guest is
trying to allocate 2MB pages inside P2M. This prevents potential
errors when hap is disabled.

Cc: Chris Lalancette <clalance@redhat.com>
Cc: Sarathy, Bhavna <Bhavna.Sarathy@amd.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
15 years agoIOMMU: Add two generic functions to vendor neutral interface
Keir Fraser [Fri, 19 Jun 2009 07:41:50 +0000 (08:41 +0100)]
IOMMU: Add two generic functions to vendor neutral interface

Add 2 generic functions into the vendor neutral iommu interface, The
reason is that from changeset 19732, there is only one global flag
"iommu_enabled" that controls iommu enablement for both vtd and amd
systems, so we need different code paths for vtd and amd iommu systems
if this flag has been turned on. Also, the early checking of
"iommu_enabled" in iommu_setup() is removed to prevent iommu
functionalities from been disabled on amd systems.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
15 years agobuildconfigs/src.git-clone: use git clone, avoid git remote
Keir Fraser [Thu, 18 Jun 2009 14:32:48 +0000 (15:32 +0100)]
buildconfigs/src.git-clone: use git clone, avoid git remote

git 1.4.x (which is on even some moderately recent systems) doesn't
have the `git remote' command.  This is what caused the most recent
patchman build failure.

The machinery in buildconfigs/src.git-clone was rather more
complicated than needed, too.  In this patch I replace this with a
similar set of runes to those used for ioemu-remote (almost identical
except that the QEMU_TAG feature is not supported in this instance).

I have done a successful test build with this change.

Cc: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
15 years agox86 hvm: Fix bootstrapped boolean check in start_{svm,vmx}().
Keir Fraser [Thu, 18 Jun 2009 09:46:21 +0000 (10:46 +0100)]
x86 hvm: Fix bootstrapped boolean check in start_{svm,vmx}().

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86-64: do not pass unmanageable amounts of memory to Dom0
Keir Fraser [Thu, 18 Jun 2009 09:31:17 +0000 (10:31 +0100)]
x86-64: do not pass unmanageable amounts of memory to Dom0

Due to address space restrictions it is not possible to successfully
pass more than about 500Gb to a Linux Dom0 unless its kernel specifies
a non-default phys-to-machine map location via XEN_ELFNOTE_INIT_P2M.

For non-Linux Dom0 kernels I can't say whether the limit could be set
to close to 1Tb, but since passing such huge amounts of memory isn't
very useful anyway (and can be enforced via dom0_mem=3D), the patch
doesn't attempt to guess the kernel type and restricts the memory
amount in all cases.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoIntroduce page_list_move()
Keir Fraser [Thu, 18 Jun 2009 09:30:28 +0000 (10:30 +0100)]
Introduce page_list_move()

This not only allows to remove ia64's special implementation of
page_list_splice_init(), but also fixes the latent issue with the
direct list head assignment in the x86 code if that would ever get
switched back to using normal list entries for linking together pages
(i.e. whenever x86-64 is to support more tha 16Tb of memory).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoblktap: re-enable blktap1 if blktap2 is disabled
Keir Fraser [Thu, 18 Jun 2009 09:29:58 +0000 (10:29 +0100)]
blktap: re-enable blktap1 if blktap2 is disabled

This patch re-enables a useful blktap1 for users who disable blktap2.
Itremoves tapdisk and blktapctrl from blktap2, both of which cause
problems with blktap operation.  In addition, this patch modifies xend
to check for blktap2 installation.  If the blktap2 driver isn't
running (hopefully because the dom0 kernel option wasn't selected) we
fall back to blktap.

Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
15 years agoxend: Improve error messages of xm sched-credit
Keir Fraser [Thu, 18 Jun 2009 09:27:21 +0000 (10:27 +0100)]
xend: Improve error messages of xm sched-credit

This patch improves error messages of xm sched-credit as with error
messages of CS:19468.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
15 years agoxendomains script: Small fix
Keir Fraser [Thu, 18 Jun 2009 09:26:28 +0000 (10:26 +0100)]
xendomains script: Small fix

From: Fabian Zimmermann <xen-users@z-technologies.de>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoAllow tools to see the hypervisor command line.
Keir Fraser [Thu, 18 Jun 2009 09:20:45 +0000 (10:20 +0100)]
Allow tools to see the hypervisor command line.

This is useful from tools in the same way /proc/cmdline is useful for
the domain 0 kernel.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
15 years agostubdoms: qemu monitor support
Keir Fraser [Thu, 18 Jun 2009 09:20:17 +0000 (10:20 +0100)]
stubdoms: qemu monitor support

Add support for the qemu monitor in a stubdom, the same way the
emulated serial support was added few days ago.  The stubdom exports
the monitor as a pty and minios opens a console frontend; qemu in dom0
provides the correspondent backend for this additional pv console that
happens to be the qemu monitor.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agominios: Use posix_openpt() rather than non-standard openpty().
Keir Fraser [Thu, 18 Jun 2009 09:19:25 +0000 (10:19 +0100)]
minios: Use posix_openpt() rather than non-standard openpty().

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoxend: pci: find_parent: should return string rather than int
Keir Fraser [Thu, 18 Jun 2009 09:18:10 +0000 (10:18 +0100)]
xend: pci: find_parent: should return string rather than int

Using changeset 19783: 61ec78692b13, device assignment can't work:
e.g., in find_the_uppermost_pci_bridge(),
 parent = dev_parent.find_parent()
...
 dev_parent = PciDevice(parent),
we can see parent['domain'] is int and in PciDevice's __init__,
int(dev['domain'], 16) would fail:
TypeError: int() can't convert non-string with explicit base

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
15 years agox86_64: allow more vCPU-s per guest
Keir Fraser [Thu, 18 Jun 2009 09:14:16 +0000 (10:14 +0100)]
x86_64: allow more vCPU-s per guest

Since the shared info layout is fixed, guests are required to use
VCPUOP_register_vcpu_info prior to booting any vCPU beyond the
traditional limit of 32.

MAX_VIRT_CPUS, being an implemetation detail of the hypervisor, is no
longer being exposed in the public headers.

The tools changes are clearly incomplete (and done only so things
would
build again), and the current state of the tools (using scalar
variables all over the place to represent vCPU bitmaps) very likely
doesn't permit booting DomU-s with more than the traditional number of
vCPU-s. Testing of the extended functionality was done with Dom0 (96
vCPU-s, as well as 128 vCPU-s out of which the kernel elected - by way
of a simple kernel side patch - to use only some, resulting in a
sparse
bitmap).

ia64 changes only to make things build, and build-tested only (and the
tools part only as far as the build would go without encountering
unrelated problems in the blktap code).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86_64: don't allocate L1 per-domain page table pages in a single chunk
Keir Fraser [Thu, 18 Jun 2009 09:05:23 +0000 (10:05 +0100)]
x86_64: don't allocate L1 per-domain page table pages in a single chunk

Instead, allocate them on demand, and adjust the consumer to no longer
assume the allocated space is contiguous.

This another prerequisite to extend to number of vCPU-s the hypervisor
can support per guest.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: properly handle vcpu-to-pcpu mask conversion
Keir Fraser [Thu, 18 Jun 2009 09:04:57 +0000 (10:04 +0100)]
x86: properly handle vcpu-to-pcpu mask conversion

This is one of the prerequisites to extend to number of vCPU-s the
hypervisor can support per guest.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoRemove bogus checked in file headers.chk, remove it on make clean, and
Keir Fraser [Thu, 18 Jun 2009 08:56:28 +0000 (09:56 +0100)]
Remove bogus checked in file headers.chk, remove it on make clean, and
add it to .hgignore file.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agox86 svm: Clean up and fix start_svm() to avoid memory leaks and
Keir Fraser [Thu, 18 Jun 2009 08:47:49 +0000 (09:47 +0100)]
x86 svm: Clean up and fix start_svm() to avoid memory leaks and
resetting ASID generations.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
15 years agoxend: pass-through: Clean up hvm_destroyPCIDevice()
Keir Fraser [Wed, 17 Jun 2009 06:39:27 +0000 (07:39 +0100)]
xend: pass-through: Clean up hvm_destroyPCIDevice()

There seems to be little need to use the domain, bus, slot and
function to look up the virtual slot to pass as the argument to
hvm_destroyPCIDevice(), only to have hvm_destroyPCIDevice() use the
virtual slot for the sole purpose of looking up the domain, bus, slot
and function.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Use common parsing code in getDeviceConfiguration()
Keir Fraser [Wed, 17 Jun 2009 06:39:03 +0000 (07:39 +0100)]
xend: pass-through: Use common parsing code in getDeviceConfiguration()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Use common parsing code in parse_pci_configuration()
Keir Fraser [Wed, 17 Jun 2009 06:38:42 +0000 (07:38 +0100)]
xend: pass-through: Use common parsing code in parse_pci_configuration()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Add pci_tuple_to_dict()
Keir Fraser [Wed, 17 Jun 2009 06:38:03 +0000 (07:38 +0100)]
xend: pass-through: Add pci_tuple_to_dict()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Use generic code in pci_opts_list_to_sxp()
Keir Fraser [Wed, 17 Jun 2009 06:37:26 +0000 (07:37 +0100)]
xend: pass-through: Use generic code in pci_opts_list_to_sxp()

Use dev_dict_to_sxp() inside pci_opts_list_to_sxp() now that it is
available.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Move pci conversion functions to pci.py
Keir Fraser [Wed, 17 Jun 2009 06:36:47 +0000 (07:36 +0100)]
xend: pass-through: Move pci conversion functions to pci.py

Move dev_dict_to_sxp() into XendSXPDev.py.  Move
pci_convert_dict_to_sxp() and pci_convert_sxp_to_dict() to pci.py,
where other similar functions live.  This makes these functions
accessible outside of the XendConfig class.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoSubject: xend: pass-through: Add pci_dict_cmp()
Keir Fraser [Wed, 17 Jun 2009 06:35:51 +0000 (07:35 +0100)]
Subject: xend: pass-through: Add pci_dict_cmp()

pci_dict_cmp() compares the two pci devices in dict format.

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Common parse_pci_name()
Keir Fraser [Wed, 17 Jun 2009 06:34:59 +0000 (07:34 +0100)]
xend: pass-through: Common parse_pci_name()

Share some parsing code between different parts of xm.

This has the side-effect that the device specification for
hot-plug may now include the VSLOT and OPTS as per device
specifictions in the domain configuration file.

  SEQ:BUS:DEV.FUNC[,OPT...]

  e.g. 0000:00:01.00@6

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agostubdom: update config example to reflect that the serial option can
Keir Fraser [Wed, 17 Jun 2009 06:23:40 +0000 (07:23 +0100)]
stubdom: update config example to reflect that the serial option can
now be used.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoxenconsole: fix assumption about printed max domid length.
Keir Fraser [Wed, 17 Jun 2009 06:23:06 +0000 (07:23 +0100)]
xenconsole: fix assumption about printed max domid length.
Also snprintf includes the final '\0' in the char count.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agominios: support secondary guest consoles.
Keir Fraser [Wed, 17 Jun 2009 06:22:18 +0000 (07:22 +0100)]
minios: support secondary guest consoles.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoIntroduce mechanism to check standard conformance of headers
Keir Fraser [Wed, 17 Jun 2009 06:21:03 +0000 (07:21 +0100)]
Introduce mechanism to check standard conformance of headers

While pretty simplistic, it appears to serve the purpose at the moment
(i.e. it spotted two places where a GNU extension was used withou
proper preprocessor conditionals). The "simplistic" here includes that
the checking gets only done for native builds, and ia64 gets excluded
due to its arch-specific header intentionally (for whatever reason)
checking that anonymous struct/unions can be used.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agotmem: fix 32-on-64 support
Keir Fraser [Wed, 17 Jun 2009 06:14:02 +0000 (07:14 +0100)]
tmem: fix 32-on-64 support

This implicitly required coverting the tmem_op structure from
anonymous to standard struct/union sub-fields, and extending the
get-fields.sh helper script to deal with typedef-ed guest handles used
as types of translated compound type fields.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86: fix s3 resume on AMD CPUs
Keir Fraser [Tue, 16 Jun 2009 13:19:34 +0000 (14:19 +0100)]
x86: fix s3 resume on AMD CPUs

Avoid longjmp as it has different semantics than on Intel CPUs in long
mode. Also add a few comments and remove a pointless reload of DS.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
15 years agox86: Allow guests to allocate up to 2MB (superpage) memory extents.
Keir Fraser [Tue, 16 Jun 2009 13:04:15 +0000 (14:04 +0100)]
x86: Allow guests to allocate up to 2MB (superpage) memory extents.

Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
15 years agox86: improve output resulting from sending '0' over serial
Keir Fraser [Tue, 16 Jun 2009 12:57:18 +0000 (13:57 +0100)]
x86: improve output resulting from sending '0' over serial

While the original logic already implied that the kernel part of the
guest's address space is identical on all vCPU-s (i.e. for all guest
processes), it didn't fully leverage the potential here: As long as
the top page table currently active is owned by the subject domain
(currently only Dom0), the stack dump can be done without extra
effort.

For x86-64, additionally add page table traversal so that the stack
can be dumped in all cases (unless it's invalid or user space).

I left the 32-bit variant of do_page_walk() unimplemented for the
moment as I couldn't convince myself using map_domain_page() there is
a good idea, and didn't want to introduce new fixmap entries either.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agox86/hvm: don't pass through port 0x80 in a few special cases
Keir Fraser [Tue, 16 Jun 2009 12:52:13 +0000 (13:52 +0100)]
x86/hvm: don't pass through port 0x80 in a few special cases

In a recent commit (99f85a28a78e96d28907fe036e1671a218fee597), KVM
disabled the passthrough of this port due to known problems on certain
HP laptops (see
http://lkml.indiana.edu/hypermail/linux/kernel/0712.3/0872.html
and http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/2388.html).

For Xen, don't do this globally, but rather based on a DMI black list.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agovtd: ats and queued invalidation cleanup
Keir Fraser [Tue, 16 Jun 2009 12:41:17 +0000 (13:41 +0100)]
vtd: ats and queued invalidation cleanup

Use iommu_qinval in place of qinval_enabled flag.  Use
ecap_queued_inval() for determining whether queued invalidation is
available on this vt-d engine or not.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
15 years agox86, hvm: set vcpu->is_initialised after restore/migration
Keir Fraser [Tue, 16 Jun 2009 12:39:00 +0000 (13:39 +0100)]
x86, hvm: set vcpu->is_initialised after restore/migration

After restore/migration, the xenctx command for auxiliary vcpus
fails with a message "xc_vcpu_getcontext: No data available".

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agox86, hvm: fix a domain_lock leak
Keir Fraser [Tue, 16 Jun 2009 12:33:12 +0000 (13:33 +0100)]
x86, hvm: fix a domain_lock leak
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
15 years agoxend: support for older pciutils without -vmm option, and improve
Keir Fraser [Tue, 16 Jun 2009 10:53:47 +0000 (11:53 +0100)]
xend: support for older pciutils without -vmm option, and improve
error handling in get_info_from_lspci().

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
15 years agotmem: cleanups
Keir Fraser [Tue, 16 Jun 2009 10:47:09 +0000 (11:47 +0100)]
tmem: cleanups

- don't mis-use guest handle for passing an MFN value
- eliminate unnecessary (and misplaced) use of XEN_GUEST_HANDLE_64
- use copy_from_guest() instead of __copy_from_guest() for loading the
  argument structure

Signed-off-by: Jan Beulich <jbeulich@novell.com>
15 years agoxend: pass-through: Use common parsing code in preprocess_pci()
Keir Fraser [Tue, 16 Jun 2009 10:41:31 +0000 (11:41 +0100)]
xend: pass-through: Use common parsing code in preprocess_pci()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Use PCIDevice as the parameter for the constructor for PCIQuirk
Keir Fraser [Tue, 16 Jun 2009 10:39:02 +0000 (11:39 +0100)]
xend: pass-through: Use PCIDevice as the parameter for the constructor for PCIQuirk

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Remove PciDeviceNotFoundError, it is never used
Keir Fraser [Tue, 16 Jun 2009 10:38:33 +0000 (11:38 +0100)]
xend: pass-through: Remove PciDeviceNotFoundError, it is never used

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: sxp.merge() cant deal with values being a list
Keir Fraser [Tue, 16 Jun 2009 10:37:41 +0000 (11:37 +0100)]
xend: pass-through: sxp.merge() cant deal with values being a list

sxp.merge() can't deal with values being a list so instead
of storing pci options as:

[ 'opts', [ 'key1' 'value1'], [ 'key2', 'value2'], ...]

store them as:

[ 'opts', [ 'key1' 'value1'], ['opts', [ 'key2', 'value2']], ...

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: cleanupDevice: move and remove recently added vslot entry
Keir Fraser [Tue, 16 Jun 2009 10:36:40 +0000 (11:36 +0100)]
xend: pass-through: cleanupDevice: move and remove recently added vslot entry

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: tidy up PciController()
Keir Fraser [Tue, 16 Jun 2009 10:36:03 +0000 (11:36 +0100)]
xend: pass-through: tidy up PciController()

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: fix typo: spx -> sxp
Keir Fraser [Tue, 16 Jun 2009 10:35:16 +0000 (11:35 +0100)]
xend: pass-through: fix typo: spx -> sxp

Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agoxend: pass-through: Only call setupOneDevice() once per device
Keir Fraser [Tue, 16 Jun 2009 10:33:23 +0000 (11:33 +0100)]
xend: pass-through: Only call setupOneDevice() once per device

As observed by Dexuan Cui, when PCI devices are passed through at
domain-creation-time setupOneDevice() will be called twice.

Once via setupDevice() and once via econfigureDevice() which
is called in pci_device_configure().

This patch removes the first of these.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
15 years agovtd: Clean up lock for VT-d register writes
Keir Fraser [Tue, 16 Jun 2009 10:31:20 +0000 (11:31 +0100)]
vtd: Clean up lock for VT-d register writes

It should get lock to write VT-d registers. Currently there are some
register writes without lock. This patch complements register_lock for
those writes.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agovtd: Fix flush for SRTP and SIRTP set
Keir Fraser [Tue, 16 Jun 2009 10:30:45 +0000 (11:30 +0100)]
vtd: Fix flush for SRTP and SIRTP set

SRTP (Set Root Table Pointer) operation must be set before enable or
re-enable DMA remapping. And after set it, software must globally
invalidate the context-cache and then globally invalidate the
IOTLB. This is required to ensure hardware uses only the remapping
structures referenced by the new root-table pointer, and not stale
cached entries. Similarly, SIRTP (Set Interrupt Remap Table Pointer)
operation must be set before enable or re-enable Interrupt
remapping, and after set it, software must globally invalidate the
interrupt entry cache. This patch adds global context and iotlb
flush after set root entry, and globally flushs interrupt entry
cache before enabling Interrupt remapping. And remove the
iommu_flush_all in iommu_resume becuase it becomes redundant after
adds flush for SRTP in init_vtd_hw.

Signed-off-by: Weidong Han <weidong.han@intel.com>
15 years agoxend: support multiple consoles per domain
Keir Fraser [Tue, 16 Jun 2009 10:25:37 +0000 (11:25 +0100)]
xend: support multiple consoles per domain

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agoxenconsole: support for multiple consoles per domain
Keir Fraser [Tue, 16 Jun 2009 10:24:58 +0000 (11:24 +0100)]
xenconsole: support for multiple consoles per domain

This patch adds a new command line argument to xenconsole to specify
to which console to connect to in case a domain has more than one.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
15 years agotmem: fix minor accounting error
Keir Fraser [Tue, 16 Jun 2009 10:18:32 +0000 (11:18 +0100)]
tmem: fix minor accounting error

Reset a counter when all tmem pages are released.  This
only affects status reporting (as displayed by xm tmem-list
or the just patched xenballoon-monitor) but the incorrectly
reported result is misleading.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
15 years agotools/xenballoond: add tmem capability to directed/self-ballooning
Keir Fraser [Tue, 16 Jun 2009 10:17:28 +0000 (11:17 +0100)]
tools/xenballoond: add tmem capability to directed/self-ballooning
and monitor tool

This patch adds tmem support to the largely unknown/unused
xenballoond scripts that implement both self-ballooning and
a foundation for directed-ballooning.  Tmem and automated
ballooning are highly complementary in that, when ballooning
is over-aggressive, paging and swapping can increase noticably.
Precache preserves evicted pages that may be needed again soon
(thus eliminating disk reads) and preswap provides memory-based
swapping that occurs if ballooning is insufficiently responsive
to a sudden increase in activity and memory demand (thus
eliminating disk writes and reads).

There are two changes in this patch:

1) The xenballoond service is a convenient place to implement
   userland "preswap shrinking".**
2) The xenballoon-monitor script is a convenient place to
   report (and view with "watch -d") the frequent memory
   rebalancing that results from tmem usage on a busy system.

Note that for best results (and for the monitor script to
work), the xenstore-* tools should be installed on each guest.

(** In a disk-based swap device, stale pages are often left
  on-disk even after they are no longer needed or valid; they
  are simply overwritten if/when the disk blocks are needed
  again, which may be a very long time.  Preswap behaves
  much like a disk, but uses precious pages of memory that
  count against a guest's memory allocation; thus stale
  pages are very undesirable.  Preswap shrinking periodically
  attempts to remove stale pages from preswap by using a
  sysfs interface created by the linux-side tmem patch.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>