]> xenbits.xensource.com Git - xen.git/log
xen.git
17 years agoStubdom: add support for file creation.
Keir Fraser [Tue, 18 Mar 2008 11:26:21 +0000 (11:26 +0000)]
Stubdom: add support for file creation.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86_64: Make VGCF_in_syscall definition available to assembly code.
Keir Fraser [Tue, 18 Mar 2008 11:15:20 +0000 (11:15 +0000)]
x86_64: Make VGCF_in_syscall definition available to assembly code.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
17 years agoConvert XenAPI platform values to appropriate types.
Keir Fraser [Tue, 18 Mar 2008 11:07:00 +0000 (11:07 +0000)]
Convert XenAPI platform values to appropriate types.

XenAPI defines the platform attribute of a VM as a string-string map
but in various code paths in xend the platform entries are expected to be
another type, e.g. int.  This patch defines the types of each platform
entry and converts the entry values to appropriate type when new domU
configuration is created via XenAPI.

Alternatively the values could be casted to appropriate type when used
but seems prudent to do the conversion when domU configuration is
created.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoSet device model when creating rfb console via XenAPI
Keir Fraser [Tue, 18 Mar 2008 11:06:26 +0000 (11:06 +0000)]
Set device model when creating rfb console via XenAPI

When creating a rfb console via XenAPI the device model is not being
set to qemu-dm, resulting in no pvfb since qemu-dm is not launched
when domU is started.  This patch sets device model when a rfb console
is created via XenAPI.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoInitialization of new domU config options via XenAPI
Keir Fraser [Tue, 18 Mar 2008 11:05:53 +0000 (11:05 +0000)]
Initialization of new domU config options via XenAPI

Many of the new domU config options related to hvm guests (e.g. hpet,
rtc_timeoffset, etc.) are not initialized with default values via
XenAPI, which prevents starting an hvm domU created through XenAPI.
This patch ensures the new options are set with appropriate default
values in XendConfig platform sanity check.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agoAdd periodic fflush to xentop batch mode.
Keir Fraser [Tue, 18 Mar 2008 11:04:20 +0000 (11:04 +0000)]
Add periodic fflush to xentop batch mode.
From: Yusuke KANEKI <Kaneki.Yusuke@ea.MitsubishiElectric.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoEach TAP/TUN device name for a HVM guest includes its domain ID.
Keir Fraser [Tue, 18 Mar 2008 11:02:00 +0000 (11:02 +0000)]
Each TAP/TUN device name for a HVM guest includes its domain ID.

The TAP/TUN devices are used for connection to a HVM domain, but there
is no relationship between each name of the devices and its domain
ID. This patch assigns a HVM domain ID to each TAP/TUN device name.

Signed-off-by: MIYAJIMA Mitsuharu <miyajima.mitsuharu@anchor.jp>
17 years agoFix xc_save compile
Keir Fraser [Tue, 18 Mar 2008 10:59:46 +0000 (10:59 +0000)]
Fix xc_save compile

Add missing <err.h> include.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agoUse ioemu block drivers through blktap.
Keir Fraser [Tue, 18 Mar 2008 10:58:47 +0000 (10:58 +0000)]
Use ioemu block drivers through blktap.

Add support for a tap:ioemu pseudo driver. Devices using this driver
won't use tapdisk (containing the code duplication) any more, but will
connect to the qemu-dm of the domain. In this way no working
configuration should be broken right now as you can still choose to
use the tapdisk drivers.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
17 years agohvm: Remove incorrect comment from public save header.
Keir Fraser [Tue, 18 Mar 2008 10:53:20 +0000 (10:53 +0000)]
hvm: Remove incorrect comment from public save header.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Clean ups and fixes after bitops changes.
Keir Fraser [Tue, 18 Mar 2008 10:51:20 +0000 (10:51 +0000)]
x86: Clean ups and fixes after bitops changes.

Firstly, the vlapic bitops need fewer casts.

