]> xenbits.xensource.com Git - xen.git/log
xen.git
13 years agoUpdate Xen version to 4.1.1-rc1 4.1.1-rc1
Keir Fraser [Sat, 21 May 2011 06:58:11 +0000 (07:58 +0100)]
Update Xen version to 4.1.1-rc1

13 years agogcc-4.6 compile fix: build with -Wno-unused-but-set-variable
Olaf Hering [Sat, 21 May 2011 06:56:28 +0000 (07:56 +0100)]
gcc-4.6 compile fix: build with -Wno-unused-but-set-variable

Avoid "error: variable 'unused' set but not used
[-Werror=unused-but-set-variable]" with gcc 4.6.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
xen-unstable changeset:   23368:0f670f5146c8
xen-unstable date:        Sat May 21 07:55:46 2011 +0100

13 years agox86/mca: Fix debug output.
Liu, Jinsong [Fri, 20 May 2011 12:50:33 +0000 (13:50 +0100)]
x86/mca: Fix debug output.

At x86_mcinfo_dump(), a little bug at printk information,
illusively= indicate an CMCI/POLLED error to a MCE error, this will
make debug confusing.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23362:c2a55fe9c006
xen-unstable date:        Fri May 20 13:42:23 2011 +0100

13 years agox86/AMD: don't set ARAT feature flag on family F CPUs
Jan Beulich [Fri, 20 May 2011 12:50:05 +0000 (13:50 +0100)]
x86/AMD: don't set ARAT feature flag on family F CPUs

Following Linux commit 14fb57dccb6e1defe9f89a66f548fcb24c374c1d from
Borislav Petkov.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23356:c8f00ee51e15
xen-unstable date:        Fri May 20 09:11:54 2011 +0100

13 years agox86: clear CPUID output of leaf 0xd for Dom0 when xsave is disabled
Jan Beulich [Fri, 20 May 2011 12:49:36 +0000 (13:49 +0100)]
x86: clear CPUID output of leaf 0xd for Dom0 when xsave is disabled

Linux starting with 2.6.36 uses the XSAVEOPT instruction and has
certain code paths that look only at the feature bit reported through
CPUID leaf 0xd sub-leaf 1 (i.e. without qualifying the check with one
evaluating leaf 4 output). Consequently the hypervisor ought to mimic
actual hardware in clearing leaf 0xd output when not supporting xsave.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23353:a768a10d32b4
xen-unstable date:        Fri May 20 08:54:45 2011 +0100

13 years agopci_remove_device: fix linked list discipline
Tim Deegan [Fri, 20 May 2011 12:48:40 +0000 (13:48 +0100)]
pci_remove_device: fix linked list discipline

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23352:ea48976517af
xen-unstable date:        Fri May 20 08:52:22 2011 +0100

13 years agoMakefile: install-tools does not depend on ioemu-dir if CONFIG_IOEMU=n
Keir Fraser [Fri, 20 May 2011 12:48:07 +0000 (13:48 +0100)]
Makefile: install-tools does not depend on ioemu-dir if CONFIG_IOEMU=n

Based on patch by George Dunlap.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23351:0e9322ece398
xen-unstable date:        Fri May 20 08:48:33 2011 +0100

13 years agox86/mm: add HVMOP_get_mem_type hvmop
Olaf Hering [Fri, 20 May 2011 12:47:08 +0000 (13:47 +0100)]
x86/mm: add HVMOP_get_mem_type hvmop

The balloon driver in the guest frees guest pages and marks them as
mmio. When the kernel crashes and the crash kernel attempts to read
the
oldmem via /proc/vmcore a read from ballooned pages will generate 100%
load in dom0 because Xen asks qemu-dm for the page content. Since the
reads come in as 8byte requests each ballooned page is tried 512
times.

Add a new hvmop HVMOP_get_mem_type to return the hvmmem_type_t for the
given pfn. Pages which are neither ram or mmio will be HVMMEM_mmio_dm.
This interface enables the crash kernel to skip ballooned pages.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23298:26413986e6e0
xen-unstable date:        Wed May 04 13:37:58 2011 +0100

13 years agox86-64: remove left over uses of .got entries
Jan Beulich [Mon, 16 May 2011 12:38:56 +0000 (13:38 +0100)]
x86-64: remove left over uses of .got entries

These were caused by some declarations happening before the compiler
would have seen the visibility pragma.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23345:ba4bd20e581a
xen-unstable date:        Mon May 16 13:32:37 2011 +0100

13 years agoVT-d: Fix resource leaks on error paths
Igor Mammedov [Mon, 16 May 2011 12:38:09 +0000 (13:38 +0100)]
VT-d: Fix resource leaks on error paths

On error exit from functions, maped pages should be unmapped
and acquired locks released.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Allen Kay <allen.m.kay@intel.com>
xen-unstable changeset:   23343:edcf8fc77b64
xen-unstable date:        Mon May 16 13:29:24 2011 +0100

13 years agox86/tsc: Remove incorrect assertion from cstate_restore_tsc()...
Keir Fraser [Mon, 16 May 2011 12:37:28 +0000 (13:37 +0100)]
x86/tsc: Remove incorrect assertion from cstate_restore_tsc()...

..fix and move to write_tsc().

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23342:16d12acccacf
xen-unstable date:        Mon May 16 13:24:05 2011 +0100

13 years agox86/ioapic: avoid gcc 4.6 warnings about uninitialised variables
Ian Campbell [Mon, 16 May 2011 12:36:45 +0000 (13:36 +0100)]
x86/ioapic: avoid gcc 4.6 warnings about uninitialised variables

gcc 4.6 complains:
        io_apic.c: In function 'restore_IO_APIC_setup':
        /build/user-xen_4.1.0-3-amd64-zSon7K/xen-4.1.0/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/io_apic.h:150:26:
        error: '*((void *)&entry+4)' may be used uninitialized in this
        function [-Werror=uninitialized]
        io_apic.c:221:32: note: '*((void *)&entry+4)' was declared
        here
        /build/user-xen_4.1.0-3-amd64-zSon7K/xen-4.1.0/debian/build/build-hypervisor_amd64_amd64/xen/include/asm/io_apic.h:150:26:
        error: 'entry' may be used uninitialized in this function
        [-Werror=uninitialized]
        io_apic.c:221:32: note: 'entry' was declared here
        cc1: all warnings being treated as errors

Add functions to read/write an entire IO APIC entry using an explicit
union to allow gcc to spot the initialisation.

