Commit Graph
19937 Commits
Author SHA1 Message Date
Keir Fraser 55eb5c4259 pass-through: use vdevn in xm_pci_attach()
Use vdevfn in xm_pci_attach() for non-zero functions,
the vslot element of dev dictionaries no longer exists.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-07-14 14:38:56 +01:00
Keir Fraser 0d9d127b27 docs/xenapi: Update examples section reflecting the current behaviour.
Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-07-14 14:37:53 +01:00
Keir Fraser 71d2c144a7 stubdom: Install and use stubdompath.sh
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-13 16:50:53 +01:00
Keir Fraser 700ac7a490 x86-64: reduce symbol table size
With all of Xen's symbols sitting within a 2Gb range on x86-64, they
can be referred to by the kallsyms-like offset table using 4- instead
of 8-byte slots.

The marker table can use 4-byte slots in all cases, just like the
table entry counts can (though that's only a minor improvement).

If ia64's PERCPU_ADDR got moved down to (KERNEL_START + 2Gb -
PERCPU_PAGE_SIZE), it could also utilize the more compact form.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 16:49:50 +01:00
Keir Fraser b37d30c8fc Mapping grant references into HVM guests, take 2
After some discussion, here's a second version of the patch I posted a
couple of weeks back to map grant references into HVM guests.  As
before, this is done by modifying the P2M map, but this time there's
no new hypercall to do it.  Instead, the existing GNTTABOP_map is
overloaded to perform a P2M mapping if called from a shadow mode
translate guest.  This matches the IA64 API.

Signed-off-by: Steven Smith <steven.smith@citrix.com>
Acked-by: Tim Deegan <tim.deegan@citrix.com>
CC: Bhaskar Jayaraman <Bhaskar.Jayaraman@lsi.com>
2009-07-13 12:35:34 +01:00
Keir Fraser 1c4e651d3f Eliminate grant_table_op restriction
Eliminate the hard-coded, arbitrarily chosen limit of 512 grant table
ops a domain may submit at a time, and instead check for necessary
preemption after each individual element got processed, invoking the
hypercall continuation logic when necessary.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 12:18:04 +01:00
Keir Fraser d785a52854 Allow XENMEM_exchange to support exchange on foreign domains.
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
2009-07-13 12:17:05 +01:00
Keir Fraser fbaf0db4fc VT-d: fix assertion fault in pci passthrough code
Remove ASSERT(spin_is_locked(&pcidevs_lock)) in
pci_get_pdev_by_domain() to allow caller the flexibility to not hold
the lock if it does not care if the device is hot removed between the
time it got the pdev and the time it is used to get the corresponding
vt-d engine.  In the new RHSA use case, we just wanted to get the vt-d
engine of any device passthrough in the domain. Also, rename RHSA
field "domain" to "proximity domain" to avoid overloading the term
"domain" in virtualization context.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2009-07-13 11:52:49 +01:00
Keir Fraser e1b075eaf1 x86: merge final linking scripts
While unrelated to the previous four patches, I realized that the two
scripts are nearly identical when coding those earlier patches, and
this patch depends on them in order to apply cleanly.

As an extra measure, it also adjusts the (unused) space freed at the
end of the per-CPU area to include all alignment space needed before
the first actual constituent of the .bss section (up to 7 pages on
x86-64).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:51:07 +01:00
Keir Fraser 716ffa3e1d Move cpu_{sibling,core}_map into per-CPU space
These cpu maps get read from all CPUs, so apart from addressing the
square(nr_cpus) growth of these objects, they also get moved into the
previously introduced read-mostly sub-section of the per-CPU section,
in order to not need to waste a full cacheline in order to align (and
properly pad) them, which would be undue overhead on systems with low
NR_CPUS.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:45:31 +01:00
Keir Fraser cfbf17ffbb Introduce and use a per-CPU read-mostly sub-section
Since mixing data that only gets setup once and then (perhaps
frequently) gets read by remote CPUs with data that the local CPU may
modify (again, perhaps frequently) still causes undesirable cache
protocol related bus traffic, separate the former class of objects
from the latter.

These objects converted here are just picked based on their write-once
(or write-very-rarely) properties; perhaps some more adjustments may
be desirable subsequently. The primary users of the new sub-section
will result from the next patch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:32:41 +01:00
Keir Fraser 749182393c x86: move ucode_cpu_info into per-CPU space
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:31:34 +01:00
Keir Fraser 0e20e0e1c7 x86: move init_tss into per-CPU space
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:31:08 +01:00
Keir Fraser 0759ea7379 ia64: consolidate final linking step
This basically makes the final linking stage identical to x86's (with
the sole difference being that ia64 has the linker generate a map
file, while x86 doesn't), so would generally allow moving the final
linking rule into xen/Rules.mk.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:19:31 +01:00
Keir Fraser 2e2e8763c2 i386: fix boot
Since the Xen heap pages (which are the only ones mapped at this
point) don't get passed to init_boot_pages(), it has no place to store
the bootmem regions without faulting. Hence, a mapped page must be
passed to that function as the very first thing.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-13 11:18:57 +01:00
Keir Fraser 7ace84ccbc stubdom: Fix stubdom-dm after c/s 19818
19818 added the following line to stubdom-dm:
  . ./stubdompath.sh
