Commit Graph
18410 Commits
Author SHA1 Message Date
Keir Fraser f1a381df9c cross-install: Only apply in tools directory, and automatically wrap $INSTALL.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-30 08:36:02 +01:00
Keir Fraser c1c6c2ac90 stubdom: Absolute path for XEN_ROOT.
It may be used in subdirectories indirectly (e.g., as path component
of $(INSTALL)).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-30 08:11:09 +01:00
Keir Fraser 47bdb3b05f vtd: fix Dom0 S3 when VT-d is enabled.
Now if VT-d is enabled, when Dom0 does S3, Xen doesn't suspend/resume
the IOMMU states.

The patch adds the missing invocations of
iommu_suspend()/iommu_resume() and makes some nesessary fixes:
1) In iommu_set_root_entry(), we should not re-allocate the root-entry
when Xen returns from S3;
2) Define the array iommu_state correctly (u8 -> u32);
3) Only save/restore the necessary IOMMU registers.

The patch was tested on Weybridge.

NOTE: if we have some HVM guests which have assigned devices, and we
want to do Dom S3, we MUST do HVM S3 for each HVM guest first.
Namely, the steps are:
1) Use HVM S3 in guest to suspend the guest (for example, in Linux HVM
guest, this is "echo mem > /sys/power/state");
2) Use Dom0 S3 to suspend Dom0: "echo mem > /sys/power/state";
3) At some point, Dom0 resumes from S3 (for example, by pressing the
power button or using the acpi alarm);
4) Use "xm trigger HVM_DOM_ID s3resume" to resume every HVM guest
which were suspended previously.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-08-29 16:16:33 +01:00
Keir Fraser 8565e53aba x86: constify microcode hypercall argument
Linux 2.6.27 marks the data pointer in its firmware struct 'const',
and hence, to avoid a compiler warning, Xen's microcode update
interface should be properly properly constified too.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2008-08-29 16:11:05 +01:00
Keir Fraser 65c1f4b9ec docs: A small update in the vtpm documentation file.
Signed-off-by: Stefan Berger <stefanB@us.ibm.com>
2008-08-29 16:08:09 +01:00
Keir Fraser d6c3ce8cb9 Update the URL for the ACPI compiler sources.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2008-08-29 16:07:36 +01:00
Keir Fraser 309459216a Run cross-compilation-aware install wrapper script.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-29 16:06:41 +01:00
Keir Fraser 2c9b12c9e4 amd: Extended migration support
This patch adds support for AMD's extended migration, aka CPUID
features and extended features masking.

Signed-off-by: Travis Betak <travis.betak@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-29 11:13:41 +01:00
Keir Fraser fb7998a2e2 docs: Fix datamodel-graph of XenAPI
"VTPM" is forgotten.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-29 10:46:46 +01:00
Keir Fraser ec6869dadc pv-grub: fix example file
Apparently 64MB is too short for the domain builder.
No kernel option should be passed, as they are provided by menu.lst,
and would only confuse grub.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-29 10:45:09 +01:00
Keir Fraser 1d534660ad x86: time_calibration_rendezvous must be invoked with @wait=1.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-28 13:31:49 +01:00
Keir Fraser e388539d78 stubdom: fix munmap's update_va_mapping flag passing, thus fixing
INVLPG passing

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-28 13:09:02 +01:00
Keir Fraser c07e22cf60 softirq: Add sanity assertion about NR_SOFTIRQS.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-28 11:38:57 +01:00
Keir Fraser 26141b3e26 x86: There are now two x86-specific softirqs.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-28 11:38:02 +01:00
Keir Fraser 389f440998 Update Xen version for 3.4-unstable development phase 2008-08-28 11:31:16 +01:00
Keir Fraser 1ceec08ea2 hvmloader: skip upper field of 64 bit base address register.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-08-28 09:59:49 +01:00
Keir Fraser bf1bb3fa7e ioemu, passthru: make upper field of 64 bit bar writable.
Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
2008-08-28 09:58:01 +01:00
Keir Fraser f78e4ead53 stubdom: add LANG=C for 'gcc -print-search-dirs'
Prevents unwanted localisation of pretty-printing.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2008-08-28 09:55:40 +01:00
Keir Fraser 85a8576217 docs: Update user manual for 3.3.
From: Stephen Spector <stephen.spector@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-28 09:49:52 +01:00
Keir Fraser 309af15419 xend: Cleanup destroy and destroyDomain methods
When domains are destroyed, _prepare_phantom_paths() method
and _cleanup_phantom_devs() method are called twice as follows.