Reported as Debian bug #625438, thanks to Matthias Klose.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23341:87084ca76c9c
xen-unstable date:        Mon May 16 13:13:41 2011 +0100

14 years agox86: Check for valid pirq values in hvm_domain_use_pirq
Stefano Stabellini [Thu, 12 May 2011 17:04:14 +0000 (18:04 +0100)]
x86: Check for valid pirq values in hvm_domain_use_pirq

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset:   23339:f9bb0bbea7c2
xen-unstable date:        Thu May 12 16:42:54 2011 +0100

14 years agox86, vtd: [CVE-2011-1898] Protect against malicious MSIs from untrusted devices.
Keir Fraser [Thu, 12 May 2011 17:03:47 +0000 (18:03 +0100)]
x86, vtd: [CVE-2011-1898] Protect against malicious MSIs from untrusted devices.

In the absence of VT-d interrupt remapping support, a device can send
arbitrary APIC messages to host CPUs. One class of attack that results
is to confuse the hypervisor by delivering asynchronous interrupts to
vectors that are expected to handle only synchronous
traps/exceptions.

We block this class of attack by:
(1) setting APIC.TPR=0x10, to block all interrupts below vector
0x20. This blocks delivery to all architectural exception vectors.
(2) checking APIC.ISR[vec] for vectors 0x80 (fast syscall) and 0x82
(hypercall). In these cases we BUG if we detect we are handling a
hardware interrupt -- turning a potentially more severe infiltration
into a straightforward system crash (i.e, DoS).

Thanks to Invisible Things Lab <http://www.invisiblethingslab.com>
for discovery and detailed investigation of this attack.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23337:cc91832a02c7
xen-unstable date:        Thu May 12 16:39:31 2011 +0100

14 years agox86/hvm: pv-on-hvm: fix de/assert_irq checks
Stefano Stabellini [Thu, 12 May 2011 08:20:09 +0000 (09:20 +0100)]
x86/hvm: pv-on-hvm: fix de/assert_irq checks

The checks in assert_irq and deassert_irq to distinguish interrupts
that have been remapped onto event channels from the others that have
to be injected using the emulated lapic are wrong.

Fix the condition checks using the convenient hvm_domain_use_pirq
function.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset:   23335:0957e0c5f0e4
xen-unstable date:        Thu May 12 09:15:05 2011 +0100

14 years agox86: use compat hypercall handlers for calls from 32-bit HVM guests
Tim Deegan [Thu, 12 May 2011 08:19:29 +0000 (09:19 +0100)]
x86: use compat hypercall handlers for calls from 32-bit HVM guests

On 64-bit Xen, hypercalls from 32-bit HVM guests are handled as
a special case, but not all the hypercalls are corrently redirected
to their compat-mode wrappers.  Use compat_* for xen_version,
sched_op and set_timer_op for consistency.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23333:fabdd682420c
xen-unstable date:        Thu May 12 09:13:18 2011 +0100

14 years agotools/xm-test: portability fix: Avoid using == in /bin/sh script
Christoph Egger [Thu, 12 May 2011 08:18:42 +0000 (09:18 +0100)]
tools/xm-test: portability fix: Avoid using == in /bin/sh script

From: David Brownlee <abs@netbsd.org>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen-unstable changeset:   23328:6767d92dff13
xen-unstable date:        Thu May 12 08:55:12 2011 +0100

14 years agolibxc: [CVE-2011-1583] pv kernel image validation
Ian Jackson [Mon, 9 May 2011 14:04:01 +0000 (15:04 +0100)]
libxc: [CVE-2011-1583] pv kernel image validation

The functions which interpret the kernel image supplied for a
paravirtualised guest, and decompress it into memory when booting the
domain, are incautious.  Specifically:

 (i) Integer overflow in the decompression loop memory allocator might
    result in overrunning the buffer used for the decompressed image;
 (ii) Integer overflows and lack of checking of certain length fields
    can result in the loader reading its own address space beyond the
    size of the supplied kernel image file.
 (iii) Lack of error checking in the decompression loop can lead to an
    infinite loop.

This patch fixes these problems.

CVE-2011-1583.

Signed-off-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agotools/tests/xen-access: minor bug fixes
Aravindh Puthiyaparambil [Mon, 9 May 2011 11:18:50 +0000 (12:18 +0100)]
tools/tests/xen-access: minor bug fixes

Fix a couple of minor bugs in xen-access test program:
 * Fix -m option handling.
 * Fix a segfault that was occurring during program exit.

Signed-off-by: Aravindh Puthiyaparambil <aravindh@virtuata.com>
xen-unstable changeset:   23307:1649275965f0
xen-unstable date:        Mon May 09 09:56:39 2011 +0100

14 years agox86: set ARAT feature flag for non-buggy AMD CPUs
Jan Beulich [Mon, 9 May 2011 11:18:14 +0000 (12:18 +0100)]
x86: set ARAT feature flag for non-buggy AMD CPUs

This is the equivalent of a recent Linux change.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23290:1ac7336b6298
xen-unstable date:        Sun May 01 10:14:15 2011 +0100

14 years agoClean up licensing in the public header directory.
Keir Fraser [Mon, 9 May 2011 11:17:17 +0000 (12:17 +0100)]
Clean up licensing in the public header directory.

The COPYING file at xen/include/public/COPYING clearly states that all
public header files are distributed under a permissive MIT
license. Therefore make sure the same permissive license is included
at the top of every header file (i.e., not GPL).

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23286:6f48f5f843f0
xen-unstable date:        Sun May 01 10:08:40 2011 +0100

public/arch-ia64/debug_op.h: Reinsert copyright that I accidentally
deleted.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23294:c0a8f889ca9e
xen-unstable date:        Sun May 01 13:03:37 2011 +0100

14 years agox86: Clean up smp_call_function handling.
Keir Fraser [Mon, 9 May 2011 11:16:34 +0000 (12:16 +0100)]
x86: Clean up smp_call_function handling.

We don't need so many communication fields between caller and
handler.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23285:a7ac0a0170b0
xen-unstable date:        Sun May 01 09:32:48 2011 +0100

14 years agocredit2: add a callback to migrate to a new cpu
Keir Fraser [Wed, 27 Apr 2011 12:38:08 +0000 (13:38 +0100)]
credit2: add a callback to migrate to a new cpu

In credit2, there needs to be a strong correlation between
v->processor and the runqueue to which a vcpu is assigned;
much of the code relies on this invariant.  Allow credit2
to manage the actual migration itself.