Secondly, the minimum-alignment check is unnecessary and also breaks
the build (page_info's type_info field has alignment == 1). It is an
unnecessary check because bitops operate on only one bit of the word
they access, so lack of atomicity of the read and writeback does not
matter -- furthermore the LOCKed variants are guaranteed atomic
regardless of alignment.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agosvm: Fix the build.
Keir Fraser [Tue, 18 Mar 2008 10:05:56 +0000 (10:05 +0000)]
svm: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoSVM: handle page faults in emulated instruction fetches
Keir Fraser [Mon, 17 Mar 2008 11:39:50 +0000 (11:39 +0000)]
SVM: handle page faults in emulated instruction fetches

Deal with failures in hvm_copy_from_guest_virt when fetching
instructions in the various SVM emulation paths.  Since we know that
the instruction was fetchable by the hardware, we can usually just
return from the VMEXIT and try again; whatever caused us to fail will
cause the hardware to fail next time and we'll get the correct exit
code.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86 numa: Fix the overflow of physical addresses.
Keir Fraser [Mon, 17 Mar 2008 11:18:06 +0000 (11:18 +0000)]
x86 numa: Fix the overflow of physical addresses.

If memory address >4G, the address will overflow in some NUMA code if
using unsigned long to statement a physical address in PAE arch.

Replace "unsigned long" with paddr_t to avoid overflow.

Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
17 years agohvm bios: Fix EDD pointer in int 13h, fn 48h BIOS call return buffer
Keir Fraser [Mon, 17 Mar 2008 11:16:08 +0000 (11:16 +0000)]
hvm bios: Fix EDD pointer in int 13h, fn 48h BIOS call return buffer

I ran into this when I was reviewing what was outstanding to get
NetWare to run fully virtualized.

The BIOS emulator code has the segment and offset backward in the
returned buffer for the int 13h, fn 48h BIOS call.

Signed-off-by: Bruce Rogers <brogers@novell.com>
17 years agoAdd -fno-optimize-sibling-calls to debug CFLAGS. Also get rid of ?=
Keir Fraser [Mon, 17 Mar 2008 11:02:40 +0000 (11:02 +0000)]
Add -fno-optimize-sibling-calls to debug CFLAGS. Also get rid of ?=
assignment to CFLAGS.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove deprecated and unused features from LaTeX source.
Keir Fraser [Mon, 17 Mar 2008 10:58:29 +0000 (10:58 +0000)]
Remove deprecated and unused features from LaTeX source.

Signed-off-by: Bastian Blank <waldi@debian.org>
17 years agoClean up xenstore Makefile.
Keir Fraser [Mon, 17 Mar 2008 10:58:12 +0000 (10:58 +0000)]
Clean up xenstore Makefile.

Signed-off-by: Bastian Blank <waldi@debian.org>
17 years agoClean up blktap Makefiles.
Keir Fraser [Mon, 17 Mar 2008 10:57:59 +0000 (10:57 +0000)]
Clean up blktap Makefiles.

Signed-off-by: Bastian Blank <waldi@debian.org>
17 years agoMove iommu code to arch-generic locations, and also clean up some VT-d code.
Keir Fraser [Mon, 17 Mar 2008 10:45:24 +0000 (10:45 +0000)]
Move iommu code to arch-generic locations, and also clean up some VT-d code.
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agox86: Allow bitop functions to be applied only to fields of at least 4
Keir Fraser [Sun, 16 Mar 2008 14:11:34 +0000 (14:11 +0000)]
x86: Allow bitop functions to be applied only to fields of at least 4
bytes. Otherwise the 'longword' processor instructions used will
overlap with adjacent fields with unpredictable consequences.

This change requires some code fixup and just a few casts (mainly when
operating on guest-shared fields which cannot be changed, and which by
observation are clearly safe).

Based on ideas from Jan Beulich <jbeulich@novell.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Reserve 32 bits for each of acpiid and apicid in new phys_id vcpu hypercall.
Keir Fraser [Mon, 10 Mar 2008 22:51:57 +0000 (22:51 +0000)]
x86: Reserve 32 bits for each of acpiid and apicid in new phys_id vcpu hypercall.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove hard tabs from Xen source file.
Keir Fraser [Wed, 5 Mar 2008 11:18:25 +0000 (11:18 +0000)]
Remove hard tabs from Xen source file.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodocs: Remove 'hap' boot parameter from the user manual.
Keir Fraser [Wed, 5 Mar 2008 11:17:50 +0000 (11:17 +0000)]
docs: Remove 'hap' boot parameter from the user manual.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: Remove global 'hap' boot parameter now that their is a
Keir Fraser [Wed, 5 Mar 2008 11:16:32 +0000 (11:16 +0000)]
x86 hvm: Remove global 'hap' boot parameter now that their is a
per-domain configuration option.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Let the USB tablet reach the far bottom and right pixels
Keir Fraser [Wed, 5 Mar 2008 11:10:29 +0000 (11:10 +0000)]
ioemu: Let the USB tablet reach the far bottom and right pixels
by fixing divisions / multiplications into using width-1.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: support shared framebuffer and linesize != width * depth.
Keir Fraser [Wed, 5 Mar 2008 10:54:08 +0000 (10:54 +0000)]
ioemu: support shared framebuffer and linesize != width * depth.

When sharing the buffer between e.g. xenfb and SDL, SDL must follow
the line size.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: New vcpu_op call to get physical CPU identity.
Keir Fraser [Wed, 5 Mar 2008 10:52:51 +0000 (10:52 +0000)]
x86: New vcpu_op call to get physical CPU identity.

Some AMD machines have APIC IDs that not equal to CPU IDs. In
the default Xen configuration, ACPI calls on these machines
can get confused. This shows up most noticeably when running
AMD PowerNow!. The only solution is for dom0 to get the
hypervisor's cpuid to apicid table when needed (ie, when dom0
vcpus are pinned).