destroy()@XendDomainInfo.py
    _prepare_phantom_paths() --------------- 1
    _cleanupVm()
    destroyDomain()
        _prepare_phantom_paths() ----------- 2
        xc.domain_destroy_hook()
        xc.domain_pause()
        do_FLR()
        xc.domain_destroy()
        XendDomain.remove_domain()
        cleanupDomain()
        _cleanup_phantom_devs() ------------ 1
    _cleanup_phantom_devs() ---------------- 2
    XendDomain.domain_delete_by_dominfo()

This is a cleanup patch.  It combines destroyDomain() method
into destroy() method, then _prepare_phantom_paths() method and
_cleanup_phantom_devs() method are called only once.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-28 09:44:13 +01:00
Keir Fraser 2e8459a4fc stubdom: make xc_map_foreign_ranges use malloc instead of stack space
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-28 09:40:10 +01:00
Keir Fraser 8a68b82ff1 libxc: Use vcpu_guest_context_any_t instead of two pages
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 16:23:10 +01:00
Keir Fraser f844c8910a hvmloader: Fix e820_malloc() after bug I introduced in c/s 18383
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:16:13 +01:00
Keir Fraser 86e881097c tools/xenmon/Makefile: Move LDFLAGS after $<
gcc expects libraries needed for object files to be specified after
the object. Linking usually does not fail, unless it is optimized (for
instance, using -Wl,-as-needed).

