]> xenbits.xensource.com Git - xen.git/log
xen.git
17 years agox86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.
Keir Fraser [Wed, 20 Feb 2008 14:36:45 +0000 (14:36 +0000)]
x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.
Re-factor VMX real-mode emulation to use the same harness.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agomerge with xen-unstable.hg
Alex Williamson [Tue, 19 Feb 2008 18:14:40 +0000 (11:14 -0700)]
merge with xen-unstable.hg

17 years ago[IA64] Fix getvcpucontext hypercall
Alex Williamson [Tue, 19 Feb 2008 16:28:09 +0000 (09:28 -0700)]
[IA64] Fix getvcpucontext hypercall

NaT bits for r1-r31 from xc_vcpu_getcontext() are broken.
HVM domain is confused by unknown Nat consumption fault
after domain restore or migration.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Fix shadow_op_off hypercall
Alex Williamson [Tue, 19 Feb 2008 16:26:39 +0000 (09:26 -0700)]
[IA64] Fix shadow_op_off hypercall

A domain might panic with unknown dirty bit fault
in case of live-migration failure.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Avoid wild use of registers.
Alex Williamson [Tue, 19 Feb 2008 16:25:22 +0000 (09:25 -0700)]
[IA64] Avoid wild use of registers.

This patch avoids wild use of registers (r9,p6,p7) in guest_vhpt_lookup.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Handle long vhpt format for ttag and thash.
Alex Williamson [Tue, 19 Feb 2008 16:22:25 +0000 (09:22 -0700)]
[IA64] Handle long vhpt format for ttag and thash.

Improve tak emulation.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Self IO EMUlator - tools part
Alex Williamson [Tue, 19 Feb 2008 15:12:28 +0000 (08:12 -0700)]
[IA64] Self IO EMUlator - tools part

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Self IO EMUlator (sioemu) - Hypervisor part
Alex Williamson [Tue, 19 Feb 2008 15:11:22 +0000 (08:11 -0700)]
[IA64] Self IO EMUlator (sioemu) - Hypervisor part

Implements Self IO-EMUlator.  It's an hybrid domain: looks
like PV from an external point of view but runs with VTI enabled.

All MMIO/IO writes/reads are reflected to the firmware, which converts the
access to PV drivers requests.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years ago[IA64] Build warning fix
Alex Williamson [Tue, 19 Feb 2008 14:51:25 +0000 (07:51 -0700)]
[IA64] Build warning fix

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years agohvm: Better gating of hvm_get_segment_register() in __hvm_copy().
Keir Fraser [Mon, 18 Feb 2008 21:26:57 +0000 (21:26 +0000)]
hvm: Better gating of hvm_get_segment_register() in __hvm_copy().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix mod_l3_entry() for PAE-on-64 guests. The adjustment of
Keir Fraser [Mon, 18 Feb 2008 13:50:25 +0000 (13:50 +0000)]
x86: Fix mod_l3_entry() for PAE-on-64 guests. The adjustment of
_PAGE_RW and _PAGE_USER cannot happen before get_page_from_l3e().

Original patch by Manuel Bouyer <bouyer@netbsd.org>.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoia64: Fix build after PCI hotplug changes.
Keir Fraser [Mon, 18 Feb 2008 09:35:39 +0000 (09:35 +0000)]
ia64: Fix build after PCI hotplug changes.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agoamd iommu: Allow device deassignment.
Keir Fraser [Mon, 18 Feb 2008 09:33:40 +0000 (09:33 +0000)]
amd iommu: Allow device deassignment.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years ago[IA64] Handle nested dtlb miss in vmx_dirty_bit
Alex Williamson [Fri, 15 Feb 2008 17:34:00 +0000 (10:34 -0700)]
[IA64] Handle nested dtlb miss in vmx_dirty_bit

Although I believe that tpa in vmx_dirty_bit never generate
a nested dtlb miss, this patch ensures the fault case.

Confirmed the additional code in this patch works fine
by means of a debugger.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoioemu: Fix the build.
Keir Fraser [Fri, 15 Feb 2008 14:31:20 +0000 (14:31 +0000)]
ioemu: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix debug build.
Keir Fraser [Fri, 15 Feb 2008 14:16:42 +0000 (14:16 +0000)]
x86: Fix debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoEnable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.
Keir Fraser [Fri, 15 Feb 2008 14:13:17 +0000 (14:13 +0000)]
Enable HVM guest VT-d device hotplug via a simple ACPI hotplug device model.