Add a vcpu op to Xen to allow dom0 to query the hypervisor for
architecture dependent physical cpu information if dom0 vcpus are
pinned.

Signed-off-by: Mark Langsdorf <mark.langsdorf@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Slown down refresh interval when SDL is minimized
Keir Fraser [Wed, 5 Mar 2008 09:43:03 +0000 (09:43 +0000)]
ioemu: Slown down refresh interval when SDL is minimized
as that saves us the VGA refresh scanning.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: improve colordepth negotiation
Keir Fraser [Tue, 4 Mar 2008 13:30:07 +0000 (13:30 +0000)]
ioemu: improve colordepth negotiation

By moving the colourdepth callback a bit earlier, we can let the
display decide the actual depth to be used before the draw and whether
sharing is possible or not.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agotools: Compile xentop only if curses are available.
Keir Fraser [Tue, 4 Mar 2008 13:29:36 +0000 (13:29 +0000)]
tools: Compile xentop only if curses are available.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86_emulate: Load FPU context before FWAIT.
Keir Fraser [Tue, 4 Mar 2008 13:28:00 +0000 (13:28 +0000)]
x86_emulate: Load FPU context before FWAIT.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Clean up FPU code style and add a comment about FNSAVE/FWAIT
Keir Fraser [Tue, 4 Mar 2008 11:20:22 +0000 (11:20 +0000)]
x86: Clean up FPU code style and add a comment about FNSAVE/FWAIT
instruction pair.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: On CPU shutdown, clear pending FPU exceptions.
Keir Fraser [Tue, 4 Mar 2008 10:33:50 +0000 (10:33 +0000)]
x86: On CPU shutdown, clear pending FPU exceptions.
I've seen at least one BIOS which fails warm reboot if FPU exceptions
are pending.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86_emulate: Emit emulated forms of most FPU instructions as '.byte
Keir Fraser [Tue, 4 Mar 2008 10:32:13 +0000 (10:32 +0000)]
x86_emulate: Emit emulated forms of most FPU instructions as '.byte
xx,yy'. This is arguably clearer than using the mnemonic opcode, since
it is more clearly the instruction we have just decoded. Furthermore,
gas likes to reverse FPU operands on some two-operand FPU instructions
for historical reasons. Finally, 'byte xx,yy' is potentially more
amenable to further macro-isation down the road.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: Fix 2nd argument value of arg_check() for a few xm commands.
Keir Fraser [Tue, 4 Mar 2008 09:35:08 +0000 (09:35 +0000)]
xm: Fix 2nd argument value of arg_check() for a few xm commands.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agohvm emulate: Correctly probe when we are in 64-bit mode and set
Keir Fraser [Mon, 3 Mar 2008 15:19:39 +0000 (15:19 +0000)]
hvm emulate: Correctly probe when we are in 64-bit mode and set
address-size default appropriately.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Fix segfault when creating qcow-backed vbds.
Keir Fraser [Mon, 3 Mar 2008 13:54:05 +0000 (13:54 +0000)]
ioemu: Fix segfault when creating qcow-backed vbds.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: xenfb shared memory patch
Keir Fraser [Mon, 3 Mar 2008 13:19:44 +0000 (13:19 +0000)]
ioemu: xenfb shared memory patch

Share the internal xenfb backend buffer with sdl or vnc. All the
needed functions are already in place because have been implemented
for the previous cirrus vga shared memory patch.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agox86_emulate: More FPU instructions.
Keir Fraser [Mon, 3 Mar 2008 13:13:55 +0000 (13:13 +0000)]
x86_emulate: More FPU instructions.

Enables booting OS/2 as a HVM guest on Intel/VT hardware with full
real-mode emulation (no vmxassist).