This fixes the most recent credit2 bug reported on the list
(Xen BUG at sched_credit2.c:1606) in Xen 4.1, as well as
the bug at sched_credit2.c:811 in -unstable (which catches the
same condition earlier).

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   23250:7745109e3c6e
xen-unstable date:        Wed Apr 27 13:36:15 2011 +0100

14 years agocredit2: remove two nested functions, replacing them with static ones
Keir Fraser [Wed, 27 Apr 2011 12:37:47 +0000 (13:37 +0100)]
credit2: remove two nested functions, replacing them with static ones
and passing the outer scope's variables in explicitly.
This is needed to compile xen with clang.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   22982:591c459ee00a
xen-unstable date:        Mon Mar 07 11:21:11 2011 +0000

14 years agopv-grub: Fix for incorrect dom->p2m_host[] list initialization
Daniel Kiper [Wed, 27 Apr 2011 12:30:41 +0000 (13:30 +0100)]
pv-grub: Fix for incorrect dom->p2m_host[] list initialization

Introduction of Linux Kernel git commit
ceefccc93932b920a8ec6f35f596db05202a12fe (x86: default
CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN to 16 MB) revealed
deeply hidden bug in pv-grub. During kernel load stage dom->p2m_host[]
list has been incorrectly initialized.

At the beginning of kernel load stage dom->p2m_host[] list is
populated with current PFN->MFN layout. Later during memory allocation
(memory is allocated page by page in kexec_allocate()) page order is
changed to establish linear layout in new domain. It is done by
exchanging subsequent MFNs with newly allocated MFNs. dom->p2m_host[]
list is indexed by currently requested PFN (it is incremented from 0)
and PFN of newly allocated paged. If PFN of newly allocated page is
less than currently requested PFN then earlier allocated MFN is
overwritten which leads to domain crash later. This patch corrects
that issue. If PFN of newly allocated page is less then currently
requested PFN then relevant PFN/MFN pair is properly calculated and
usual exchange occurs later.

Signed-off-by: Daniel Kiper <dkiper@net-space.pl>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
xen-unstable changeset:   23249:83fe79c0225f
xen-unstable date:        Wed Apr 27 13:29:14 2011 +0100

14 years agox86: Bail from hpet_disable_legacy_broadcast() if legacy_hpet_event is uninitialised.
Keir Fraser [Tue, 26 Apr 2011 13:11:18 +0000 (14:11 +0100)]
x86: Bail from hpet_disable_legacy_broadcast() if legacy_hpet_event is uninitialised.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxc: Fill in XSAVE-related CPUID leaves for PV guests.
Keir Fraser [Mon, 25 Apr 2011 14:28:33 +0000 (15:28 +0100)]
libxc: Fill in XSAVE-related CPUID leaves for PV guests.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23248:16aac67e948c
xen-unstable date:        Mon Apr 25 15:27:56 2011 +0100

14 years agovtd: check and print EPT compatibility once, at boot.
Tim Deegan [Mon, 25 Apr 2011 12:38:51 +0000 (13:38 +0100)]
vtd: check and print EPT compatibility once, at boot.

Merge the check for EPT/VT-D pagetable compatibility into the other
VT-D boot-time checks.  Previously it was checking and printing many
times on each VM boot.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23247:80401982465d
xen-unstable date:        Mon Apr 25 13:17:05 2011 +0100

14 years agotools: hvmloader: attempt to SHUTDOWN_crash on BUG
Keir Fraser [Mon, 25 Apr 2011 12:34:20 +0000 (13:34 +0100)]
tools: hvmloader: attempt to SHUTDOWN_crash on BUG

Executing UD2 (invalid opcode) triggers a triple fault which signals
reboot to the toolstack, rather than crash.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23245:3539ef956a37
xen-unstable date:        Mon Apr 18 18:34:45 2011 +0100

14 years agohvmloader: Fix _start-relative calculation of hypercall page address.
Keir Fraser [Mon, 25 Apr 2011 12:33:29 +0000 (13:33 +0100)]
hvmloader: Fix _start-relative calculation of hypercall page address.

We got away with it because _start-HYPERCALL_PHYSICAL_ADDRESS happens
to equal HYPERCALL_PHYSICAL_ADDRESS.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23244:024b06de81ca
xen-unstable date:        Mon Apr 18 18:08:47 2011 +0100

14 years agox86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits
Keir Fraser [Mon, 25 Apr 2011 12:31:10 +0000 (13:31 +0100)]
x86: don't write_tsc() non-zero values on CPUs updating only the lower 32 bits

This means suppressing the uses in time_calibration_tsc_rendezvous(),
cstate_restore_tsc(), and synchronize_tsc_slave(), and fixes a boot
hang of Linux Dom0 when loading processor.ko on such systems that
have support for C states above C1.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23228:1329d99b4f16
xen-unstable date:        Fri Apr 15 08:52:08 2011 +0100

14 years agoremus: fix incorrect error handling for switch_qemu_logdirty in checkpoint code
Shriram Rajagopalan [Mon, 25 Apr 2011 12:29:18 +0000 (13:29 +0100)]
remus: fix incorrect error handling for switch_qemu_logdirty in checkpoint code

c/s 22275: "tools: cleanup domain save switch_qemu_logdirty callback"
introduced a whole bunch of error code fixups. In the process, it also
ended up treating the success return code (0) from
switch_qemu_logdirty as an error and vice versa.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
xen-unstable changeset:   23202:67911039ac94
xen-unstable date:        Tue Apr 12 13:28:51 2011 +0100

14 years agoAMD IOMMU: Fix an interrupt remapping issue
Wei Wang [Mon, 25 Apr 2011 12:28:17 +0000 (13:28 +0100)]
AMD IOMMU: Fix an interrupt remapping issue

Some device could generate bogus interrupts if an IO-APIC RTE and an
iommu interrupt remapping entry are not consistent during 2 adjacent
64bits IO-APIC RTE updates. For example, if the 2nd operation updates
destination bits in RTE for SATA device and unmask it, in some case,
SATA device will assert ioapic pin to generate interrupt immediately
using new destination but iommu could still translate it into the old
destination, then dom0 would be confused. To fix that, we sync up
interrupt remapping entry with IO-APIC IRE on every 32 bits operation
and forward IOAPIC RTE updates after interrupt.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Acked-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23200:995a0c01a076
xen-unstable date:        Tue Apr 12 13:26:19 2011 +0100