and replaced many paths with variables.  However the path to
stubdompath.sh is obviously wrong and stubdompath.sh is nowhere to be
found anyway.  For the moment I am dropping . ./stubdompath.sh and
hardcoding the values of the variables.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-07-10 18:12:13 +01:00
Keir Fraser e7a00028f9 netbsd: remove qemu-ifup-nbsd, now that it is in the right place
(ioemu c/s 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f)

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-09 17:06:40 +01:00
Keir Fraser df65440f41 Make python check scripts use of $(PYTHON) make variable.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-09 17:05:07 +01:00
Keir Fraser 75577f42e0 tools: python -> $(PYTHON)
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-09 16:06:52 +01:00
Keir Fraser b4f3b1640a Update QEMU_TAG to 5cc34ea27f1cbd1a0560cfca91fb89ccd6d5726f 2009-07-09 16:06:01 +01:00
Keir Fraser 3e3897953d Use $(PYTHON) Makefile variable when building the hypervisor.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-09 15:26:24 +01:00
Keir Fraser 6edab9fe64 x86_64: Fix Xen relocation size -- there is no longer an allocation
bitmap to account for.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-09 08:52:31 +01:00
Keir Fraser 0409e29e2b Replace boot-time free-pages bitmap with a region list.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-08 22:08:31 +01:00
Keir Fraser 4d5b3e46f1 Do not use bitmap allocator after boot time.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-08 16:47:58 +01:00
Keir Fraser 3e4d0322b7 x86 hvm: Use 'x' as parameter name for macros converting between
{vcpu,domain} and {vlapic,vpic,vrtc,hpet}. Completely avoids
accidental aliasing.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-08 14:22:00 +01:00
Keir Fraser ab7dec0345 blktap2: Fix compile warning with gcc4.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-08 11:00:23 +01:00
Keir Fraser 6d821524b1 fs-back: better error handling in fs-backend
Currently most of the error checking in fs-backend is done by the use
of asserts that would terminate the daemon in case of a single error
on a single request.  This patch replaces the asserts with debugging
messages and terminates the connection on which the error occurred.
With this patch applied I was able to complete successfully over 1000
live migrations with stubdoms.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-07-08 10:58:09 +01:00
Keir Fraser f96f790bc4 stubdom: fix a race that affects live migration with stubdoms
This patch fixes a race during live migration with stubdoms: right
after the stubdom dies the configuration file of the VM is removed by
stubdom-dm but, in case of a live migration, the configuration file
could be the one of the new VM in the process of being created.
Removing the config file before destroying the stubdom is enough to
solve the race.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-07-08 10:51:00 +01:00
Keir Fraser c6b8bdfe3b x86: extend mmu_update hypercall to allow update of foreign pagetables.
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-07-07 14:38:59 +01:00
Keir Fraser f12b7b5a0b x86,hvm: Allow delivery of timer interrupts to VCPUs != 0
This patch is needed for kexec/kdump since VCPU#0 is halted.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-07 14:21:16 +01:00
Keir Fraser e82525a924 x86,hvm: cleanup hpet.c vcpu handling same as i8254.c/rtc.c
- introduce macros: domain_vhpet, vcpu_vhpet, vhpet_domain, vhpet_vcpu
- remove *vcpu field from struct HPETState
- modify guest_time_hpet() takes *vhpet instead of *vcpu as 1st
- argument

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-07-07 14:08:47 +01:00
Keir Fraser 6e56d8aa4a docs: update vtd.txt for pv-ops dom0
Now VT-d works with pv-ops dom0, update vtd.txt to tell how to build
and use VT-d with pv-ops.

Signed-off-by: Weidong Han <weidong.han@intel.com>=
2009-07-07 14:07:08 +01:00
Keir Fraser b67758cda1 vmx: Add support for Pause-Loop Exiting
New NHM processors will support Pause-Loop Exiting by adding 2
VM-execution control fields:
PLE_Gap    - upper bound on the amount of time between two successive
             executions of PAUSE in a loop.
PLE_Window - upper bound on the amount of time a guest is allowed to
             execute in a PAUSE loop

If the time, between this execution of PAUSE and previous one, exceeds
the PLE_Gap, processor consider this PAUSE belongs to a new loop.
Otherwise, processor determins the the total execution time of this
loop(since 1st PAUSE in this loop), and triggers a VM exit if total
time exceeds the PLE_Window.
* Refer SDM volume 3b section 21.6.13 & 22.1.3.