Signed-off-by: Trolle Selander <trolle.selander@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86_emulate: INS/OUTS need Mov attribute to force writeback (since
Keir Fraser [Mon, 3 Mar 2008 11:47:40 +0000 (11:47 +0000)]
x86_emulate: INS/OUTS need Mov attribute to force writeback (since
dst.orig_val is not initialised). Also, Mov attribute on cmpxchg is
not necessary -- when destination is memory (i.e., successful cmpxchg)
then dst.orig_val is already correctly filled in. In case that
dst.orig_val == dst.val then the instruction linearises at the point
we first read the destination (and initialised dst.orig_val).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix xm vcpu-pin for inactive managed domains
Keir Fraser [Mon, 3 Mar 2008 11:09:33 +0000 (11:09 +0000)]
Fix xm vcpu-pin for inactive managed domains

We cannot currently change cpu affinity definitions of inactive
managed domains by xm vcpu-pin command. This patch enables changing
cpu affinity definitions of inactive managed domains. However, we
cannot change cpu affinity definitions to each vcpu because we cannot
currently define cpu affinity definitions to each vcpu to domain
configuration definitions.  Therefore, we need to specify 'all' to
VCPU argument of xm vcpu-pin command.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoblktapctrl: Fix a potential device minor number leak.
Keir Fraser [Mon, 3 Mar 2008 11:08:10 +0000 (11:08 +0000)]
blktapctrl: Fix a potential device minor number leak.
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoioemu: sdl blitting
Keir Fraser [Mon, 3 Mar 2008 11:06:31 +0000 (11:06 +0000)]
ioemu: sdl blitting

Right now qemu takes care of converting pixels between the guest pixel
format and the sdl pixel format, after that qemu also memcpy the
converted pixels to the sdl buffer in video ram. This process can be
improved using the SDL blit capabilities: the patch I am attaching
creates an SDL Surface from the Cirrus VGA framebuffer and uses SDL
blitting functions to convert and write pixels to video ram. SDL
blitting functions are optimized and can even be hardware accelerated
on some platforms.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoioemu: fix xenfb slow case update by shifting to the left before
Keir Fraser [Mon, 3 Mar 2008 11:05:18 +0000 (11:05 +0000)]
ioemu: fix xenfb slow case update by shifting to the left before
masking low bits instead of shifting to the right and masking high
bits. Also adds 24bpp support.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agomini-os: fbfront shouldn't send unsolicited updates
Keir Fraser [Mon, 3 Mar 2008 11:04:53 +0000 (11:04 +0000)]
mini-os: fbfront shouldn't send unsolicited updates

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoReally delete xen/common/compat/kexec.c
Keir Fraser [Mon, 3 Mar 2008 11:02:58 +0000 (11:02 +0000)]
Really delete xen/common/compat/kexec.c

17 years agokexec: Remove xen/common/compat/kexec.c
Keir Fraser [Mon, 3 Mar 2008 10:59:03 +0000 (10:59 +0000)]
kexec: Remove xen/common/compat/kexec.c

xen/common/compat/kexec.c and and the resulting two-pass build
of xen/common/kexec.c is no longer needed.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agokexec: Add explicit kexec_load_unload_compat()
Keir Fraser [Mon, 3 Mar 2008 10:58:06 +0000 (10:58 +0000)]
kexec: Add explicit kexec_load_unload_compat()

Add an explicit kexec_load_unload_compat() using the same method
that was used to create kexec_range_compat()

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agokexec: Add XLAT_kexec_range
Keir Fraser [Mon, 3 Mar 2008 10:56:09 +0000 (10:56 +0000)]
kexec: Add XLAT_kexec_range

Add XLAT_kexec_range and use it to translate between xen_kexec_range_t
and compat_kexec_range_t. I missed this in my previous patche which
created the explicit definition of kexec_get_range_compat().

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agokexec: Include compat/kexec.h early
Keir Fraser [Mon, 3 Mar 2008 10:55:42 +0000 (10:55 +0000)]
kexec: Include compat/kexec.h early

Include compat/kexec.h at the top of xen/common/kexec.c to allow
kexec_get_range_compat() to be compiled outside of #ifndef COMPAT.

This will slightly simplify the explicit creation of other _compat()
functions and is needed for the eventual removal of
xen/common/compat/kexec.c

Note that the inclusion of compat/kexec.h needs to be protected
by #ifdef CONFIG_COMPAT, as the file doesn't exist otherwise.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agoxm-test: Have domains deleted if they are managed domains
Keir Fraser [Mon, 3 Mar 2008 10:54:24 +0000 (10:54 +0000)]
xm-test: Have domains deleted if they are managed domains

Have the domains deleted if they are managed by xend and the tests are
run with '-md' as parameter to runtest.sh.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoTPM emulator: HMAC calculation fix for response from TPM_LoadKey2
Keir Fraser [Mon, 3 Mar 2008 10:53:43 +0000 (10:53 +0000)]
TPM emulator: HMAC calculation fix for response from TPM_LoadKey2
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agomerge with xen-unstable.hg
Alex Williamson [Fri, 29 Feb 2008 16:19:58 +0000 (09:19 -0700)]
merge with xen-unstable.hg

17 years ago[IA64] kexec: Unpin TLB in the hypervisor
Alex Williamson [Fri, 29 Feb 2008 16:18:01 +0000 (09:18 -0700)]
[IA64] kexec: Unpin TLB in the hypervisor

The dom0 relocate_new_kernel code makes a large number of assumptions about
various compile time constants, and thus assumes that these constants are
the same for the hypervisor and dom0. Despite extensive #ifdef work this
has proved to be both fragile and incomplete.

This patch changes things around so that the unpinning work is done
by code provided by the hypervisor, reusing existing code there.
Apart from being a solution that works, its also likely
a much more maintainable solution, as as TLB changes in the hypervisor
code are made, the code paths in the hypervisor are much more likely
to be checked than this one which lies in a completely different tree.

There is also a dom0 Linux kernel portion to this patch.
Its commit message has comments detailing various implementation
issues. See linux-2.6.18-xen.hg ee7015727bd15e80e17e725f70c0a5336e45607a

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agoPV-on-HVM: Fix __xen_suspend() for changed XenLinux interface.
Keir Fraser [Fri, 29 Feb 2008 10:30:28 +0000 (10:30 +0000)]
PV-on-HVM: Fix __xen_suspend() for changed XenLinux interface.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoShadow audit: paging-disabled shadows no longer need special treatment
Keir Fraser [Thu, 28 Feb 2008 16:02:44 +0000 (16:02 +0000)]
Shadow audit: paging-disabled shadows no longer need special treatment
when translating the frame numbers found in the entries.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agox86 shadow: shadow_check_gwalk() must sh_unmap_domain_page() each page
Keir Fraser [Thu, 28 Feb 2008 16:02:00 +0000 (16:02 +0000)]
x86 shadow: shadow_check_gwalk() must sh_unmap_domain_page() each page
it temporarily maps.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix x86 build.
Keir Fraser [Thu, 28 Feb 2008 15:03:33 +0000 (15:03 +0000)]
Fix x86 build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: Fix compilation after abs_z to rel_z change
Keir Fraser [Thu, 28 Feb 2008 14:09:47 +0000 (14:09 +0000)]
stubdom: Fix compilation after abs_z to rel_z change
From: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoNUMA node migration
Keir Fraser [Thu, 28 Feb 2008 13:44:28 +0000 (13:44 +0000)]
NUMA node migration

Adds NUMA node migration based on live migration to
xend. By adding another parameter to "xm migrate" the target NUMA node
number gets propagated to the target host (can be both localhost or a
remote host). The restore function then sets the VCPU affinity
accordingly. Only changes Python code in xend. I hope that the patch
doesn't break XenAPI compatibility (adding a parameter seems fine?).

# xm migrate --live --node=<nodenr> <domid> localhost
<nodenr> is the number as shown with 'xm info' under node_to_cpu

I am aware that using live migration isn't the best approach (takes
twice the memory and quite some time), but it's less intrusive and
works fine (given localhost migration stability...)

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
17 years agox86 shadow: Audit tables and guest walk when we know they are consistent.
Keir Fraser [Thu, 28 Feb 2008 13:40:30 +0000 (13:40 +0000)]
x86 shadow: Audit tables and guest walk when we know they are consistent.
From: Gianluca Guida <gianluca.guida@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAdd ACPI tables support for AMD IOMMU
Keir Fraser [Thu, 28 Feb 2008 13:21:49 +0000 (13:21 +0000)]
Add ACPI tables support for AMD IOMMU