14 years agoremus: proper cleanup on checkpoint failure.
Shriram Rajagopalan [Mon, 25 Apr 2011 12:27:12 +0000 (13:27 +0100)]
remus: proper cleanup on checkpoint failure.

While running remus, when an error occurs during checkpointing
(e.g., timeouts on primary, failing to checkpoint network buffer
or disk or even communication failure) the domU is sometimes
left in suspended state on primary. Instead of blindly closing
the checkpoint file handle, attempt to resume the domain before
the close.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   23195:13ec53a59a42
xen-unstable date:        Fri Apr 08 16:49:04 2011 +0100

14 years agolibxc: set all VCPU's online by default in HVM info table
Gianni Tedesco [Thu, 7 Apr 2011 14:26:58 +0000 (15:26 +0100)]
libxc: set all VCPU's online by default in HVM info table

This sets a saner default for the cpu-online-map by setting all bits
to 1. The default assumption ought to be that nr-vcpus ==
nr-vcpus-at-start. If that is not true, then the toolstack must modify
the bitmap, but if it is true, the toolstack oughtn't need to do
anything further.

Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
xen-unstable changeset:   23179:2b66b83b19b6
xen-unstable date:        Thu Apr 07 12:13:58 2011 +0100

14 years agoX86: offline/broken page handler for pod cache
Liu, Jinsong [Thu, 7 Apr 2011 14:26:21 +0000 (15:26 +0100)]
X86: offline/broken page handler for pod cache

When offline a page, or, when a broken page occur, the page maybe
populated, or, may at pod cache.  This patch is to handle the
offline/broken page at pod cache.  It scan pod cache, if hit, remove
and replace it, and then put the offline/broken page to
page_offlined_list/page_broken_list

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23178:fd8b81db422d
xen-unstable date:        Thu Apr 07 12:12:38 2011 +0100

14 years agoX86: Fix mce offline page bug
Liu, Jinsong [Thu, 7 Apr 2011 14:25:02 +0000 (15:25 +0100)]
X86: Fix mce offline page bug

c/s 19913 break mce offline page logic:
For page_state_is(pg, free), it's impossible to trigger the case;
For page_state_is(pg, offlined), it in fact didn't offline related
page;

This patch fix the bug, and remove an ambiguous comment.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23177:d8bb2de119de
xen-unstable date:        Thu Apr 07 12:12:01 2011 +0100

14 years agox86/hvm: load CPU structures from xen versions <=3.4
George Dunlap [Thu, 7 Apr 2011 14:23:47 +0000 (15:23 +0100)]
x86/hvm: load CPU structures from xen versions <=3.4

Xen 4.0 added "msr_tsc_aux" in the middle of the hvm_hw_cpu structure,
making it incompatible with pre-3.4 savefiles.  This patch uses the
recently introduced backwards-compatibility infrastructure to convert
the old to the new.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23172:dc8b05d22a59
xen-unstable date:        Wed Apr 06 11:40:54 2011 +0100

14 years agohvm: infrastructure for backwards-compatible loading
George Dunlap [Thu, 7 Apr 2011 14:23:16 +0000 (15:23 +0100)]
hvm: infrastructure for backwards-compatible loading

The hvm_save code is used to save and restore hypervisor-related hvm
state, either for classic save/restore, or for migration (including
remus).  This is meant to be backwards-compatible across some
hypervisor versions; but if it does change, there is no way to handle
the old format as well as the new.

This patch introduces the infrastructure to allow a single older
version ("compat") of any given "save type" to be defined, along with
a function to turn the "old" version into the "new" version.  If the
size check fails for the "normal" version, it will check the "compat"
version, and if it matches, will read the old entry and call the
conversion function.

This patch involves some preprocessor hackery, but I'm only extending
the hackery that's already there.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23171:6a5830de7b54
xen-unstable date:        Wed Apr 06 11:40:51 2011 +0100

14 years agox86, amd, MTRR: remove k8_enable_fixed_iorrs()
Wei Huang [Thu, 7 Apr 2011 14:22:06 +0000 (15:22 +0100)]
x86, amd, MTRR: remove k8_enable_fixed_iorrs()

AMD64 defines two special bits (bit 3 and 4) RdMem and WrMem in fixed
MTRR type. Their values are supposed to be 0 after BIOS hands the
control to OS according to AMD BKDG. Unless OS specificially turn them
on, they are kept 0 all the time. As a result, k8_enable_fixed_iorrs()
is unnecessary and removed from upstream kernel (see
https://patchwork.kernel.org/patch/11425/). This patch does the same
thing.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23154:42fa70e0761b
xen-unstable date:        Wed Apr 06 09:02:13 2011 +0100

14 years agox86, amd, MTRR: correct DramModEn bit of SYS_CFG MSR
Wei Huang [Thu, 7 Apr 2011 14:21:41 +0000 (15:21 +0100)]
x86, amd, MTRR: correct DramModEn bit of SYS_CFG MSR

Some buggy BIOS might set SYS_CFG DramModEn bit to 1, which can cause
unexpected behavior on AMD platforms. This patch clears DramModEn bit
if it is 1.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23153:8fb61c9ebe49
xen-unstable date:        Wed Apr 06 09:01:31 2011 +0100

14 years agoxsm: Error code consistency
Machon Gregory [Thu, 7 Apr 2011 14:20:32 +0000 (15:20 +0100)]
xsm: Error code consistency

Signed-off-by: Machon Gregory <mbgrego@tycho.ncsc.mil>
xen-unstable changeset:   23140:967e1925775c
xen-unstable date:        Mon Apr 04 15:54:45 2011 +0100

14 years agox86/mm: fix PSE alignment checks in pagetable walker.
Tim Deegan [Thu, 7 Apr 2011 14:19:52 +0000 (15:19 +0100)]
x86/mm: fix PSE alignment checks in pagetable walker.

The PSE handling doesn't check bits 1...8 (or 1...9 for non-PAE
guests) being zero, thus allowing bad (not 2Mb/4Mb aligned) large
pages to be handled.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23138:777aaa2172c8
xen-unstable date:        Mon Apr 04 10:38:27 2011 +0100

14 years agoxen: fix reloc.S generation for non-gnu toolchain
Christoph Egger [Sat, 2 Apr 2011 15:06:45 +0000 (16:06 +0100)]
xen: fix reloc.S generation for non-gnu toolchain