Pause-Loop Exiting can be used to detect Lock-Holder Preemption, where
one VP is sched-out after hold a spinlock, then other VPs for same
lock are sched-in to waste the CPU time.

Our tests indicate that most spinlocks are held for less than 2^12
cycles.  Performance tests show that with 2X LP over-commitment we can
get +2% perf improvement for kernel build(Even more perf gain with
more LPs).

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2009-07-07 14:06:35 +01:00
Keir Fraser aa4af83c50 xenstat: Use backend path which is compatible with pvops and 2.6.18-xen kernels.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-07-07 14:01:30 +01:00
Keir Fraser df117d7fe3 x86, hvm: fix get msix entry error
There is a mistake to get the msix entry number. It should be
divide instead of modulus.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
2009-07-06 11:58:02 +01:00
Keir Fraser 6e07e93194 AMD IOMMU: Add suspend and resume support for amd iommu.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
2009-07-06 11:57:18 +01:00
Keir Fraser 9699ac1856 AMD IOMMU: Make iommu suspend & resume functions more generic.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
2009-07-06 11:56:51 +01:00
Keir Fraser ffc066ece3 AMD IOMMU: Clean up hardware initialization functions to make them
more friendly to iommu suspend and resume operations.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2009-07-06 11:56:17 +01:00
Keir Fraser 583731dce8 32on64: increase size of compat argument translation area to 2 pages.
The existing single page is not quite large enough to translate a
XENMEM_exchange hypercall with order=3D9. Since Linux uses
MAX_CONTIG_ORDER of 9 this seems like a reasonable upper bound to
support.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-07-06 11:55:17 +01:00
Keir Fraser 8259ef78d3 x86: PERCPU_SHIFT can be reduced to 12 now compat_arg_xlat_area is not
directly a per-cpu object.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-06 11:55:01 +01:00
Keir Fraser 4a5c769015 Avoid compat_arg_xlat to be a large per-CPU object
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-07-06 11:51:19 +01:00
Keir Fraser 34d140eaa7 x86 shadow: disable fast np path in OOS.
Signed off by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2009-07-06 11:50:30 +01:00
Keir Fraser 535501ae64 x86 shadow: Fix lock-less race between resync and fast path.
Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
2009-07-06 11:49:56 +01:00
Keir Fraser 51dd9a1427 xend: allow pv_ops kernel driver pci-stub to hide devices for assignment
pciback is used by VT-d to hide device for assigment. But in pv-ops
dom0, pciback is not supported yet. Fortunately, pci-stub module is
used to hide device in Linux for KVM VT-d device assignment and it's
included in pv-ops dom0. So can use pci-stub to hide devices for
assignment.

Device must be hidden before assignment. Control panel has checks if
devices can be assigned or not, and can list assignable devices via
reading devices owned by pciback. This patch changes the checks, and
also list assignable devices which are owned by pci-stub. Use pci-stub
to hide devices, and use this patch to pass checkes in control panel,
device assignemnt with VT-d works on Xen with pv-ops dom0.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-07-06 11:48:44 +01:00
Keir Fraser 26bfb945fc blktap2: fix save/restore/migration
blktap2 devices use a regular 'phy' vbd blkback backend, causing
Blktap2Controller to trample the devices' parameters. This causes
problems with save/restore and managed domains, among other
things. This patch modifies Blktap2Controller to store both the vbd
and tap2 parameters in xenstore, and stops it from trampling the
device's config on device creation.

 * store blktap2 parameters in xenstore
 * restore blktap2 device config to original state once the underlying
 * vbd
   device is created (this fixes managed domains)
 * use blktap2 parameters rather than vbd parameters when building
 * blktap2
   device configurations
 * remove blktap2 specific code from XendConfig

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-07-06 11:47:34 +01:00
Keir Fraser 158299ee06 blktap2: seperate blktap1/blktap2 disk types
* seperate blktap1/blktap2 disk types
 * use blktap1 when driver is not in explicit list of blktap2 drivers,
 * rather than current check against list of blktap1 only drivers
 * remove 'tapdisk' disk type (it is not a tapdisk disk type) and fix
 * tapdisk disk type check in XenConfig

Signed-off-by: Ryan O'Connor <rjo@cs.ubc.ca>
2009-07-06 11:47:02 +01:00
Keir Fraser ae9820b4b0 x86: Process only pending timers in acpi idle handler, not all
softirqs. This fixes a bug where bailing into SCHEDULE_SOFTIRQ may not
actually return.

From: Ke Yu <ke.yu@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-06 11:46:22 +01:00
Keir Fraser 674801b080 libfsimage: Support for zfs version 16.
Remove version checks to support boot of ZFS root filesystem version
16.

Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
2009-07-06 11:42:05 +01:00
Keir Fraser d918a60f89 Fix c/s 19886: Must free pages after synchronously scrubbing them
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-03 08:54:51 +01:00
Keir Fraser cfafda4169 tools: Always check for __linux__ not __Linux__
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-02 21:45:30 +01:00