Configuration information for AMD IOMMU control fields are descirbed
by I/O virtualization Reporting Structure (IVRS) table, this patch set
parses IVRS table and updates iommu control flags according to the result.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoblktap: Fix unused warnings in block-qcow2.c with -D_FORTIFY_SOURCE=2.
Keir Fraser [Thu, 28 Feb 2008 13:19:38 +0000 (13:19 +0000)]
blktap: Fix unused warnings in block-qcow2.c with -D_FORTIFY_SOURCE=2.
Signed-off-by: Kevin Wolf <kwolf@suse.de>
17 years agox86 shadow: Remove lock on first guest table walk.
Keir Fraser [Thu, 28 Feb 2008 13:18:29 +0000 (13:18 +0000)]
x86 shadow: Remove lock on first guest table walk.

Existing shadow fault path grabs big lock before walking
guest tables, to ensure consistency with shadow content
lest concurrent change from other vcpu in a bad OS.
But this lock brings more lock contention when scaled up
for a good guest which already prevents above case happen.
So this patch tries to remove the lock on first guest
table walk, and then delay check at some special points.

The key is to check whether any guest table update happens
between 1st walk and holding shadow lock. Here we take
two hints for guest table update:
    * write permission removal
    * write emulation
If any above two operations are observed within the race
window, it indicates possiblity that previous walk result
may be inaccurate and re-check is requried. If mismatch,
simply return to trigger another fault.