** Currently only 2 virtual hotplug pci slots(6~7) are created so more
   than 2 vtd dev can't be hotplugged, but we can easily extend it in
   future.

Three new commands are added:
"xm pci-list domid" show the current assigned vtd device, like:
VSlt  domain   bus   slot   func
0x6      0x0  0x02   0x00    0x0

"xm pci-detach" hot remove the specified vtd device by the virtual
slot, like:
xm pci-detach EdwinHVMDomainVtd 6

"xm pci-attach DomainID dom bus dev func [vslot]" hot add a new vtd
device in the vslot. If no vslot specified, a free slot will be picked
up. e.g. to insert '0000:03:00.0':
xm pci-attach EdwinHVMDomainVtd 0 3 0 0

** guest pci hotplug
linux: pls. use 2.6.X and enable ACPI PCI hotplug ( Bus options=> PCI
hotplug => ACPI PCI hotplug driver )
windows: 2000/xp/2003/vista are all okay

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
17 years agohvm acpi: Expose \_S4 ACPI object, allowing suspend-to-disk.
Keir Fraser [Fri, 15 Feb 2008 12:50:55 +0000 (12:50 +0000)]
hvm acpi: Expose \_S4 ACPI object, allowing suspend-to-disk.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoProvide fast write emulation path to release shadow lock.
Keir Fraser [Fri, 15 Feb 2008 12:33:11 +0000 (12:33 +0000)]
Provide fast write emulation path to release shadow lock.

Basically we can consider shadow fault logic into two parts,
with 1st part to cover logistic work like validating guest
page table or fix shadow table, and the 2nd part for write
emulation.

However there's one scenario we can optimize to skip the
1st part. For previous successfully emulated virtual frame,
it's very likely approaching at write emulation logic again
if next adjacent shadow fault is hitting same virtual frame.
It's wasteful to re-walk 1st part which is already covered
by last shadow fault. In this case, actually we can jump to
emulation code early, without any lock acquisition until
final shadow validation for write emulation. By perfc counts
on 64bit SMP HVM guest, 89% of total shadow write emulation
are observed falling into this fast path when doing kernel
build in guest.

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agovt-d: Fix dom0 boot issue with vtd=1 on Stoakley platform. Turn off
Keir Fraser [Fri, 15 Feb 2008 09:54:28 +0000 (09:54 +0000)]
vt-d: Fix dom0 boot issue with vtd=1 on Stoakley platform.  Turn off
excessive messages.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agoxenconsoled: Use ISO8601 date stamp format.
Keir Fraser [Fri, 15 Feb 2008 09:51:34 +0000 (09:51 +0000)]
xenconsoled: Use ISO8601 date stamp format.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years ago[IA64] Make translate_phy_pte() static
Alex Williamson [Thu, 14 Feb 2008 19:37:15 +0000 (12:37 -0700)]
[IA64] Make translate_phy_pte() static

Second argument pte doesn't need to be a pointer.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Cleanup vmx_vcpu.h
Alex Williamson [Thu, 14 Feb 2008 19:20:11 +0000 (12:20 -0700)]
[IA64] Cleanup vmx_vcpu.h

Make fault injection routines static inline for efficiency.
Remove unused definitions.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Add support for hvm live migration
Alex Williamson [Thu, 14 Feb 2008 18:50:55 +0000 (11:50 -0700)]
[IA64] Add support for hvm live migration

This is a naive implementation of log dirty mode for HVM.
(I gave up on writing a dirty-bit fault handler in assembler.)

An HVM domain with PV drivers can't be migrated yet.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agomerge with xen-unstable.hg
Alex Williamson [Thu, 14 Feb 2008 16:34:27 +0000 (09:34 -0700)]
merge with xen-unstable.hg

17 years agox86/64: Make BIOS call to declare our intention to enter long mode.
Keir Fraser [Thu, 14 Feb 2008 11:24:49 +0000 (11:24 +0000)]
x86/64: Make BIOS call to declare our intention to enter long mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 iommu: Define vendor-neutral interface for access to IOMMU.
Keir Fraser [Thu, 14 Feb 2008 11:14:17 +0000 (11:14 +0000)]
x86 iommu: Define vendor-neutral interface for access to IOMMU.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Support the WMVi pseudoencoding in the vnc server.
Keir Fraser [Thu, 14 Feb 2008 10:36:47 +0000 (10:36 +0000)]
ioemu: Support the WMVi pseudoencoding in the vnc server.