The output of AT&T UNIX and GNU od(1) are different.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
xen-unstable changeset:   23130:0e88c781a8a8
xen-unstable date:        Sat Apr 02 15:53:35 2011 +0100

14 years agox86: __pirq_guest_eoi() must check it is called for a fully
Keir Fraser [Sat, 2 Apr 2011 15:06:12 +0000 (16:06 +0100)]
x86: __pirq_guest_eoi() must check it is called for a fully
guest-bound irq before accessing desc->action.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23103:48dac730a93b
xen-unstable date:        Sat Mar 26 09:42:01 2011 +0000

14 years agoUpdate Xen version to 4.1.1-rc1-pre
Keir Fraser [Sat, 2 Apr 2011 14:59:55 +0000 (15:59 +0100)]
Update Xen version to 4.1.1-rc1-pre

14 years agoAdded signature for changeset 6a2089f00dc7
Keir Fraser [Fri, 25 Mar 2011 10:22:43 +0000 (10:22 +0000)]
Added signature for changeset 6a2089f00dc7

14 years agoAdded tag RELEASE-4.1.0 for changeset 6a2089f00dc7
Keir Fraser [Fri, 25 Mar 2011 10:22:19 +0000 (10:22 +0000)]
Added tag RELEASE-4.1.0 for changeset 6a2089f00dc7

14 years agoUpdate Xen version to 4.1.0 RELEASE-4.1.0
Keir Fraser [Fri, 25 Mar 2011 10:22:10 +0000 (10:22 +0000)]
Update Xen version to 4.1.0

14 years agoAdded signature for changeset 98c580505053
Keir Fraser [Mon, 21 Mar 2011 13:13:25 +0000 (13:13 +0000)]
Added signature for changeset 98c580505053

14 years agoAdded tag 4.1.0-rc8 for changeset 98c580505053
Keir Fraser [Mon, 21 Mar 2011 13:13:16 +0000 (13:13 +0000)]
Added tag 4.1.0-rc8 for changeset 98c580505053

14 years agoUpdate Xen version to 4.1.0-rc8 4.1.0-rc8
Keir Fraser [Mon, 21 Mar 2011 13:13:09 +0000 (13:13 +0000)]
Update Xen version to 4.1.0-rc8

14 years agoamd-iommu: remove a stray __init
Jan Beulich [Fri, 18 Mar 2011 17:21:45 +0000 (17:21 +0000)]
amd-iommu: remove a stray __init

This function is being called on the resume path.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23061:12f7c7ac7f19
xen-unstable date:        Fri Mar 18 17:15:52 2011 +0000

14 years agox86/mce: CPU notifiers must not be registered a second time during resume
Jan Beulich [Fri, 18 Mar 2011 17:20:57 +0000 (17:20 +0000)]
x86/mce: CPU notifiers must not be registered a second time during resume

While c/s 22964:f71212f712fd and 23051:93c864c16ab1 fixed issues with
CPU onlining, they introduced a problem with resume: mcheck_init() is
also being called on that path, and hence checking whether it's
running on CPU 0, which is generally not a really good thing, is
particularly inappropriate here.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23060:b59e98bc6ff1
xen-unstable date:        Fri Mar 18 17:15:19 2011 +0000

14 years agox86: mce cleanup for both Intel and AMD mce logic
Liu, Jinsong [Fri, 18 Mar 2011 17:19:34 +0000 (17:19 +0000)]
x86: mce cleanup for both Intel and AMD mce logic

c/s 22964 fixed a mce memory leaks bug which may trigger xen crash
when cpu online.  However, there are 2 mce memory leaks: 1 at mce
level (arch independent), 1 at mce_intel level (arch dependent).  At
c/s 22964, it free both leaks at mce_intel level, which would has
problem under AMD arch.

This patch fix this issue.

It alloc/free poll_bankmask (arch independent) at mce level,=20 and
add a notifier block at mce level to avoid xmalloc risk when irq
disable.

With this patch, both Intel and AMD mce works OK in a clean way.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23051:93c864c16ab1
xen-unstable date:        Thu Mar 17 13:31:43 2011 +0000

14 years agoUpdate Xen version to 4.1.0-rc8-pre
Keir Fraser [Fri, 18 Mar 2011 17:18:39 +0000 (17:18 +0000)]
Update Xen version to 4.1.0-rc8-pre

14 years agoAvoid endless loop for vcpu migration.
Juergen Gross [Fri, 18 Mar 2011 17:17:30 +0000 (17:17 +0000)]
Avoid endless loop for vcpu migration.

Only call SCHED_OP(pick_cpu) if a previously picked cpu is not
suitable on the current iteration of the retry loop.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23043:3caed2112c65
xen-unstable date:        Tue Mar 15 10:14:27 2011 +0000

14 years agoAdded signature for changeset 32203061c1f7
Keir Fraser [Wed, 16 Mar 2011 17:11:54 +0000 (17:11 +0000)]
Added signature for changeset 32203061c1f7

14 years agoAdded tag 4.1.0-rc7 for changeset 32203061c1f7
Keir Fraser [Wed, 16 Mar 2011 17:11:38 +0000 (17:11 +0000)]
Added tag 4.1.0-rc7 for changeset 32203061c1f7

14 years agoUpdate Xen version to 4.1.0-rc7 4.1.0-rc7
Keir Fraser [Wed, 16 Mar 2011 17:11:30 +0000 (17:11 +0000)]
Update Xen version to 4.1.0-rc7

14 years agolibxl: passthrough: avoid passing through devices not owned by pciback
Allen M Kay [Wed, 16 Mar 2011 17:08:27 +0000 (17:08 +0000)]
libxl: passthrough: avoid passing through devices not owned by pciback

This patch makes sure the passthrough device belongs to pciback before
allow them passthrough to the guest.  There are still many other
checks missing.

xm terminates the guest startup process when this type of condition is
found.  This patch just allows the guest to continue to boot but with
no device passthrough.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86: run-time callers of map_pages_to_xen() must check for errors
Jan Beulich [Tue, 15 Mar 2011 13:55:40 +0000 (13:55 +0000)]
x86: run-time callers of map_pages_to_xen() must check for errors

Again, (out-of-memory) errors must not cause hypervisor crashes, and
hence ought to be propagated.

This also adjusts the cache attribute changing loop in
get_page_from_l1e() to not go through an unnecessary iteration. While
this could be considered mere cleanup, it is actually a requirement
for the subsequent now necessary error recovery path.

Also make a few functions static, easing the check for potential
callers needing adjustment.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   22997:5f28dcea1355
xen-unstable date:        Wed Mar 09 16:15:36 2011 +0000