I made some experiment to sample perfc count:
<64bit guest>
3.7% of gwalks are re-checked
For re-check, 68% comes from write permission removal
<32bit pae guest>
7.2% of gwalks are re-checked
For re-check, 54.9% comes from write permission removal

Actually previous fast emulation optimization already skip
lots of guest table walks, and thus above ratio can be
smaller if compared to total shadow fault count.

Basically shadow promotion with write permision removal
does suffer higher overhead, but the benefit to reduce
lock contention is more obvious.

Improvement on kernel compile for this patch is:
(64bit Xen)
32bit guest: 1.1%
pae guest:   0.4%
64bit guest: 0.5%

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

17 years agostubdom: fix mini-os messages log and SDL termination
Keir Fraser [Thu, 28 Feb 2008 13:10:28 +0000 (13:10 +0000)]
stubdom: fix mini-os messages log and SDL termination

We can now let the stubdom-dm script output mini-os messages to
stdout/err so that it gets output to the new
/var/log/xen/qemu-dm-$domname.log

In the SDL case, we must not wait for the VNC server port to appear,
as it won't ever.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoRename struct xenkbd_position member abs_z to rel_z. Z-axis motion is
Keir Fraser [Thu, 28 Feb 2008 13:09:28 +0000 (13:09 +0000)]
Rename struct xenkbd_position member abs_z to rel_z. Z-axis motion is
relative, not absolute.
From: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agokexec: extend hypercall for efi memory map, boot parameter and xenheap regions
Keir Fraser [Thu, 28 Feb 2008 10:48:42 +0000 (10:48 +0000)]
kexec: extend hypercall for efi memory map, boot parameter and xenheap regions

Extend the kexec hypercall to allow it to return the efi memory map,
boot parameter and xen heap regions.

The efi memory map and boot parameter regions need to be supplied
by xen to dom0, rather than established by dom0 as dom0's memory
is not machine memory and thus the regions are not in the correct
location. These regions are inserted into machine_iomem by dom0.

The xen heap region is needed as on xen the hypervisor code and
heap exist in two different EFI memory regions, which are
reflected in machine_iomem. Thus a single xen code region can't be
inserted into machine_iomem.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agokexec: Add machine_kexec_get()
Keir Fraser [Thu, 28 Feb 2008 10:46:27 +0000 (10:46 +0000)]
kexec: Add machine_kexec_get()

Introduce machine_kexec_get to allow architecture-specific handling of
the xen region. x86_64 is currently different to x86_32 and ia64.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agokexec: limit scope of the use of compat_kexec_range_t
Keir Fraser [Thu, 28 Feb 2008 10:45:47 +0000 (10:45 +0000)]
kexec: limit scope of the use of compat_kexec_range_t

Unless I am mistaken, the compat functions are provided a stable ABI.
This includes providing a stable version of xen_kexec_range_t in the
form of compat_kexec_range_t.  However, internally it doesn't really
matter how xen represents the data.

Currently the code provides for the creation of a compat version of
all kexec range functions, which use the compat_kexec_range_t
function. This is difficult to extend if range code exists outside of
xen/common/kexec.c.

The existence of "#ifdef CONFIG_X86_64" in the code suggests that some
of the range code might be better off in architecture specific code.
Furthermore, subsequent patches will introduce ia64-specific range
handling code, which really would be much better off somewhere in
arch/ia64/.

With this in mind, the handling of compat_kexec_range_t is changed
such that the code which reads and returns data from user-space
translates between compat_kexec_range_t and xen_kexec_range_t.  As,
padding aside, the two structures are currently the same this is quite
easy. Things may get more tricky in the future, but I don't believe
this change is likely to make things significantly worse (or better)
in that regard. In any case, refactoring can occur again as required.

Signed-off-by: Simon Horman <horms@verge.net.au>
17 years agoxend: Remove duplicate setResume() method.
Keir Fraser [Thu, 28 Feb 2008 10:31:45 +0000 (10:31 +0000)]
xend: Remove duplicate setResume() method.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoFix error message of xm suspend and xm resume for Domain-0.
Keir Fraser [Thu, 28 Feb 2008 10:30:21 +0000 (10:30 +0000)]
Fix error message of xm suspend and xm resume for Domain-0.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoioemu: Send logs to stderr and have xend redirect stderr to the
Keir Fraser [Thu, 28 Feb 2008 10:29:25 +0000 (10:29 +0000)]
ioemu: Send logs to stderr and have xend redirect stderr to the
correct log file.