If the client implements it, it is supposed to be able to change
colour depth when receiving a WMVi message.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agox86 shadow: Reduce scope of shadow lock.
Keir Fraser [Thu, 14 Feb 2008 10:33:12 +0000 (10:33 +0000)]
x86 shadow: Reduce scope of shadow lock.

emulate_map_dest doesn't require holding lock, since
only shadow related operation possibly involved is to
remove shadow which is less frequent and can acquire
lock inside. Rest are either guest table walk or
per-vcpu monitor table manipulation

Signed-off-by Kevin Tian <kevin.tian@intel.com>

17 years agoioemu: Stub out direct-Linux-boot support for anything other than x86.
Keir Fraser [Thu, 14 Feb 2008 10:31:01 +0000 (10:31 +0000)]
ioemu: Stub out direct-Linux-boot support for anything other than x86.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoioemu: backport upstream's qemu_memalign.
Keir Fraser [Thu, 14 Feb 2008 09:26:38 +0000 (09:26 +0000)]
ioemu: backport upstream's qemu_memalign.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: drop unused xenblk_rxidx function
Keir Fraser [Thu, 14 Feb 2008 09:24:35 +0000 (09:24 +0000)]
minios: drop unused xenblk_rxidx function
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: optimize block io completion polling by not polling all the
Keir Fraser [Thu, 14 Feb 2008 09:23:14 +0000 (09:23 +0000)]
stubdom: optimize block io completion polling by not polling all the
time; only when some requests have completed.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoMini-OS: Fix alignment in maybe_split()
Keir Fraser [Thu, 14 Feb 2008 09:22:33 +0000 (09:22 +0000)]
Mini-OS: Fix alignment in maybe_split()
Needed on ia64, speeds up on x86.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxen: Clean up SMP/hotplug headers and implementation a bit.
Keir Fraser [Wed, 13 Feb 2008 18:30:12 +0000 (18:30 +0000)]
xen: Clean up SMP/hotplug headers and implementation a bit.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx realmode: Only check for pending interrupts every 16th
Keir Fraser [Wed, 13 Feb 2008 18:09:27 +0000 (18:09 +0000)]
vmx realmode: Only check for pending interrupts every 16th
instruction, since it is a moderately expensive operation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] Cleanup: remove unused functions and definitions
Alex Williamson [Wed, 13 Feb 2008 17:37:18 +0000 (10:37 -0700)]
[IA64] Cleanup: remove unused functions and definitions

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Cleanup in xc_ia64_linux_save.c
Alex Williamson [Wed, 13 Feb 2008 17:35:56 +0000 (10:35 -0700)]
[IA64] Cleanup in xc_ia64_linux_save.c

xc_ia64_shadow_control() is not needed any more
since xc_shadow_control() was xencommized.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years ago[IA64] Make xenitp more '|tee' friendly
Alex Williamson [Wed, 13 Feb 2008 17:34:18 +0000 (10:34 -0700)]
[IA64] Make xenitp more '|tee' friendly

Flush stdout after printing the prompt.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
17 years agovmx realmode: __hvm_copy() should not hvm_get_segment_register() when
Keir Fraser [Wed, 13 Feb 2008 16:35:51 +0000 (16:35 +0000)]
vmx realmode: __hvm_copy() should not hvm_get_segment_register() when
we are emulating. Firstly it is bogus, since VMCS segment state is
stale in this context. Secondly, real mode and real->protected
contexts are rather unlikely tohappen with SS.DPL == 3.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
Keir Fraser [Wed, 13 Feb 2008 16:28:38 +0000 (16:28 +0000)]
x86 vmx: Streamline vmx_interrupt_blocked() to avoid a VMREAD if
interrupt delivery is blocked by EFLAGS.IF. This speeds up real-mode
emulation in some cases (where we are currently executing
hvm_local_events_need_delivery() after every instruction).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 vmx: Remove bogus BUG_ON() introduced in previous changeset.
Keir Fraser [Wed, 13 Feb 2008 16:25:32 +0000 (16:25 +0000)]
x86 vmx: Remove bogus BUG_ON() introduced in previous changeset.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: Factor out save/restore of segment registers from VMX/SVM
Keir Fraser [Wed, 13 Feb 2008 14:03:58 +0000 (14:03 +0000)]
x86 hvm: Factor out save/restore of segment registers from VMX/SVM
files into common HVM code.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoTools: fix save/restore of 32-bit PV guests with 64-bit tools
Keir Fraser [Wed, 13 Feb 2008 10:43:13 +0000 (10:43 +0000)]
Tools: fix save/restore of 32-bit PV guests with 64-bit tools
by removing some obvious typos, handling CR3 folding and hvirt_start
based on guest word-size, and understanding 32-bit INVALID_MFN.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agopv-on-hvm: Signal crash to Xen tools when HVM guest panics.
Keir Fraser [Wed, 13 Feb 2008 10:42:09 +0000 (10:42 +0000)]
pv-on-hvm: Signal crash to Xen tools when HVM guest panics.