x86: don't BUG() post-boot in alloc_xen_pagetable()

Instead, propagate the condition to the caller, all of which also get
adjusted to check for that situation.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   22996:1eeccafe9042
xen-unstable date:        Wed Mar 09 16:14:59 2011 +0000

14 years ago_csched_cpu_pick(): don't return CPUs outside vCPU's affinity mask
Jan Beulich [Mon, 14 Mar 2011 17:21:13 +0000 (17:21 +0000)]
_csched_cpu_pick(): don't return CPUs outside vCPU's affinity mask

This fixes a fairly blatant bug I introduced in c/s 20377:cff23354d026
- I wonder how this went unnoticed for so long.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23039:c40da47621d8
xen-unstable date:        Mon Mar 14 17:19:22 2011 +0000

14 years agoAllow tools to map arbitrarily large machphys_mfn_list on 32bit dom0
Gianni Tedesco [Mon, 14 Mar 2011 17:14:16 +0000 (17:14 +0000)]
Allow tools to map arbitrarily large machphys_mfn_list on 32bit dom0

This permits suspend/resume to work with 32bit dom0/tools when system
memory extends beyond 160GB (and up to 1TB).

AFAICT the limit to MACH2PHYS_COMPAT_NR_ENTRIES is redundant since
that refers to a limit in 32bit guest compat mappings under 64bit
hypervisors, not userspace where there may be gigabytes of useful
virtual space available for this.

Suggested-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Gianni Tedesco <gianni.tedesco@citrix.com>
xen-unstable changeset:   23038:39f5947b1576
xen-unstable date:        Mon Mar 14 17:13:15 2011 +0000

14 years agox86: fix cpu_sibling_map initialization when topology CPUID leaf is present
Jan Beulich [Mon, 14 Mar 2011 17:08:00 +0000 (17:08 +0000)]
x86: fix cpu_sibling_map initialization when topology CPUID leaf is present

c/s 21811:12f0618400de broke this by not properly initializing struct
cpuinfo_x86's x86_num_siblings member (other than Linux, where this is
a global variable, it is being maintained per CPU by Xen).

Hyper-threaded CPUs with CPUID leaf 0xb present had therefore all
cpu_sibling_map-s with just a single bit set, thus improperly feeding
the scheduler.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23037:a29b35408950
xen-unstable date:        Mon Mar 14 17:05:21 2011 +0000

14 years agox86: add volatile prefix for cpuid asm clauses
Wei Gang [Mon, 14 Mar 2011 17:07:29 +0000 (17:07 +0000)]
x86: add volatile prefix for cpuid asm clauses

cpuid results are possible to be changed now. For example, changing
CR4.OSXSAVE bit or setting MSR XCR_XFEATURE_ENABLED_MASK may change
XSAVE related cpuid leave return values.

The volatile prefix is required to avoid the second cpuid calls
following some possible changing operations being optimized in
incorrect way by compiler.

The sample bug is in xsave_init while debug=3Dn. The second call to
cpuid_count() may be optimized and lead to a BUG_ON case while compare
xsave_cntxt_size with ebx.

Signed-off-by: Wei Gang <gang.wei@intel.com>
xen-unstable changeset:   23036:9a15ff175e00
xen-unstable date:        Mon Mar 14 17:04:42 2011 +0000

14 years agox86_64: fix error checking in arch_set_info_guest()
Tim Deegan [Mon, 14 Mar 2011 17:00:34 +0000 (17:00 +0000)]
x86_64: fix error checking in arch_set_info_guest()

Cannot specify user mode execution without specifying user-mode
pagetables.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23034:c79aae866ad8
xen-unstable date:        Mon Mar 14 16:59:49 2011 +0000

14 years agox86/HPET: fix initialization order
Jan Beulich [Sat, 12 Mar 2011 13:25:44 +0000 (13:25 +0000)]
x86/HPET: fix initialization order

At least the legacy path can enter its interrupt handler callout while
initialization is still in progress - that handler checks whether
->event_handler is non-NULL, and hence all other initialization must
happen before setting this field.

Do the same to the MSI initialization just in case (and to keep the
code in sync).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Wei Gang <gang.wei@intel.com>
xen-unstable changeset:   23030:87aa1277eae0
xen-unstable date:        Sat Mar 12 13:19:02 2011 +0000

14 years agolibxl: do not try to use blktap with qdisk
Ian Jackson [Fri, 11 Mar 2011 18:35:15 +0000 (18:35 +0000)]
libxl: do not try to use blktap with qdisk

libxl_device_disk_add tries to use blktap when available even for qdisk
devices, this patch fixes it.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
(cherry-picked from xen-unstable
 changeset a8fee4ad3ad0650e7a5cc0fb253c6a0ada1ac583)

14 years agox86: Fix cpu offline bug: add clflush inside dead loop
Liu, Jinsong [Fri, 11 Mar 2011 17:33:30 +0000 (17:33 +0000)]
x86: Fix cpu offline bug: add clflush inside dead loop

At some platform (like Xen 7400), when hyperthreading, an offlined
thread may waked spuriously up by its brother, and returning around
the loop.  This patch explicitly clflush the cache line in a light
weight way to workaround potential issue.  Unlike wbinvd, clflush is
not serializing instruction, hence memory fence is necessary to make
sure all load/store operation visible before flush cache line.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23024:fb3950888154
xen-unstable date:        Fri Mar 11 17:18:53 2011 +0000

x86: Fix cache flush bug of cpu offline

Current xen cpu offline logic flush cache too early, which potentially
break cache coherency.  wbinvd should be the last ops before cpu going
into dead, otherwise cache may be dirty, i.e, something like setting
an A bit on page tables. Pointed out by Arjan van de Ven.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23023:552c3059264e
xen-unstable date:        Fri Mar 11 17:18:01 2011 +0000

x86: Fix cpu offline bug: cancel SYSIO method when play dead

Play dead is a fragile and tricky point of cpu offline logic.  For how
to play cpu dead, linux kernel changed several times: Very old kernel
support 3 ways to play cpu dead: mwait, SYSIO, and halt, just like
what cpuidle did when enter C3; Later, it cancel mwait and SYSIO
support, only use halt to play dead; Latest linux 2.6.38 add mwait
support when cpu dead.

This patch cancel SYSIO method when cpu dead, keep same with latest
kernel.