At the same time, this patch renames the logfile to be
'qemu-dm-{NAME}.log' instead of qemu-dm-{ID}.log.  This makes it
easier to track/find the QEMU logfile associated with a VM. It will
also save 1 backup qemu-dm-{NAME}.log.1 so if a domain crashes &
restart, you don't loose/overwrite the logfile immediately.

Finally it changes the QEMU monitor prompt back to '(qemu)' instead of
'(HVMXen)' because automated tools /scripts interacting with QEMU's
monitor need a consistent prompt to look for & changing it for Xen
serves no useful purpose.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agostubdom: use PVFB so as to e.g. permit SDL display
Keir Fraser [Thu, 28 Feb 2008 10:21:21 +0000 (10:21 +0000)]
stubdom: use PVFB so as to e.g. permit SDL display

This adds support in ioemu for PVFB frontend as stubdomain display.
This permits for instance to use SDL in dom0 to perform the eventual
display.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoFix non-portability in xentrace
Keir Fraser [Thu, 28 Feb 2008 10:19:49 +0000 (10:19 +0000)]
Fix non-portability in xentrace

Replace statfs() with the equivalent statvfs(), and correct the block
size multiplier.

Signed-off-by: John Levon <john.levon@sun.com>
17 years ago[IA64] Updating collision chain length in VHPT is not necessary
Alex Williamson [Wed, 27 Feb 2008 20:08:59 +0000 (13:08 -0700)]
[IA64] Updating collision chain length in VHPT is not necessary

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoioemu: Expandable storage backends should defeat block-device range checks.
Keir Fraser [Wed, 27 Feb 2008 13:21:36 +0000 (13:21 +0000)]
ioemu: Expandable storage backends should defeat block-device range checks.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agoFix xm save command's #params check.
Keir Fraser [Wed, 27 Feb 2008 13:19:42 +0000 (13:19 +0000)]
Fix xm save command's #params check.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxend: Set default vcpu affinity for better performance in NUMA systems.
Keir Fraser [Wed, 27 Feb 2008 13:17:49 +0000 (13:17 +0000)]
xend: Set default vcpu affinity for better performance in NUMA systems.
Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
17 years agoioemu: Fix e1000 mmio range size.
Keir Fraser [Wed, 27 Feb 2008 13:16:02 +0000 (13:16 +0000)]
ioemu: Fix e1000 mmio range size.

Per Intel 82540EM Software Developer's Manual pp. 211, the mmio size
is 0x20000, or address overlapping occurs and causes the second card
to fail, which happened to me earlier.

From: Tina Yang <tina.yang@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agominios: have xenbus_printf return the error returned by xenbus_write
Keir Fraser [Wed, 27 Feb 2008 13:11:33 +0000 (13:11 +0000)]
minios: have xenbus_printf return the error returned by xenbus_write
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoFix libxenstat on Solaris
Keir Fraser [Wed, 27 Feb 2008 13:10:42 +0000 (13:10 +0000)]
Fix libxenstat on Solaris

Recent Solaris enhancements have changed the way virtual NIC
statistics are collected - fix libxenstat up for this.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agomerge with xen-unstable.hg
Alex Williamson [Tue, 26 Feb 2008 17:12:04 +0000 (10:12 -0700)]
merge with xen-unstable.hg

17 years agostubdom: log and documentation fixes
Keir Fraser [Tue, 26 Feb 2008 15:11:51 +0000 (15:11 +0000)]
stubdom: log and documentation fixes

- Document that for vnclisten names and 127.0.0.1 should not be used.
- Documentation cosmetic fixes
- Dump qemu output to the usual logs

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fix x86_32 compilation by __moddi3 from FreeBSD
Keir Fraser [Tue, 26 Feb 2008 15:11:07 +0000 (15:11 +0000)]
stubdom: fix x86_32 compilation by __moddi3 from FreeBSD
(like has been done previously for umoddi3 etc.)

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoFix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Keir Fraser [Tue, 26 Feb 2008 15:02:26 +0000 (15:02 +0000)]
Fix xm mem-max command to restore previous setting if xc.domain_setmaxmem fails.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxend: Add free memory size of every node in physinfo to help user to
Keir Fraser [Tue, 26 Feb 2008 15:00:08 +0000 (15:00 +0000)]
xend: Add free memory size of every node in physinfo to help user to
get usage of memory of their NUMA machine.