Attached patch adds a function to automatically dump core file when
guest linux on HVM domain panics, in the same way as PV domain.

I tested this patch with kernel 2.6.9 and 2.6.18 on both of x86 and
ia64 (to buid for ia64, some patches in the ia64 tree are needed) by
the following steps, and confirmed it works well:

1. Build xen-platform-pci.ko.
2. In /etc/xen/xend-config.sxp, set (enable-dump yes).
3. On guest linux, execute insmod:
   # insmod xen-platform-pci.ko
4. When guest linux panics, a core file is dumped.

Signed-off-by: Tetsu Yamamoto <yamamoto.tetsu@jp.fujitsu.com>
17 years agostubdom: missing two renames (avoids always re-compiling newlib)
Keir Fraser [Tue, 12 Feb 2008 16:59:08 +0000 (16:59 +0000)]
stubdom: missing two renames (avoids always re-compiling newlib)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: Rename stubdom/*.build into stubdom/*-build, newlib into
Keir Fraser [Tue, 12 Feb 2008 16:46:23 +0000 (16:46 +0000)]
stubdom: Rename stubdom/*.build into stubdom/*-build, newlib into
newlib-cvs, lwip into lwip-cvs.  Fix .hgignore to ignore only them and
not the patches.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoMake stubdom/Makefile override XEN_OS to MiniOS, and add
Keir Fraser [Tue, 12 Feb 2008 15:03:07 +0000 (15:03 +0000)]
Make stubdom/Makefile override XEN_OS to MiniOS, and add
config/MiniOS.mk. Add PTHREAD_LIBS to configs (usually holding
-lpthread).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years ago[BUILD] Disable LOCALVERSION_AUTO in upstream Linux builds.
Keir Fraser [Tue, 12 Feb 2008 14:59:22 +0000 (14:59 +0000)]
[BUILD] Disable LOCALVERSION_AUTO in upstream Linux builds.

If this option is enabled then the Xen mercurial version ID gets
tacked onto the kernel version (e.g. 2.6.24-git22-hg2593b69b183b)
which is unlikely to be useful or desirable. All the trees which we
build using this method already have uniquely identifying versions
(e.g. 2.6.24-git22 or 2.6.24-mm1).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years ago[BUILD] Fixup support for building upstream kernels.
Keir Fraser [Tue, 12 Feb 2008 14:59:01 +0000 (14:59 +0000)]
[BUILD] Fixup support for building upstream kernels.

In particular:
 - support merged x86 architecture. To facilitate this it made sense
   to encode some existing logic in shell scripts rather than
   increasing complicated make conditionals.
 - set CONFIG_PARAVIRT_GUEST=y which is required for newer kernels.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years ago[BUILD] Add option to ensure kernel build is non-interactive.
Keir Fraser [Tue, 12 Feb 2008 14:57:36 +0000 (14:57 +0000)]
[BUILD] Add option to ensure kernel build is non-interactive.

This is useful for the non 2.6.18-xen builds where the defconfig at
any particular momement may require additional questions to be
answered.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agoAdd stubdomain support. See stubdom/README for usage details.
Keir Fraser [Tue, 12 Feb 2008 14:35:39 +0000 (14:35 +0000)]
Add stubdomain support. See stubdom/README for usage details.

- Move PAGE_SIZE and STACK_SIZE into __PAGE_SIZE and __STACK_SIZE in
  arch_limits.h so as to permit getting them from there without
  pulling all the internal Mini-OS defines.
- Setup a xen-elf cross-compilation environment in stubdom/cross-root
- Add a POSIX layer on top of Mini-OS by linking against the newlib C
  library and lwIP, and implementing the Unixish part in mini-os/lib/sys.c
- Cross-compile zlib and libpci too.
- Add an xs.h-compatible layer on top of Mini-OS' xenbus.
- Cross-compile libxc with an additional xc_minios.c and a few things
  disabled.
- Cross-compile ioemu with an additional block-vbd, but without sound,
  tpm and other details.  A few hacks are needed:
  - Align ide and scsi buffers at least on sector size to permit
  direct transmission to the block backend. While we are at it, just
  page-align it to possibly save a segment. Also, limit the scsi
  buffer size because of limitations of the block paravirtualization
  protocol.
  - Allocate big tables dynamically rather that letting them go to
  bss: when Mini-OS gets installed in memory, bss is not lazily
  allocated, and doing so during Mini-OS is unnecessarily trick while
  we can simply use malloc.
- Had to change the Mini-OS compilation somehow, so as to export
  Mini-OS compilation flags to the Makefiles of libxc and ioemu.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agolibxenctrl headers should not pollute macro namespace with
Keir Fraser [Tue, 12 Feb 2008 11:37:45 +0000 (11:37 +0000)]
libxenctrl headers should not pollute macro namespace with
mb/rmb/wmb. Instead add a xen_ prefix. Modify Xen's public headers to
expect the prefixed names instead of bare mb/rmb/wmb, but gate this
expectation on a bump of __XEN_INTERFACE_VERSION__.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodevice-dm: Use SIGHUP before SIGKILL
Keir Fraser [Tue, 12 Feb 2008 10:57:49 +0000 (10:57 +0000)]
device-dm: Use SIGHUP before SIGKILL

Make qemu unblock SIGHUP and make sure the default handler is in
place. Have the domain killer send SIGHUP to the device-model script,
allow the script 10s to clean up, and if still not dead, send
SIGKILL.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxend: Remove redundant check of maximum memory size.
Keir Fraser [Tue, 12 Feb 2008 10:19:12 +0000 (10:19 +0000)]
xend: Remove redundant check of maximum memory size.

Currently, a wrong value of maximum memory size is checked by
_safe_set_memory() and _memory_sanity_check().

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoAdd timestamp option to xenconsoled
Keir Fraser [Tue, 12 Feb 2008 10:16:20 +0000 (10:16 +0000)]
Add timestamp option to xenconsoled

Similar to the --log option, --timestamp or -t takes:
- none : No timestamping
- hv   : Timestamp hypervisor logs
- guest: Timestamp guest logs
- all  : Timestamp guest and hypervisor logs

From: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRendezvous selected cpus in softirq (stop_machine).
Keir Fraser [Mon, 11 Feb 2008 15:59:49 +0000 (15:59 +0000)]
Rendezvous selected cpus in softirq (stop_machine).

This is similar to stop_machine_run stub from Linux, to pull
selected cpus in rendezvous point and the do some batch work
under a safe environment. Current one usage is from S3 path,
where individual cpu is pulled down with related online
footprints being cleared. It's dangerous to have other cpus
checking clobbered data structure in the middle, such as
cpu_online_map, cpu_sibling_map, etc.

Signed-off-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Dynamic VNC colour depth.
Keir Fraser [Mon, 11 Feb 2008 14:55:33 +0000 (14:55 +0000)]
ioemu: Dynamic VNC colour depth.

The qemu vnc server changes its internal colour depth based on the
client request. This way just one colour conversion is done: the one
in  vga_template.h, from the guest colour depth and the vnc server
internal colour depth.

This patch is meant to remove this colour conversion to improve
performances. It accomplishes the goal making the qemu internal colour
depth always the same as the guest colour depth.
The basic idea is that the vnc client is the one that should do the
colour conversion, if necessary. In general it should accept the pixel
format suggested by the server during the initial negotiation. This
behaviour can be set in most vnc clients (vncviewer included).

If the guest changes colour depth, the qemu vnc server changes colour
depth too and notifies the client. The problem is that the vnc
protocol doesn't provide a message from the server to the client to
ask for a colour depth change. So what I am doing is either:

1) quietly starting to do the conversion on vnc server (not gaining
   any performance here);

2) closing the vnc connection with the client, so the client can
   reconnect and choose the new pixel format.

By default I am doing 1), however the second choice can be enabled
passing the -vnc-switch-bpp command line option.
In order to do the colour conversion on the vnc server I had to
improve the colour conversion code already in place because it only
supported conversions from 32 bpp. The patch adds colour conversion
code that support conversions from any resolution to any resolution.

A last note: to get most out of this patch it is best to set Windows
to 16 bit colour depth, because the 24 bit mode is 24 bit depth and 24
bpp, meaning no alpha channel. The vnc protocol doesn't support 24
bpp, only 32 bpp, so this conversion is unavoidable.

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxen-api: Fix some errors in Xen-API's PBD class.
Keir Fraser [Mon, 11 Feb 2008 14:51:22 +0000 (14:51 +0000)]
xen-api: Fix some errors in Xen-API's PBD class.
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoxen-api: Add TOC and hyperlink cross reference to xen-api document
Keir Fraser [Mon, 11 Feb 2008 14:50:50 +0000 (14:50 +0000)]
xen-api: Add TOC and hyperlink cross reference to xen-api document
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoioemu: save 3MB of ioport tables (on 64bit machines)
Keir Fraser [Mon, 11 Feb 2008 14:47:19 +0000 (14:47 +0000)]
ioemu: save 3MB of ioport tables (on 64bit machines)
by keeping then initialized to NULL and check for it in the handlers.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: cope with partial reads/writes when using the read()/write()
Keir Fraser [Mon, 11 Feb 2008 14:47:06 +0000 (14:47 +0000)]
ioemu: cope with partial reads/writes when using the read()/write()
syscall interfaces.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86 hvm: Allow HPET to be configured as a per-domain config option.
Keir Fraser [Mon, 11 Feb 2008 14:45:29 +0000 (14:45 +0000)]
x86 hvm: Allow HPET to be configured as a per-domain config option.

A new platform variable 'hpet' is added, which defaults to 0 for new
guests (that is, hpet disabled). Default is off (no hpet) because
hpet is currently less accurate in keeping time than PIT (because no
timer_mode adjustments).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Better support for legacy HVM config with hvmloader configured
Keir Fraser [Mon, 11 Feb 2008 14:42:52 +0000 (14:42 +0000)]
xend: Better support for legacy HVM config with hvmloader configured
via the 'kernel' config option:
 1. Look for any string containing 'hvmloader'.
 2. The 'kernel' option must be scrubbed to avoid taking
 PV-kernel-loading paths during later guest setup.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Compile fix for p2m audit code.
Keir Fraser [Mon, 11 Feb 2008 10:57:17 +0000 (10:57 +0000)]
x86: Compile fix for p2m audit code.

From Tom Woller.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agovt-d: Remap interrupt for passthru device if such HW is detected on VT-d platforms.
Keir Fraser [Mon, 11 Feb 2008 10:51:41 +0000 (10:51 +0000)]
vt-d: Remap interrupt for passthru device if such HW is detected on VT-d platforms.
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
17 years agox86: Fix build after xentrace changes.
Keir Fraser [Mon, 11 Feb 2008 10:50:57 +0000 (10:50 +0000)]
x86: Fix build after xentrace changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoDocument XenStore's new SET_TARGET message
Keir Fraser [Mon, 11 Feb 2008 10:20:31 +0000 (10:20 +0000)]
Document XenStore's new SET_TARGET message
Signed-off-by: Ryan O'Connor <colossus@interchange.ubc.ca>
17 years agox86 shadow: Move the shadow linear mapping for n-on-3-on-4 shadows so
Keir Fraser [Mon, 11 Feb 2008 10:16:53 +0000 (10:16 +0000)]
x86 shadow: Move the shadow linear mapping for n-on-3-on-4 shadows so
that guest mappings of the bottom 4GB are not reflected in the monitor
pagetable. This ensures in particular that page 0 is not mapped,
allowing us to catch NULL dereferences in the hypervisor.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoxend: Remove redundant xc.domain_setcpuweight() all the way down to libxenctrl.
Keir Fraser [Mon, 11 Feb 2008 10:15:07 +0000 (10:15 +0000)]
xend: Remove redundant xc.domain_setcpuweight() all the way down to libxenctrl.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodomain builder: make vfb = [ 'type=sdl' ] work
Keir Fraser [Mon, 11 Feb 2008 10:06:51 +0000 (10:06 +0000)]
domain builder: make vfb = [ 'type=sdl' ] work

When setting

vfb = [ 'type=sdl' ]

in a domain config file, qemu seems to be still using vnc. Make it use
sdl as expected.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu stubdom: make daemonize optional
Keir Fraser [Mon, 11 Feb 2008 10:03:48 +0000 (10:03 +0000)]
ioemu stubdom: make daemonize optional
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: some ifndef NO_UNIX_SOCKETS were missing
Keir Fraser [Mon, 11 Feb 2008 10:03:19 +0000 (10:03 +0000)]
ioemu: some ifndef NO_UNIX_SOCKETS were missing
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: make AIO optional (already done upstream)
Keir Fraser [Mon, 11 Feb 2008 10:03:05 +0000 (10:03 +0000)]
ioemu: make AIO optional (already done upstream)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: fix compilation without softfloat
Keir Fraser [Mon, 11 Feb 2008 10:02:39 +0000 (10:02 +0000)]
ioemu: fix compilation without softfloat
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu stubdom: make TPM optional
Keir Fraser [Mon, 11 Feb 2008 10:01:42 +0000 (10:01 +0000)]
ioemu stubdom: make TPM optional
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoqemu: Queue mouse clicks.
Keir Fraser [Mon, 11 Feb 2008 09:57:38 +0000 (09:57 +0000)]
qemu: Queue mouse clicks.

qemu doesn't enqueue mouse events, just records the latest mouse
state. This can cause some lost mouse double clicks if the events are
not processed fast enought. This patch implements a simple queue for
left mouse click events.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoxentrace: Remove redundant tb_done_init checks, and add missing ones.
Keir Fraser [Mon, 11 Feb 2008 09:47:19 +0000 (09:47 +0000)]
xentrace: Remove redundant tb_done_init checks, and add missing ones.
Hand inspection of gcc -02 output confirms significantly shorter
codepaths for inactive (i.e. normal case) tracing.

Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
17 years agoxentrace: Improve xentrace to use VIRQ_TBUF interrupts as well as a
Keir Fraser [Mon, 11 Feb 2008 09:46:53 +0000 (09:46 +0000)]
xentrace: Improve xentrace to use VIRQ_TBUF interrupts as well as a
user-specified polling interval in order to determine when to empty
the trace buffers. Removed the old and unused/unimplemented
new_data_threshold logic.

Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
17 years agoxentrace: Allow xentrace to handle >4G of trace data.
Keir Fraser [Mon, 11 Feb 2008 09:46:21 +0000 (09:46 +0000)]
xentrace: Allow xentrace to handle >4G of trace data.
It was previously assert'ing when it hit 4G.

Also, because the trace buffer is not a power of 2 in size,
using modulo arithmetic to address the buffer does not work
when the index wraps around 2^32.

This patch fixes both issues, and as a side effect, removes all
integer division from the hypervisor side of the trace mechanism.

Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
17 years agoxentrace: Fix bug in logic for bytes_to_wrap in trace buffer.
Keir Fraser [Mon, 11 Feb 2008 09:45:36 +0000 (09:45 +0000)]
xentrace: Fix bug in logic for bytes_to_wrap in trace buffer.
Admittedly, the bug could only be manifest with much larger trace
records than are currently allowed (or equivalently, much smaller
trace buffers), but the old code was harder to read, and thus hid the
logic bug well, too.

Signed-off-by: Michael A Fetterman <Michael.Fetterman@cl.cam.ac.uk>
17 years agox86_emulate: Fix IMUL r/m8 emulation.
Keir Fraser [Thu, 7 Feb 2008 19:30:36 +0000 (19:30 +0000)]
x86_emulate: Fix IMUL r/m8 emulation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx realmode: Add REP MOVS handler.
Keir Fraser [Thu, 7 Feb 2008 18:57:12 +0000 (18:57 +0000)]
vmx realmode: Add REP MOVS handler.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86_emulate: Handle rep_ins, rep_outs, rep_movs hook failure and fall
Keir Fraser [Thu, 7 Feb 2008 18:56:47 +0000 (18:56 +0000)]
x86_emulate: Handle rep_ins, rep_outs, rep_movs hook failure and fall
back to slow path.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agomerge with xen-unstable.hg
Alex Williamson [Thu, 7 Feb 2008 18:08:49 +0000 (11:08 -0700)]
merge with xen-unstable.hg

17 years agox86_emulate: Fix MUL emulation.
Keir Fraser [Thu, 7 Feb 2008 18:00:44 +0000 (18:00 +0000)]
x86_emulate: Fix MUL emulation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] Fix vcpu_tranlate()
Alex Williamson [Thu, 7 Feb 2008 16:23:26 +0000 (09:23 -0700)]
[IA64] Fix vcpu_tranlate()

When handling resion7 opt feature, it should check the range.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agoioemu: use POSIX int type.
Keir Fraser [Thu, 7 Feb 2008 13:21:38 +0000 (13:21 +0000)]
ioemu: use POSIX int type.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: physaddr_bitsize must always be initialised for 32-on-64 dom0.
Keir Fraser [Thu, 7 Feb 2008 13:20:15 +0000 (13:20 +0000)]
x86: physaddr_bitsize must always be initialised for 32-on-64 dom0.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Fix build after LIST->QEMU_LIST changes.
Keir Fraser [Thu, 7 Feb 2008 13:19:19 +0000 (13:19 +0000)]
ioemu: Fix build after LIST->QEMU_LIST changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovmx: Clean up VPMU code a little and remove noisy printk.
Keir Fraser [Thu, 7 Feb 2008 10:47:20 +0000 (10:47 +0000)]
vmx: Clean up VPMU code a little and remove noisy printk.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agohvm: Clean up CPUID_0000_0001 return values.
Keir Fraser [Thu, 7 Feb 2008 10:31:48 +0000 (10:31 +0000)]
hvm: Clean up CPUID_0000_0001 return values.
The fix to EBX.ApicID was pointed out by Andre Przywara
<andre.przywara@amd.com>.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAdd 'coredump-destroy' and 'coredump-restart' actions for crashed domains.
Keir Fraser [Thu, 7 Feb 2008 09:28:55 +0000 (09:28 +0000)]
Add 'coredump-destroy' and 'coredump-restart' actions for crashed domains.

Xen-API already specifies these actions for the 'on_crash' domain exit
event. This patch makes them available for use in traditional domU
config files and through the xm tool as well.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoxm reboot: Fix wait option of xm reboot command
Keir Fraser [Thu, 7 Feb 2008 09:27:46 +0000 (09:27 +0000)]
xm reboot: Fix wait option of xm reboot command

When I rebooted a domain by xm reboot command with wait option,
I saw the following message.  But, rebooting the domain succeeded.
 Domain vm1 destroyed for failed in rebooting

The cause why the message was shown is the domain is destroyed
temporarily by processing of xm reboot command.  The domain
information is not gotten from Xend by server.xend.domains()
function till recreating the domain is completed.
This patch fixes processing of xm reboot command in Xm side.
It waits just a bit till recreating the domain is completed,
then it measures the success or failure of the reboot of the
domain.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoioemu: avoid name clashes due to LIST_* macros
Keir Fraser [Thu, 7 Feb 2008 09:21:19 +0000 (09:21 +0000)]
ioemu: avoid name clashes due to LIST_* macros

Here is what I wrote in my submission to qemu upstream:

 qemu's audio subdirectory contains a copy of BSD's sys-queue.h, which
 defines a bunch of LIST_ macros.  This makes it difficult to build a
 program made partly out of qemu and partly out of the Linux
 kernel[1], since Linux has a different set of LIST_ macros.  It might
 also cause trouble when mixing with BSD-derived code.

 Under the circumstances it's probably best to rename the versions in
 qemu.  The attached patch does this.

 [1] You might well ask why anyone would want to do this.  In Xen we
 are moving our emulation of IO devices from processes which run on
 the host into a dedicated VM (one per actual VM) which we call a
 `stub domain'.  This dedicated VM runs a very cut-down `operating
 system' which uses some code from Linux.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agoioemu: config cleanup re AF_UNIX sockets on non-Windows
Keir Fraser [Thu, 7 Feb 2008 09:19:12 +0000 (09:19 +0000)]
ioemu: config cleanup re AF_UNIX sockets on non-Windows

Here is what I wrote in my submission to qemu upstream:

 The patch below makes it possible to disable AF_UNIX (unix-domain)
 sockets in host environments which do not define _WIN32, by adding
 -DNO_UNIX_SOCKETS to the compiler flags.  This is useful in the
 effectively-embedded qemu host which are going to be using for device
 emulation in Xen.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agominios: Fix blkfront grant map leak
Keir Fraser [Thu, 7 Feb 2008 09:16:20 +0000 (09:16 +0000)]
minios: Fix blkfront grant map leak

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: Support net/block backend in domU
Keir Fraser [Thu, 7 Feb 2008 09:15:59 +0000 (09:15 +0000)]
minios: Support net/block backend in domU

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agohvmloader: Remove dead function check_amd().
Keir Fraser [Wed, 6 Feb 2008 18:31:02 +0000 (18:31 +0000)]
hvmloader: Remove dead function check_amd().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years ago[IA64] Fix shadow_op hypercall
Alex Williamson [Wed, 6 Feb 2008 18:23:16 +0000 (11:23 -0700)]
[IA64] Fix shadow_op hypercall

Fix SHADOW_OP_ENABLE_LOGDIRTY and SHADOW_OP_CLEAN hypercall.

Live migation doesn't work because the VHPT is not flushed.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>