SYSIO is an obsoleted method to enter deep C, with some tricky
hardware behavior, and seldom supported in new platform.  Xen
experiment indicate that when cpu dead, SYSIO method would trigger
unknown issue which would bring strange error.  We now cancel SYSIO
method when cpu dead, after all, correctness is more important than
power save, and btw new platform use mwait.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   23022:6c5e68521f1d
xen-unstable date:        Fri Mar 11 16:27:33 2011 +0000

14 years agox86: Fix cpuidle bug
Liu, Jinsong [Thu, 10 Mar 2011 18:37:40 +0000 (18:37 +0000)]
x86: Fix cpuidle bug

Before invoking C3, bus master disable / flush cache should be the
last step; After resume from C3, bus master enable should be the first
step;

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Acked-by: Wei Gang <gang.wei@intel.com>
xen-unstable changeset:   23020:22cc047eb146
xen-unstable date:        Thu Mar 10 18:35:32 2011 +0000

14 years agolibxl: Call setsid(2) before exec'ing device model
Jim Fehlig [Thu, 10 Mar 2011 18:17:55 +0000 (18:17 +0000)]
libxl: Call setsid(2) before exec'ing device model

While doing development on libvirt libxenlight driver I noticed
that terminating a libxenlight client causes any qemu-dm
processes that were indirectly created by the client to also
terminate.  Calling setsid(2) before exec'ing qemu-dm resolves
the issue.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoupdate README
Stefano Stabellini [Thu, 10 Mar 2011 18:11:20 +0000 (18:11 +0000)]
update README

update README: we are missing few compile time dependencies and a link
to the pvops kernel page on the wiki.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl/xm: make pci-list use same BDF format as all other commands
Ian Campbell [Wed, 9 Mar 2011 17:07:17 +0000 (17:07 +0000)]
xl/xm: make pci-list use same BDF format as all other commands

In particular using the same syntax as pci-{attach,detach} uses is
very helpful.

(Backport from xen-unstable as 23015:1df8f9732d1d.)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoMerge
Ian Jackson [Wed, 9 Mar 2011 17:04:32 +0000 (17:04 +0000)]
Merge

14 years ago# HG changeset patch
Stefano Stabellini [Wed, 9 Mar 2011 17:04:13 +0000 (17:04 +0000)]
# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@eu.citrix.com>
# Date 1299690214 0
# Node ID 0fa941c0ec45b3490d8ffa74ae0a271dfc14445e
# Parent  65d26504e843420a1f3db6052464c052f83160e3
libxl: introduce flexarray_append_pair

Introduce flexarray_append_pair: a simple syntactic sugar to add a pair
of pointers to a flexarray, very useful when adding pairs of strings to
xenstore.

Replace flexarray_vappend calls (and one pair of flexarray_append)
with flexarray_append_pair calls when dealing with flexarrays that are
going to be used with libxl__xs_kvs_of_flexarray:

NULL is a valid pointer value in these cases while flexarray_vappend
uses NULL as vargs terminator, so the old code is buggy.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86_emulate: FPU 0xda instructions have a 32-bit memory operand, not 64-bit.
Keir Fraser [Tue, 8 Mar 2011 16:19:01 +0000 (16:19 +0000)]
x86_emulate: FPU 0xda instructions have a 32-bit memory operand, not 64-bit.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   22993:22eb31eb688a
xen-unstable date:        Tue Mar 08 16:14:55 2011 +0000

14 years agox86_emulate: Fix emulation of FIMUL m32i.
Keir Fraser [Tue, 8 Mar 2011 16:18:49 +0000 (16:18 +0000)]
x86_emulate: Fix emulation of FIMUL m32i.

Need to emit assembler instruction fimull not fimul/fimuls.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   22992:e93392bd6b66
xen-unstable date:        Tue Mar 08 16:10:13 2011 +0000

14 years agoblktap2: fix gap in tapdisk2 disk_type numbering
Shriram Rajagopalan [Mon, 7 Mar 2011 16:15:47 +0000 (16:15 +0000)]
blktap2: fix gap in tapdisk2 disk_type numbering

Make the DISK_TYPE_* id numbering in tapdisk-disktypes.h contiguous.
Currently, id 8 is unallocated causing a null disk type entry in
tapdisk_disk_drivers array in tapdisk-disktypes.c. This causes the
function tapdisk_disktype_find() to return an error on encountering
disk types >7 (remus:, log:, etc.).

(Also applied to xen-unstable as 22987:649de04caff5.)

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Daniel Stodden <daniel.stodden@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.
Keir Fraser [Sat, 5 Mar 2011 16:05:52 +0000 (16:05 +0000)]
x86: Cache read of cpu_state in __cpu_die() for subsequent BUG_ON check.

Otherwise compiler may re-read cpu_state for the BUG_ON and see a
modified value causing erroneous BUG.

Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen-unstable changeset:   22977:bbc03993d31f
xen-unstable date:        Sat Mar 05 16:02:33 2011 +0000

14 years agox86: On CPU offline, fix master waiting for slave to be fully dead.
Keir Fraser [Sat, 5 Mar 2011 11:37:42 +0000 (11:37 +0000)]
x86: On CPU offline, fix master waiting for slave to be fully dead.

On two back-to-back CPU offline operations, on second offline the
cpu_state var will be CPU_STATE_DEAD from the first offline. Hence
__cpu_die() will incorrectly not wait for the second slave to fully
die and set cpu_state itself.

The fix is to set cpu_state to a new value, CPU_STATE_DYING, earlier
during CPU offline, before __cpu_die() starts to execute.

Original diagnosis and patch by Liu, Jinsong <jinsong.liu@intel.com>

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   22975:d3d29df8f082
xen-unstable date:        Sat Mar 05 11:34:41 2011 +0000

14 years agopreempt: Disable preemption support for 4.1.
Keir Fraser [Sat, 5 Mar 2011 11:35:29 +0000 (11:35 +0000)]
preempt: Disable preemption support for 4.1.

Preemption support is not needed for 4.1 branch as synchronous yield
(via waitqueues) is not used. Furthermore there are still some
unbalanced rcu_lock/unlock usages on some code paths and the stricter
requirements of the preemption subsystem can cause us to BUG out on
them.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agocredit2: Revert debugging patch 22965:9dfd7ffcd76c for release.
Keir Fraser [Sat, 5 Mar 2011 11:25:30 +0000 (11:25 +0000)]
credit2: Revert debugging patch 22965:9dfd7ffcd76c for release.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoSet debug=n by default.
Keir Fraser [Fri, 4 Mar 2011 21:46:06 +0000 (21:46 +0000)]
Set debug=n by default.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoUpdate QEMU_REMOTE to qemu-xen-4.1-testing.git
Keir Fraser [Fri, 4 Mar 2011 21:45:25 +0000 (21:45 +0000)]
Update QEMU_REMOTE to qemu-xen-4.1-testing.git