Signed-off-by: Duan Ronghui <ronghui.duan@intel.com>
17 years agoioemu: VNC updates should be sent only when requested.
Keir Fraser [Tue, 26 Feb 2008 14:50:45 +0000 (14:50 +0000)]
ioemu: VNC updates should be sent only when requested.

Reading qemu code I realized that the qemu vnc server sometimes sends
framebuffer updates even if the client didn't request any. This is not
consistent with the RFB protocol spec and can break some clients.
This patch strictly enforces compliance with the RFB protocol making
sure framebuffer updates are sent only if the client requested one.
Doing so is more difficult than it seems because some framebuffer
pseudo-encoding updates cannot be discarded but must be sent anyway:
for example desktop resize and pixel format change messages. To solve
the problem I wrote a queue that stores those messages and sends them
as soon as the client asks for an update. Since 90% of the times the
queue is used to store only few elements, the queue allocates 10
elements at the beginning and every time it runs out of elements
allocates other 10 elements. This is should drastically limit the
number of malloc and free needed to maintain the queue. I did some
stress tests in the last couple of days and seems to work well.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agominios: add PVFB support
Keir Fraser [Tue, 26 Feb 2008 14:47:23 +0000 (14:47 +0000)]
minios: add PVFB support
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: Do not sue xce_handle directly as a file descriptor.
Keir Fraser [Tue, 26 Feb 2008 14:46:57 +0000 (14:46 +0000)]
ioemu: Do not sue xce_handle directly as a file descriptor.

xce handles are not supposed to be used as file descriptors, but
xc_evtchn_fd() be used.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86_emulate: Fix FNSTCW/FNSTSW modrm range check.
Keir Fraser [Tue, 26 Feb 2008 14:46:07 +0000 (14:46 +0000)]
x86_emulate: Fix FNSTCW/FNSTSW modrm range check.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86 hvm: Fix bugzilla bug 1172.
Keir Fraser [Tue, 26 Feb 2008 14:40:44 +0000 (14:40 +0000)]
x86 hvm: Fix bugzilla bug 1172.

Bug 1172 is caused by missing a type cast from mfn_t to paddr_t, when
in pae mode and hsot memory is larger than 4G.

Signed-off-by: Disheng Su <disheng.su@intel.com>
17 years agoxentrace: Add a time parameter
Keir Fraser [Tue, 26 Feb 2008 14:39:26 +0000 (14:39 +0000)]
xentrace: Add a time parameter
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoxentrace: Disable tracing by default on exit
Keir Fraser [Tue, 26 Feb 2008 14:39:11 +0000 (14:39 +0000)]
xentrace: Disable tracing by default on exit
Includes an option to disable this behavior.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoxentrace: Add option to reserve disk space
Keir Fraser [Tue, 26 Feb 2008 14:38:57 +0000 (14:38 +0000)]
xentrace: Add option to reserve disk space
Before writing records, xentrace will check to make sure that there is
a minimum amount of space left on the output filesystem.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoxentrace: Fix --discard-buffers option
Keir Fraser [Tue, 26 Feb 2008 14:38:39 +0000 (14:38 +0000)]
xentrace: Fix --discard-buffers option
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
17 years agoioemu: e1000 emulation
Keir Fraser [Tue, 26 Feb 2008 14:37:44 +0000 (14:37 +0000)]
ioemu: e1000 emulation

This is a direct port of the e1000 driver currently in Qemu CVS with
extremely minimal changes.  This is useful for Xen as new OSes may not
support the old 100Mbps NICs we currently support (especially on
non-x86).  Drivers for e1000 should be more readily available.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
17 years agoFix restore of saved image containing rtc_timeoffset
Keir Fraser [Tue, 26 Feb 2008 14:35:39 +0000 (14:35 +0000)]
Fix restore of saved image containing rtc_timeoffset

Saved images contain rtc_timeoffset as a string value, resulting in a
TypeError exception when calling xc.domain_set_time_offset() on
restore.  Cast rtc_timeoffset to int before calling
xc.domain_set_time_offset().

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agovtpm: script function for identifying vTPM by its UUID
Keir Fraser [Tue, 26 Feb 2008 14:34:50 +0000 (14:34 +0000)]
vtpm: script function for identifying vTPM by its UUID

I am adding some functions for external tools to call the vTPM scripts.
It also contains a fix for the functions that previously used to be
called by domain name, but now are using the vTPM's uuid as parameter.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agostubdom: Disable PCI passthrough functionality for now.
Keir Fraser [Mon, 25 Feb 2008 16:34:49 +0000 (16:34 +0000)]
stubdom: Disable PCI passthrough functionality for now.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>