The related Gentoo bug is 135145 [ https://bugs.gentoo.org/135145 ].

From: Robert Buchholz <rbu@gentoo.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 15:02:38 +01:00
Keir Fraser 7e0fe5d8f4 stubdom: add v?errx? and v?warnx? functions
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:57:51 +01:00
Keir Fraser 86cf63d6f4 ioemu: Add SEEK_STAT in all non-error cases except sleep request,
since our seek times are virtually 0.  Although this flag is
deprecated by newer ATA standards, Linux at least checks it for CD
drives, and would timeout in some cases if we do not set it.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:57:23 +01:00
Keir Fraser d818f3cb7c hvm: Use main memory for video memory.
When creating an HVM domain, if e.g. another domain is created before
qemu allocates video memory, the extra 8MB memory ballooning is not
available any more, because it got consumed by the other domain.

This fixes it by taking video memory from the main memory:

- make hvmloader use e820_malloc to reserve some of the main memory
  and notify ioemu of its address through the Xen platform PCI card.
- add XENMAPSPACE_mfn to the xen_add_to_physmap memory op, to allow
  ioemu to move the MFNs between the original position and the PCI
  mapping, when LFB acceleration is disabled/enabled
- add a remove_from_physmap memory op, to allow ioemu to unmap it
  completely for the case of old guests with acceleration disabled.
- add xc_domain_memory_translate_gpfn_list to libxc to allow ioemu to
  get the MFNs of the video memory.
- have xend save the PCI memory space instead of ioemu: if a memory
  page is there, the guest can access it like usual memory, so xend
  can safely be responsible to save it.  The extra benefit is that
  live migration will apply the logdirty optimization there too.
- handle old saved images, populating the video memory from ioemu if
  really needed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 14:53:39 +01:00
Keir Fraser 1583e7e448 mini-os: Fix build failure with void* arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 13:31:01 +01:00
Keir Fraser dafd59dde6 Fall back to a timer linked list when the timer heap overflows.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 13:24:35 +01:00
Keir Fraser d1ef21b1cc Use 'gcc -v 2>&1 | tail -1' to extract gcc version.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 11:47:02 +01:00
Keir Fraser 6fc80aed0d xmalloc: Cannot be called in IRQ context so doesn't need IRQ-safe locking.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 10:26:50 +01:00
Keir Fraser b35a75abcd x86: Signal softirq-context calibration with an actual first-class
softirq handle rather than kludging it with set_timer().

Should be faster and is definitely clearer. Also avoids us using
set_timer() in IRQ context (which is currently broken but soon won't
be).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 10:12:49 +01:00
Keir Fraser bb2f3a7002 x86: Assert in_irq() while processing guest-bound interrupts.
Actually a fair amount of infrastructure is onvolved these days, and
we'd like subsystems we call into know that we're in IRQ context so
they can handle that or BUG/ASSERT if appropriate.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 10:11:33 +01:00
Keir Fraser b1813844dc More precise regexp to extract version line from 'gcc -v'.
Reported by Robert Buchholz <rbu@gentoo.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-27 09:57:53 +01:00
Keir Fraser 13d5024794 mini-os: Add printf format checking to xenbus_printf
Reported-by: "Daniel P. Berrange" <berrange@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:48:39 +01:00
Keir Fraser 1f1f49120f ioemu-stubdom: drop --disable-gfx-check option, already added by qemu-xen tree
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:48:09 +01:00
Keir Fraser 839dac782f stubdom: support quotes in argument passing
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:47:49 +01:00
Keir Fraser fe2998c24a stubdom: make munmap work in batches to fix stack overflow
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:47:24 +01:00
Keir Fraser 2f43a7baa9 xend: fix LinuxImageHandler debugging output
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:47:08 +01:00
Keir Fraser 63193f3f4d PyGRUB: fix menu flicker
To avoid flickers, PyGRUB has to avoid spurious ncurses refresh as
much as possible, in particular before the complete screen is drawn,
and eventually call doupdate last.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:46:38 +01:00
Keir Fraser 84901438e6 mini-os: make xenbus_read_integer and xenbus_printf take const strings
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:46:22 +01:00
Keir Fraser 55c1a137e7 stubdom: drop debugging message
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:46:09 +01:00
Keir Fraser 6c5aecbf01 stubdom: add syslog functions
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:45:42 +01:00
Keir Fraser dcd4913503 stubdom: add dummy pthread_mutexattr*
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:45:09 +01:00
Keir Fraser 1cbf503b9d stubdom: int32_t is provided by stdint.h, not sys/types.h
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
2008-08-27 09:44:51 +01:00
Keir Fraser 7ec3e07914 x86 hvm: More checking around REP MOVS emulation.
Check for self-corrupting copies, and report hvm_copy errors to the
console log.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-26 15:16:57 +01:00
Keir Fraser 43e1fddd0c vtd: do FLR before xc.domain_destroy()
When we "xm destroy" a guest with assigned devices, in
xen/common/domain.c:domain_kill(), we relinquish guest's memory first,
then invoke domain_destroy() -> complete_domain_destroy() ->
arch_domain_destroy() -> pci_release_devices()/iommu_domain_destroy().

Between relinquish_memory() and domain_destroy(), a device may be
issuing DMA request and access guest's relinquished  memory.

We can do_FLR() to quiesce devices before xc.domain_destroy().

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2008-08-26 14:11:39 +01:00
Keir Fraser 81abef0448 x86 hvm: Emulate RAM-to-RAM REP MOVS copies efficiently.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2008-08-26 14:10:17 +01:00
Keir Fraser d6b6a1137f vtd: Fix ioapic interrupt remapping
Besides io_apic_write(), io_apic_modify() also writes to io apic RTE.
This patch adds an intercept to remap interrupt in io_apic_modify().

In io_apic_read_remap_rte(), 'mask' value of RTE should not affect the
return value, so remove its checking.

Finally, remove panic() when index overflows. Instead, print error
messages and report back the failure to upper level.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2008-08-26 13:00:43 +01:00
Keir Fraser 2a82334fcc xend: Avoid multiple assignments to same dict key in pci_convert_sxp_to_dict
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2008-08-26 10:14:32 +01:00