14 years agoAdded signature for changeset 6241fa0ad1a9
Ian Jackson [Fri, 4 Mar 2011 17:33:32 +0000 (17:33 +0000)]
Added signature for changeset 6241fa0ad1a9

14 years agoAdded tag 4.1.0-branched for changeset 6241fa0ad1a9
Ian Jackson [Fri, 4 Mar 2011 17:33:18 +0000 (17:33 +0000)]
Added tag 4.1.0-branched for changeset 6241fa0ad1a9

14 years agoMerge 4.1.0-branched
Ian Jackson [Thu, 3 Mar 2011 18:52:09 +0000 (18:52 +0000)]
Merge

14 years agotools: gtracestate: fix several problems
Wei Gang [Thu, 3 Mar 2011 18:51:13 +0000 (18:51 +0000)]
tools: gtracestate: fix several problems

Fixed problems include:
  * previously just print out a error instead of help info
    while running without cmdline parameters.
  * -u & -n lead to Segmentation fault.
  * -c and then use default ranges, the default ranges is not
        50us... but 50000/tsc2us....

Signed-off-by: Wei Gang <gang.wei@intel.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agox86, libxc: Fix xc_translate_foreign_address() for PV guests of
Keir Fraser [Thu, 3 Mar 2011 17:46:44 +0000 (17:46 +0000)]
x86, libxc: Fix xc_translate_foreign_address() for PV guests of
different bitness than dom0 (32-bit vs 64-bit).

Original patch by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agolibxc: Missed one when replacing read_exact with RDEXACT macro
George Dunlap [Thu, 3 Mar 2011 17:24:27 +0000 (17:24 +0000)]
libxc: Missed one when replacing read_exact with RDEXACT macro

This corrects an error in 21488:dd6bbdc42033.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxl: correctly initialise yylineno
Ian Jackson [Thu, 3 Mar 2011 17:11:31 +0000 (17:11 +0000)]
libxl: correctly initialise yylineno

Sometimes xl would read an uninitialised variable when printing error
messages, resulting in things like this:
  /etc/xen/thing.cfg:1030057088: config parsing error near `"ws08r2-x64-2': lexical error

This is because yylineno is a variable inside the scanner created by
yylex_init, but it is not initialised by yylex_init.
(Debian bug #616099.)

On the way I discovered a lot of complication to do with the calling
convention between bison and flex in reentrant parsers/scanners which
use locations (Debian bug #616100) but as the above change makes the
current code in xen-unstable work I don't propose to do anything else
about that now in our tree.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Tested-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agoxl: add "device_model_args" to pass arbitrary extra arguments to device model
Ian Campbell [Thu, 3 Mar 2011 17:07:40 +0000 (17:07 +0000)]
xl: add "device_model_args" to pass arbitrary extra arguments to device model

The libxl support was already in place so simply plumb it through.
This allows for passing debug options to the device model and provides
a method to work around missing toolstack functionality.

e.g. xl does not current support floppy disks but adding:
     device_model_args = [ "-fda", "/scratch/fdboot.img" ]
allowed me to boot FreeDOS from a floppy image.

I was unable to find any equivalent functionality in xend so this is a
new xl feature.

Moved xmalloc/xrealloc earlier to allow use from parse_config_data.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agolibxc: fix incorrect scanning of pfn array in pagebuf during migration
Shriram Rajagopalan [Thu, 3 Mar 2011 16:55:27 +0000 (16:55 +0000)]
libxc: fix incorrect scanning of pfn array in pagebuf during migration

xc_domain_restore.c:apply_batch function makes two passes over the pfn_types
array in pagebuf to allocate the needed MFNs. The curbatch parameter to this
function specifies the array offset in pfn_types, from where the current scan
should begin. But this variable is not taken into account (index always starts
at 0) during the two passes. While this [bug] does not manifest itsef during
save/restore or live migration, under Remus, xc_domain_restore fails due to
corrupt guest page tables.

(This appears to have been broken by 21588:6c3d8aec202d which reverted
two changesets from before Remus support was added and hence
reintroduced some none-Remus compatible bits.)

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
14 years agocredit2: Add more debugging
George Dunlap [Thu, 3 Mar 2011 15:14:30 +0000 (15:14 +0000)]
credit2: Add more debugging

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
14 years agox86: Fix cpu online/offline bug: mce memory leak.
Liu, Jinsong [Wed, 2 Mar 2011 10:31:06 +0000 (10:31 +0000)]
x86: Fix cpu online/offline bug: mce memory leak.

Current Xen mce logic didn't free mcabanks. This would be a memory
leak when cpu offline.  When repeatly do cpu online/offline, this
memory leak would make xenpool shrink, and at a time point, will call
alloc_heap_pages --> flush_area_mask, which
ASSERT(local_irq_is_enabled()).  However, cpu online is irq disable,
so it finally result in Xen crash.

This patch fix the memory leak bug, and tested OK over 50,000 round
cpu online/offline.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86: Disable IRQs and do WBINVD first in play_dead().
Keir Fraser [Wed, 2 Mar 2011 10:23:23 +0000 (10:23 +0000)]
x86: Disable IRQs and do WBINVD first in play_dead().

When we advertise we are dead via cpu_exit_clear(), it is no longer
safe to handle interrupts as our per-cpu vars can go away.

In future, we may want to think about NMI handling in this scenario
too.

Signed-off-by: Keir Fraser <keir@xen.org>
14 years agox86: Add warning comment explaining restrictions to play_dead().
Shan Haitao [Wed, 2 Mar 2011 10:01:55 +0000 (10:01 +0000)]
x86: Add warning comment explaining restrictions to play_dead().

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
14 years agoUpdate Xen version to 4.1.0-rc7-pre
Keir Fraser [Mon, 28 Feb 2011 16:55:20 +0000 (16:55 +0000)]
Update Xen version to 4.1.0-rc7-pre

14 years agoAdded signature for changeset 7b6791dbfecd
Keir Fraser [Mon, 28 Feb 2011 16:54:55 +0000 (16:54 +0000)]
Added signature for changeset 7b6791dbfecd