]> xenbits.xensource.com Git - xen.git/log
xen.git
12 years agoUpdate Xen version to 4.1.3-rc2 4.1.3-rc2
Keir Fraser [Mon, 18 Jun 2012 14:10:15 +0000 (15:10 +0100)]
Update Xen version to 4.1.3-rc2

12 years agox86-64: detect processors subject to AMD erratum #121 and refuse to boot
Jan Beulich [Tue, 12 Jun 2012 10:42:57 +0000 (11:42 +0100)]
x86-64: detect processors subject to AMD erratum #121 and refuse to boot

Processors with this erratum are subject to a DoS attack by unprivileged
guest users.

This is XSA-9 / CVE-2012-2934.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   25481:422880dc94a4
xen-unstable date:        Tue Jun 12 11:33:42 2012 +0100
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agox86-64: fix #GP generation in assembly code
Jan Beulich [Tue, 12 Jun 2012 10:46:11 +0000 (11:46 +0100)]
x86-64: fix #GP generation in assembly code

When guest use of sysenter (64-bit PV guest) or syscall (32-bit PV
guest) gets converted into a GP fault (due to no callback having got
registered), we must
- honor the GP fault handler's request the keep enabled or mask event
  delivery
- not allow TBF_EXCEPTION to remain set past the generation of the
  (guest) exception in the vCPU's trap_bounce.flags, as that would
  otherwise allow for the next exception occurring in guest mode,
  should it happen to get handled in Xen itself, to nevertheless get
  bounced to the guest kernel.

Also, just like compat mode syscall handling already did, native mode
sysenter handling should, when converting to #GP, subtract 2 from the
RIP present in the frame so that the guest's GP fault handler would
see the fault pointing to the offending instruction instead of past it.

Finally, since those exception generating code blocks needed to be
modified anyway, convert them to make use of UNLIKELY_{START,END}().

[ This bug is security vulnerability, XSA-8 / CVE-2012-0218. ]

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25200:80f4113be500 25204:569d6f05e1ef
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agox86_64: Do not execute sysret with a non-canonical return address
Jan Beulich [Tue, 12 Jun 2012 10:38:30 +0000 (11:38 +0100)]
x86_64: Do not execute sysret with a non-canonical return address

Check for non-canonical guest RIP before attempting to execute sysret.
If sysret is executed with a non-canonical value in RCX, Intel CPUs
take the fault in ring0, but we will necessarily already have switched
to the the user's stack pointer.

This is a security vulnerability, XSA-7 / CVE-2012-0217.

Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir.xen@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   25480:76eaf5966c05
xen-unstable date:        Tue Jun 12 11:33:40 2012 +0100
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agox86/cpuidle: do not flush cache unless entering C3
Wei Wang [Fri, 25 May 2012 07:18:47 +0000 (08:18 +0100)]
x86/cpuidle: do not flush cache unless entering C3

Nor is there a need to disable bus master arbitration in that case.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Modified-by: Zhang, Yang Z <yang.z.zhang@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25195:a06e6cdeafe3
xen-unstable date:        Mon Apr 16 13:05:28 2012 +0200

13 years agoblktap2: Fix naked unchecked uses of read/write/chdir.
Keir Fraser [Mon, 14 May 2012 15:59:12 +0000 (16:59 +0100)]
blktap2: Fix naked unchecked uses of read/write/chdir.

These cause warnings under warn_unused_result, and for read/write we
ought to deal with partial io results.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25299:01d64a3dea71
xen-unstable date:        Fri May 11 18:30:29 2012 +0100

blktap2: Fix another uninitialised value error

gcc  -O1 -fno-omit-frame-pointer -m32 -march=i686 -g
-fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes
-Wdeclaration-after-statement   -D__XEN_TOOLS__ -MMD -MF
.block-remus.o.d -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -fno-optimize-sibling-calls
-mno-tls-direct-seg-refs -Werror -g -Wno-unused -fno-strict-aliasing
-I../include -I../drivers
-I/home/osstest/build.12828.build-i386/xen-unstable/tools/blktap2/drivers/../../../tools/libxc
-I/home/osstest/build.12828.build-i386/xen-unstable/tools/blktap2/drivers/../../../tools/include
-D_GNU_SOURCE -DUSE_NFS_LOCKS  -c -o block-remus.o block-remus.c

block-remus.c: In function 'ramdisk_flush':
block-remus.c:508: error: 'buf' may be used uninitialized in this
function
make[5]: *** [block-remus.o] Error 1

This is because gcc can see that merge_requests doesn't always set
*mergedbuf but gcc isn't able to prove that it always does so if
merge_requests returns 0 and that in that case the value of
ramdisk_flush::buf isn't used.

This is too useful a warning to disable, despite the occasional false
positive of this form.  The conventional approach is to suppress the
warning by explicitly initialising the variable to 0.

This has just come to light because 25275:27d63b9f111a reenabled
optimisation for this area of code, and gcc's data flow analysis
(which is required to trigger the uninitialised variable warning) only
occurs when optimisation is turned on.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   25281:60064411a8a9
xen-unstable date:        Thu May 10 14:26:14 2012 +0100

blktap2: Do not build with -O0

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25275:27d63b9f111a
xen-unstable date:        Thu May 10 11:22:18 2012 +0100

blktap2: Fix uninitialised value error.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25274:cb82b5aa73bd
xen-unstable date:        Thu May 10 11:21:59 2012 +0100

tools/blktap2: fix out of bounds access in block-log.c

block-log.c: In function 'ctl_close_sock':
block-log.c:363:23: warning: array subscript is above array bounds
[-Warray-bounds]

Adjust loop condition in ctl_close_sock() to fix warning.
Adjust array acccess in ctl_close() to actually access the array
member.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25273:83a02f225bde
xen-unstable date:        Thu May 10 11:20:04 2012 +0100

tools/blktap2: fix build errors caused by Werror in
vhd_journal_write_entry

-O2 -Wall -Werror triggers these warnings:

libvhd-journal.c: In function 'vhd_journal_write_entry':
libvhd-journal.c:335: warning: statement with no effect

Really return the error from vhd_journal_write() to caller.

v2:
 - simplify the patch by just adding the missing return statement

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25272:ca02580986d2
xen-unstable date:        Thu May 10 11:19:05 2012 +0100

13 years agounmodified_drivers: remove inclusion of asm/system.h
Olaf Hering [Mon, 14 May 2012 15:51:27 +0000 (16:51 +0100)]
unmodified_drivers: remove inclusion of asm/system.h

Allow compilation of PVonHVM drivers with forward-ported xenlinux
sources in openSuSE 12.2. Since Linux 3.4 asm/system.h is not present
anymore. Remove inclusion of this header, its not needed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25327:cc7a054a5a27
xen-unstable date:        Mon May 14 12:04:27 2012 +0200

13 years agounmodified drivers: use upstream sync_bitops if available
Jan Beulich [Mon, 14 May 2012 15:50:58 +0000 (16:50 +0100)]
unmodified drivers: use upstream sync_bitops if available

The forward ported xenlinux sources in openSuSE 12.2 were switched
from the old synch_bitops to the sync_bitops since kernel version
3.3. Add compat macros to use either old or new helpers depending on
used kernel source version.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
xen-unstable changeset:   25069:46bf3ab42baf
xen-unstable date:        Fri Mar 16 11:35:06 2012 +0100

13 years agounmodified drivers: add pfn_is_ram helper for kdump
Olaf Hering [Mon, 14 May 2012 15:50:21 +0000 (16:50 +0100)]
unmodified drivers: add pfn_is_ram helper for kdump

Register pfn_is_ram helper speed up reading /proc/vmcore in the kdump
kernel. It is compiled only if the kernel source is recent enough to
have the pfn_is_ram helper (v3.0-rc1, commit
997c136f518c5debd63847e78e2a8694f56dcf90).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25068:e4460795ee66
xen-unstable date:        Fri Mar 16 11:34:41 2012 +0100

13 years agounmodified drivers: hide xen_cpuid_base() in version 2.6.38+
Olaf Hering [Mon, 14 May 2012 15:50:03 +0000 (16:50 +0100)]
unmodified drivers: hide xen_cpuid_base() in version 2.6.38+

Allow compilation of PVonHVM drivers with forward-ported xenlinux
sources in openSuSE 12.1.  xen_cpuid_base() is now in mainline, the
copy
in the xen tree leads to a compilation error.  The current state leads
to a compile error:

/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/platform-pci/platform-pci.c:121:
error: redefinition of 'xen_cpuid_base'
/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/xen/hypervisor.h:43:
error: previous definition of 'xen_cpuid_base' was here

The reason is that the kernel sources are searched before the xen
sources for asm/hypervisor.h:

/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/hypervisor.h
/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/include/asm/hypervisor.h

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25067:05768bd498f2
xen-unstable date:        Fri Mar 16 11:34:14 2012 +0100

13 years agounmodified_drivers: update README from
Ian Campbell [Mon, 14 May 2012 15:49:24 +0000 (16:49 +0100)]
unmodified_drivers: update README from
http://wiki.xen.org/xenwiki/UnmodifiedDrivers

Add reference to the fact that these drivers are for "classic-Xen"
kernels only
and do not work with PVops but point towards the PVHVM functionality
in
mainstream.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
xen-unstable changeset:   24045:4ed766d70396
xen-unstable date:        Wed Oct 26 17:44:03 2011 +0100

13 years agoUpdate Xen version to 4.1.3-rc2-pre
Keir Fraser [Mon, 14 May 2012 15:48:46 +0000 (16:48 +0100)]
Update Xen version to 4.1.3-rc2-pre

13 years agoAdded signature for changeset da64f68730cf
Keir Fraser [Mon, 7 May 2012 12:44:08 +0000 (13:44 +0100)]
Added signature for changeset da64f68730cf

13 years agoAdded tag 4.1.3-rc1 for changeset da64f68730cf
Keir Fraser [Mon, 7 May 2012 12:43:34 +0000 (13:43 +0100)]
Added tag 4.1.3-rc1 for changeset da64f68730cf

13 years agoUpdate Xen version to 4.1.3-rc1 4.1.3-rc1
Keir Fraser [Mon, 7 May 2012 12:43:15 +0000 (13:43 +0100)]
Update Xen version to 4.1.3-rc1

13 years agosvm: Fake out the Bus Unit Config MSR on revF AMD CPUs
George Dunlap [Tue, 1 May 2012 13:15:20 +0000 (14:15 +0100)]
svm: Fake out the Bus Unit Config MSR on revF AMD CPUs

Win2k8 x64 reads this MSR on revF chips, where it wasn't publically
available; it uses a magic constant in %rdi as a password, which we
don't have in rdmsr_safe().  Since we'll ignore the later writes, just
use a plausible value here (the reset value from rev10h chips) if the
real CPU didn't provide one.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24990:322300fd2ebd
xen-unstable date:        Thu Mar 08 09:17:21 2012 +0000

svm: amend c/s 24990:322300fd2ebd (fake BU_CFG MSR on AMD revF)

Let's restrict such a hack to the known affected family.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   25058:f47d91cb0faa
xen-unstable date:        Thu Mar 15 15:09:18 2012 +0100

13 years agox86-64: Fix memory hotplug epfn upper limit test for updating the compat M2P table
Malcolm Crossley [Tue, 1 May 2012 13:13:58 +0000 (14:13 +0100)]
x86-64: Fix memory hotplug epfn upper limit test for updating the compat M2P table

The epfn is being compared to (RDWR_COMPAT_MPT_VIRT_END -
RDWR_COMPAT_MPT_VIRT_START) without a 2 bit shift, resulting in the
epfn being compared to the size of the RDWR_COMPAT_MPT table in bytes
instead of the maximum page frame number that the RDWR_COMPAT_MPT
table can map.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   25242:b7ce6a88bebb
xen-unstable date:        Wed Apr 25 12:35:56 2012 +0200

13 years agoQEMU_TAG update
Ian Jackson [Tue, 24 Apr 2012 17:38:19 +0000 (18:38 +0100)]
QEMU_TAG update

13 years agox86: fix memset(ptr, 0, sizeof ptr).
Tim Deegan [Tue, 24 Apr 2012 09:50:25 +0000 (10:50 +0100)]
x86: fix memset(ptr, 0, sizeof ptr).

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   25168:d5f9005dfc4a
xen-unstable date:        Wed Apr 11 13:10:33 2012 +0100

13 years agox86/hpet: disable before reboot or kexec
Jan Beulich [Tue, 17 Apr 2012 07:35:09 +0000 (08:35 +0100)]
x86/hpet: disable before reboot or kexec

Linux up to now is not smart enough to properly clear the HPET when it
boots, which is particularly a problem when a kdump attempt from
running under Xen is being made. Linux itself added code to work
around
this to its shutdown paths quite some time ago, so let's do something
similar in Xen: Save the configuration register settings during boot,
and restore them during shutdown. This should cover the majority of
cases where the secondary kernel might not come up because timer
interrupts don't work.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25101:f06ff3dfde08
xen-unstable date:        Tue Mar 27 15:20:23 2012 +0200

13 years agox86_emulate: Do not push an error code onto a #UD exception stack
Andrew Cooper [Tue, 17 Apr 2012 07:34:28 +0000 (08:34 +0100)]
x86_emulate: Do not push an error code onto a #UD exception stack

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25099:4bd752a4cdf3
xen-unstable date:        Fri Mar 23 20:51:48 2012 +0000

x86_emulate: raise #UD rather than #GP on invalid use of LOCK prefix

From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25098:2e45b26bc412
xen-unstable date:        Fri Mar 23 20:45:16 2012 +0000

13 years agoXENPF_set_processor_pminfo XEN_PM_CX overflows states array
Jan Beulich [Tue, 17 Apr 2012 07:33:33 +0000 (08:33 +0100)]
XENPF_set_processor_pminfo XEN_PM_CX overflows states array

Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states
array in "struct acpi_processor_power" to exceed its limit.

The array used to be reset (by function cpuidle_init_cpu()) for each
hypercall. The patch puts it back that way and adds an assertion to
make it clear in case that happens again.

Signed-off-by: Eric Chanudet <eric.chanudet@eu.citrix.com>
- convert assertion to printk() & bail
- eliminate struct acpi_processor_cx's valid member (not read anymore)
- further adjustments to one-time-only vs each-time operations in
  cpuidle_init_cpu()
- don't use ACPI_STATE_Cn as array index anymore

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24996:396801f25e92
xen-unstable date:        Thu Mar 08 17:04:32 2012 +0100

13 years agoHVM/SVM: enable tsc scaling ratio for SVM
Wei Huang [Thu, 12 Apr 2012 08:13:14 +0000 (09:13 +0100)]
HVM/SVM: enable tsc scaling ratio for SVM

Future AMD CPUs support TSC scaling. It allows guests to have a
different TSC frequency from host system using this formula: guest_tsc
= host_tsc * tsc_ratio + vmcb_offset. The tsc_ratio is a 64bit MSR
contains a fixed-point number in 8.32 format (8 bits for integer part
and 32bits for fractional part). For instance 0x00000003_80000000
means tsc_ratio=3.5.

This patch enables TSC scaling ratio for SVM. With it, guest VMs don't
need take #VMEXIT to calculate a translated TSC value when it is
running under TSC emulation mode. This can substancially reduce the
rdtsc overhead.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23437:d7c755c25bb9
xen-unstable date:        Sat May 28 08:58:08 2011 +0100

13 years agohvm: vpmu: Add support for AMD Family 15h processors
Jacob Shin [Thu, 12 Apr 2012 08:08:13 +0000 (09:08 +0100)]
hvm: vpmu: Add support for AMD Family 15h processors

AMD Family 15h CPU mirrors legacy K7 performance monitor counters to
a new location, and adds 2 new counters. This patch updates HVM VPMU
to take advantage of the new counters.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
xen-unstable changeset:   23306:e787d4f2e5ac
xen-unstable date:        Mon May 09 09:54:46 2011 +0100

xenoprof: Add support for AMD Family 15h processors

AMD Family 15h CPU mirrors legacy K7 performance monitor counters to
a new location, and adds 2 new counters. This patch updates xenoprof
to take advantage of the new counters.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Rename fam15h -> amd_fam15h in a few places, as suggested by Jan
Beulich.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23305:014ee4e09644
xen-unstable date:        Mon May 09 09:53:07 2011 +0100

xenoprof: Update cpu_type to sync with upstream oprofile

Update xenoprof's cpu_type to match upstream oprofile. Currently AMD
Family 11h ~ Family 15h are broken due to string mismatches.

Signed-off-by: Jacob Shin <jacob.shin@amd.com>
xen-unstable changeset:   23304:8981b582be3e
xen-unstable date:        Mon May 09 09:49:14 2011 +0100

13 years agosvm: implement instruction fetch part of DecodeAssist (on #PF/#NPF)
Andre Przywara [Thu, 12 Apr 2012 08:06:02 +0000 (09:06 +0100)]
svm: implement instruction fetch part of DecodeAssist (on #PF/#NPF)

Newer SVM implementations (Bulldozer) copy up to 15 bytes from the
instruction stream into the VMCB when a #PF or #NPF exception is
intercepted. This patch makes use of this information if available.
This saves us from a) traversing the guest's page tables, b) mapping
the guest's memory and c) copy the instructions from there into the
hypervisor's address space.
This speeds up #NPF intercepts quite a lot and avoids cache and TLB
trashing.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23238:60f5df2afcbb
xen-unstable date:        Mon Apr 18 13:36:10 2011 +0100

svm: decode-assists feature must depend on nextrip feature.

...since the decode-assist fast paths assume nextrip vmcb field is
valid.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23237:381ab77db71a
xen-unstable date:        Mon Apr 18 10:10:02 2011 +0100

svm: implement INVLPG part of DecodeAssist

Newer SVM implementations (Bulldozer) give the desired address on
a INVLPG intercept explicitly in the EXITINFO1 field of the VMCB.
Use this address to avoid a costly instruction fetch and decode
cycle.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
xen-unstable changeset:   23236:e324c4d1dd6e
xen-unstable date:        Mon Apr 18 10:06:37 2011 +0100

svm: implement CR access part of DecodeAssist

Newer SVM implementations (Bulldozer) now give the used general
purpose register on a MOV-CR intercept explictly. This avoids
fetching and decoding the instruction from guest's memory and speeds
up some Windows guest, which exercise CR8 quite often.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23235:2c8ad607ece1
xen-unstable date:        Mon Apr 18 10:01:06 2011 +0100

svm: add bit definitions for SVM DecodeAssist

Chapter 15.33 of recent APM Vol.2 manuals describe some additions
to SVM called DecodeAssist. Add the newly added fields to the VMCB
structure and name the associated CPUID bit.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
xen-unstable changeset:   23234:bf7afd48339a
xen-unstable date:        Mon Apr 18 09:49:13 2011 +0100

vmx/hvm: move mov-cr handling functions to generic HVM code

Currently the handling of CR accesses intercepts is done much
differently in SVM and VMX. For future usage move the VMX part
into the generic HVM path and use the exported functions.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23233:1276926e3795
xen-unstable date:        Mon Apr 18 09:47:12 2011 +0100

13 years agox86: fix delta calculation in TSC deadline timer emulation
David Vrabel [Wed, 11 Apr 2012 18:41:14 +0000 (19:41 +0100)]
x86: fix delta calculation in TSC deadline timer emulation

In the virtual LAPIC, correct the delta calculation when emulating the
TSC deadline timer.

Without this fix, XenServer (which is based on Xen 4.1) does not work
when running as an HVM guest.  dom0 fails to boot because its timer
interrupts are very delayed (by several minutes in some cases).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25191:a95fc7decc83
xen-unstable date:        Wed Apr 11 16:49:45 2012 +0100

13 years agolibxl: support for "rtc_timeoffset" and "localtime"
Giam Teck Choon [Wed, 4 Apr 2012 15:09:25 +0000 (16:09 +0100)]
libxl: support for "rtc_timeoffset" and "localtime"

Implement "rtc_timeoffset" and "localtime" options compatible as xm.

rtc_timeoffset is the offset between host time and guest time.
localtime means to specify whether the emulted RTC appears as UTC or is
offset by the host.

Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Lin Ming <mlin@ss.pku.edu.cn>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
xen-unstable changeset: 25131:6f81f4d79fde
Backport-requested-by: Giam Teck Choon <giamteckchoon@gmail.com>
Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agotools: xend: tolerate empty state/*.xml
Konrad Rzeszutek Wilk [Tue, 3 Apr 2012 15:06:10 +0000 (16:06 +0100)]
tools: xend: tolerate empty state/*.xml

Bugzilla 1680: Xend fails to start if /var/lib/xend/state/*.xml are empty
which I get often when replacing the Xen hypervisor with a newer version.

This can be easily be reproduced under Fedora Core 16 by installing
xen RPMs and then replacing the xen.gz with a newer version.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Anthony Low <shinji@pikopiko.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24140:a3a2e300951a
Backport-requested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: write vifname in xenstore if set.
Giam Teck Choon [Tue, 3 Apr 2012 15:03:47 +0000 (16:03 +0100)]
libxl: write vifname in xenstore if set.

Simple fix to enable user to specify vif names.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
xen-unstable changeset: 24459:caf9753d4cc1
Backport-requested-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Signed-off-by: Giam Teck Choon <giamteckchoon@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2
Stefano Stabellini [Fri, 30 Mar 2012 16:19:18 +0000 (17:19 +0100)]
xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2

PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
In order to improve the interface this patch:

- renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;

- introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
  PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
  another hypercall;

- #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24616:3bd3949854ef
xen-unstable date:        Sat Jan 28 13:45:13 2012 +0000

13 years agoFix backport of 23225:3f00c5faa12a.
Konrad Rzeszutek Wilk [Thu, 29 Mar 2012 16:31:49 +0000 (17:31 +0100)]
Fix backport of 23225:3f00c5faa12a.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
13 years agox86,hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall
Zhenzhong Duan [Thu, 29 Mar 2012 09:20:58 +0000 (10:20 +0100)]
x86,hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall

pvhvm running with more than 32 vcpus and pv_irq/pv_time enabled
need vcpu placement to work, or else it will softlockup.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24013:c4ed56a102dc
xen-unstable date:        Fri Oct 28 17:20:21 2011 +0100

13 years agox86: make the pv-only e820 array be dynamic.
Konrad Rzeszutek Wilk [Thu, 29 Mar 2012 09:19:56 +0000 (10:19 +0100)]
x86: make the pv-only e820 array be dynamic.

During creation of the PV domain we allocate the E820 structure to
have the amount of E820 entries on the machine, plus the number three.

This will allow the tool stack to fill the E820 with more than three
entries. Specifically the use cases is , where the toolstack retrieves
the E820, sanitizes it, and then sets it for the PV guest (for PCI
passthrough), this dynamic number of E820 is just right.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23225:3f00c5faa12a
xen-unstable date:        Wed Apr 13 16:10:26 2011 +0100

13 years agoIntroduce system_state variable.
Keir Fraser [Fri, 23 Mar 2012 14:01:05 +0000 (14:01 +0000)]
Introduce system_state variable.

Use it to replace x86-specific early_boot boolean variable.

Also use it to detect suspend/resume case during cpu offline/online
to avoid unnecessarily breaking vcpu and cpupool affinities.

Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
xen-unstable changeset:   25079:d5ccb2d1dbd1
xen-unstable date:        Thu Mar 22 12:20:13 2012 +0000

Backport requested by Juergen to fix crash on poweroff when using
cpupools.

13 years agox86/gnttab: fix asm() operand in gnttab_clear_flag()
Jan Beulich [Fri, 23 Mar 2012 13:58:22 +0000 (13:58 +0000)]
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25092:a66fb91cb8d3
xen-unstable date:        Fri Mar 23 08:39:39 2012 +0100

13 years agoQEMU_TAG update
Ian Jackson [Wed, 14 Mar 2012 12:02:02 +0000 (12:02 +0000)]
QEMU_TAG update

13 years agotools: xencommons init script: Fix setting XENSTORED_ROOTDIR
Jim Fehlig [Wed, 14 Mar 2012 10:03:07 +0000 (10:03 +0000)]
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24593:e2722b24dc09
Backport-requested-by: Teck Choon Giam <giamteckchoon@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: print out vifname in create dryrun.
Wei Liu [Tue, 13 Mar 2012 16:49:03 +0000 (16:49 +0000)]
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
xen-unstable changeset: 24458:19ac027a3c31
Backport-requested-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agohvm: Print support/enable status of HAP superpage mappings.
Keir Fraser [Fri, 9 Mar 2012 10:03:04 +0000 (10:03 +0000)]
hvm: Print support/enable status of HAP superpage mappings.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24992:0384f791e538
xen-unstable date:        Thu Mar 08 09:43:49 2012 +0000

13 years agoiommu: Move IOMMU faults handling into softirq for AMD-Vi.
Dario Faggioli [Thu, 8 Mar 2012 10:05:04 +0000 (10:05 +0000)]
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24527:028230eb2359
xen-unstable date:        Fri Jan 20 10:20:32 2012 +0000

13 years agox86/IRQ: prevent vector sharing within IO-APICs
Jan Beulich [Thu, 8 Mar 2012 10:04:22 +0000 (10:04 +0000)]
x86/IRQ: prevent vector sharing within IO-APICs

Following the prevention of vector sharing for MSIs, this change
enforces the same within IO-APICs: Pin based interrupts use the
IO-APIC as their identifying device under the AMD IOMMU (and just like
for MSIs, only the identifying device is used to remap interrupts
here, with no regard to an interrupt's destination).

Additionally, LAPIC initiated EOIs (for level triggered interrupts)
too use only the vector for identifying which interrupts to end. While
this generally causes no significant problem (at worst an interrupt
would be re-raised without a new interrupt event actually having
occurred), it still seems better to avoid the situation.

For this second aspect, a distinction is being made between the
traditional and the directed-EOI cases: In the former, vectors should
not be shared throughout all IO-APICs in the system, while in the
latter case only individual IO-APICs need to be contrained (or, if the
firmware indicates so, sub- groups of them having the same GSI appear
at multiple pins).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24156:f29b5bd6e25f
xen-unstable date:        Fri Nov 18 09:21:24 2011 +0100

13 years agointroduce xzalloc() & Co
Jan Beulich [Thu, 8 Mar 2012 10:03:35 +0000 (10:03 +0000)]
introduce xzalloc() & Co

Rather than having to match a call to one of the xmalloc() flavors
with a subsequent memset(), introduce a zeroing variant of each of
those flavors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23900:e09ebf7a31f5
xen-unstable date:        Tue Oct 04 14:15:26 2011 +0200

13 years agox86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0
Jan Beulich [Thu, 8 Mar 2012 08:58:26 +0000 (08:58 +0000)]
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0

32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.

Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24971:e88a49951212
xen-unstable date:        Tue Mar 06 16:43:01 2012 +0100

13 years agoxenoprof: Adjust indentation
George Dunlap [Wed, 7 Mar 2012 10:58:25 +0000 (10:58 +0000)]
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24536:212cf37d50e1
xen-unstable date:        Mon Jan 23 09:36:01 2012 +0000

xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24537:3c0a533d3af0
xen-unstable date:        Mon Jan 23 09:36:29 2012 +0000

xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24564:768c932ea8da
xen-unstable date:        Thu Jan 26 11:03:23 2012 +0000

xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24565:1e27e827e6a8
xen-unstable date:        Thu Jan 26 11:03:50 2012 +0000

13 years agoIO-APIC: Prevent using EOI broadcast suppression if user specified
Andrew Cooper [Wed, 7 Mar 2012 10:54:11 +0000 (10:54 +0000)]
IO-APIC: Prevent using EOI broadcast suppression if user specified
ioapic_ack=new on the command line.

Currently, if EOI broadcast suppression is advertised on the BSP
LAPIC, Xen will discard any user specified option regarding IO-APIC
ack mode.

This patch introduces a check which prevents EOI Broadcast suppression
from forcing the IO-APIC ack mode to old if the user has explicitly
asked for the new ack mode on the command line.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24870:9bf3ec036bef
xen-unstable date:        Thu Feb 23 09:58:47 2012 +0000

13 years agolibxc: remove tests of alloca() return value
David Vrabel [Wed, 7 Mar 2012 09:39:45 +0000 (09:39 +0000)]
libxc: remove tests of alloca() return value

alloca() does not return NULL on an allocation failure on Linux so
remove the unneccessary tests from this Linux-specific code.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Santosh Jodh <santosh.jodh@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24832:9cc7961d8f5c
xen-unstable date:        Mon Feb 20 17:31:49 2012 +0000

13 years agolibxc: Replace malloc with alloca in hot path
Santosh Jodh [Wed, 7 Mar 2012 09:39:10 +0000 (09:39 +0000)]
libxc: Replace malloc with alloca in hot path

Replace malloc with alloc in hot paths for improved performance.

Signed-off-by: Santosh Jodh <santosh.jodh@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24709:8ba7ae0b070b
xen-unstable date:        Tue Feb 07 18:46:50 2012 +0000

13 years agosched_credit: Use delay to control scheduling frequency
Hui Lv [Wed, 7 Mar 2012 09:34:26 +0000 (09:34 +0000)]
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24518:44c2856b1952
xen-unstable date:        Tue Jan 17 11:18:48 2012 +0000

13 years agoxen,credit1: Add variable timeslice
George Dunlap [Wed, 7 Mar 2012 09:33:45 +0000 (09:33 +0000)]
xen,credit1: Add variable timeslice

Add a xen command-line parameter, sched_credit_tslice_ms,
to set the timeslice of the credit1 scheduler.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   23834:1d40b2793723
xen-unstable date:        Tue Sep 13 10:43:43 2011 +0100

13 years agons16550: Simplify UART and UART-interrupt probing logic.
Keir Fraser [Wed, 7 Mar 2012 09:30:42 +0000 (09:30 +0000)]
ns16550: Simplify UART and UART-interrupt probing logic.

1. No need to check for UART existence in the polling routine. We
already check for UART existence during boot-time initialisation (see
check_existence() function).

2. No obvious need to send a dummy character. The poll routine will
run until a character is eventually sent, but for the most common use
of serial ports (console logging) that will happen almost immediately.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23811:f1349a968a5a
xen-unstable date:        Fri Sep 02 14:56:26 2011 +0100

Revert part of 23811:f1349a968a5a "ns16550: Simplify UART..."

The change to poll LSR.THRE in a loop from __ns16550_poll is a bug.
We can loop indefinitely if there are no chars to transmit.

Thanks to Jan for spotting it.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23948:dcb2bd283dca
xen-unstable date:        Wed Oct 12 17:11:28 2011 +0100

13 years agox86: work around certain Intel BIOSes causing (transient) hangs during
Jan Beulich [Wed, 7 Mar 2012 09:25:34 +0000 (09:25 +0000)]
x86: work around certain Intel BIOSes causing (transient) hangs during
boot

They apparently leave the USB legacy emulation bits set in ICH10's
SMI Control and Enable register, but fail to handle the resulting SMIs
gracefully. The hangs can apparently extend indefinitely, but are
commonly observed to last between a few seconds and a minute.

This assumes that only ICH10-based systems on Intel main boards with
Intel BIOS may be affected. Until Intel comes up with a more precise
identification of affected BIOSes, all Intel ones on Intel boards
will get this workaround applied.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23795:e17f70940d1f
xen-unstable date:        Sat Aug 27 12:14:38 2011 +0100

13 years agox86: AMD core-pair topology detection code
Wei Huang [Wed, 7 Mar 2012 09:24:20 +0000 (09:24 +0000)]
x86: AMD core-pair topology detection code

This patch is to support core-pair topology introduced by AMD CPUs,
which introduces a new concept of [core, compute unit]. There is a new
feature bit for topology extension in CPUID:0x80000001. Also a new
CPUID 0x8000001E is introduced for CPU topology enumeration. This
patch collects the sibling information from the new CPUID and will be
stored in the sibling map in Xen hypervisor.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23611:c2c12b2dafb5
xen-unstable date:        Tue Jun 28 09:13:53 2011 +0100

13 years agox86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct
Wei Huang [Wed, 7 Mar 2012 09:23:41 +0000 (09:23 +0000)]
x86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct

This patch moves cpu_core_id and phys_proc_id into cpuinfo_x86
structure. This is similar to upstream Linux kernel's approach.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23610:87c2013c2aa2
xen-unstable date:        Tue Jun 28 09:13:31 2011 +0100

13 years agox86/mm/shadow: adjust early-unshadow heuristic for PAE guests.
Tim Deegan [Wed, 7 Mar 2012 09:22:58 +0000 (09:22 +0000)]
x86/mm/shadow: adjust early-unshadow heuristic for PAE guests.

PAE guests have 8-byte PTEs but tend to clear memory with 4-byte
writes.
This means that when zeroing a former pagetable every second 4-byte
write is unaligned and so the consecutive-zeroes --> unshadow
heuristic never kicks in.  Adjust the heuristic not to reset when
a write is >= 4 bytes and writing zero but not PTE-aligned.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23554:c91255b2f0a0
xen-unstable date:        Mon Jun 20 13:16:14 2011 +0100

13 years agox86/xsave: provide guests with finit-like environment
Jan Beulich [Wed, 7 Mar 2012 08:43:28 +0000 (08:43 +0000)]
x86/xsave: provide guests with finit-like environment

Without the use of xsave, guests get their initial floating point
environment set up with finit. At least NetWare actually depends on
this (in particular on all exceptions being masked), so to be
consistent set the same environment also when using xsave. This is
also in line with all SSE exceptions getting masked initially.

To avoid further fragile casts in xstate_alloc_save_area() the patch
also changes xsave_struct's fpu_see member to have actually usable
fields.

The patch was tested in its technically identical, but modified-file-
wise different 4.1.2 version.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Charles Arnold <carnold@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24157:7b5e1cb94bfa
xen-unstable date:        Fri Nov 18 09:22:45 2011 +0100

13 years agoGrant table: fix a bug when grant copying a previous grant mapped page.
Wei Liu [Wed, 7 Mar 2012 08:39:21 +0000 (08:39 +0000)]
Grant table: fix a bug when grant copying a previous grant mapped page.

In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref.  Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.

See changeset 22994:299ed79acecf for more information.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24950:9ef985f5e6a5
xen-unstable date:        Thu Mar 01 16:37:18 2012 +0000

13 years agopassthrough: release assigned PCI devices earlier during domain shutdown
Jan Beulich [Wed, 7 Mar 2012 08:35:58 +0000 (08:35 +0000)]
passthrough: release assigned PCI devices earlier during domain shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100

13 years agox86/mm: Don't check for invalid bits in non-present PTEs.
Tim Deegan [Wed, 7 Mar 2012 08:32:29 +0000 (08:32 +0000)]
x86/mm: Don't check for invalid bits in non-present PTEs.

If _PAGE_PRESENT is clean in a pagetable entry, any pattern of bits
is valid in the rest of the entry.  OSes that special-case
PFEC_invalid_bits (since it should never happen) will be confused
by our setting it in this way.

Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24883:adcd6ab160fa
xen-unstable date:        Thu Feb 23 10:29:27 2012 +0000

13 years agoFix error recovery path in __gnttab_map_grant_ref
Haoyu Zhang [Wed, 7 Mar 2012 08:29:53 +0000 (08:29 +0000)]
Fix error recovery path in __gnttab_map_grant_ref

In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status  previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.

Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com>
Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24701:3574f4d67843
xen-unstable date:        Mon Feb 06 13:23:41 2012 -0800

13 years agox86/vMSI: miscellaneous fixes
Jan Beulich [Wed, 7 Mar 2012 08:26:25 +0000 (08:26 +0000)]
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24535:fb81b807c154
xen-unstable date:        Mon Jan 23 09:35:17 2012 +0000

13 years agoMove IOMMU faults handling into softirq for VT-d.
Dario Faggioli [Wed, 7 Mar 2012 08:22:38 +0000 (08:22 +0000)]
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24517:a7ae457c327c
xen-unstable date:        Tue Jan 17 11:11:26 2012 +0000

13 years agox86/passthrough: don't leak guest IRQs
Jan Beulich [Wed, 7 Mar 2012 08:19:48 +0000 (08:19 +0000)]
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must
not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset:   24448:3a22ed3ec534
xen-unstable date:        Mon Jan 02 09:26:19 2012 +0100

13 years agox86/emulator: workaround for AMD erratum 573
Jan Beulich [Wed, 7 Mar 2012 08:17:44 +0000 (08:17 +0000)]
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24417:1452fb248cd5
xen-unstable date:        Fri Dec 16 15:45:40 2011 +0100

13 years agox86, amd: Disable GartTlbWlkErr when BIOS forgets it
Jan Beulich [Wed, 7 Mar 2012 08:16:53 +0000 (08:16 +0000)]
x86, amd: Disable GartTlbWlkErr when BIOS forgets it

This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS
forgets to do is (or is just too old). Letting these errors enabled
can cause a sync-flood on the CPU causing a reboot.

The AMD BKDG recommends disabling GART TLB Wlk Error completely.

Based on a Linux patch from Joerg Roedel <joerg.roedel@amd.com>; see
e.g.
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24389:868d82faf651
xen-unstable date:        Tue Dec 13 09:45:11 2011 +0100

13 years agotools/firmware: remove "_PS0/3" Method
Xudong Hao [Wed, 7 Mar 2012 08:15:50 +0000 (08:15 +0000)]
tools/firmware: remove "_PS0/3" Method

Do not expose the ACPI power management "_PS0/3" Method to guest
firmware.  According to section 3.4 of the APCI specification 4.0, PCI
device control the device power through its own specification but not
through APCI.

Qemu pushes "_PS0/3" to guest will cause a mess between ACPI PM and
PCI PM as a result of incorrect ACPI table shipped with the guest
BIOS, it may cause a failure of PCI device PM state transition(from
PCI_UNKNOWN to PCI_D0).

Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Haitao Shan <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24357:832fa3f35432
xen-unstable date:        Mon Dec 05 19:35:06 2011 +0000

13 years agox86/mm: Don't lose track of the log dirty bitmap
Tim Deegan [Wed, 7 Mar 2012 08:13:47 +0000 (08:13 +0000)]
x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24282:a06cda9fb25f
xen-unstable date:        Thu Dec 01 14:17:16 2011 +0000

13 years agox86: small fixes to pcpu platform op handling
Jan Beulich [Wed, 7 Mar 2012 08:13:00 +0000 (08:13 +0000)]
x86: small fixes to pcpu platform op handling

XENPF_get_cpuinfo should init the flags output field rather than only
modify it.

XENPF_cpu_online must check for the input CPU number to be in range.

XENPF_cpu_offline must also do that, and should also reject attempts
to
offline CPU 0 (this fails in cpu_down() too, but preventing this here
appears more correct given that the code here calls
continue_hypercall_on_cpu(0, ...), which would be flawed if cpu_down()
would ever allow bringing down CPU 0 (and a distinct error code is
easier to deal with when debugging issues).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24201:9c6bea25f712
xen-unstable date:        Thu Nov 24 17:56:26 2011 +0100

13 years agox86/mm: change return code for log-dirty disabling
Andres Lagar-Cavilla [Wed, 7 Mar 2012 08:10:58 +0000 (08:10 +0000)]
x86/mm: change return code for log-dirty disabling

Disabling log dirty mode in HAP always returns -EINVAL. Make it
return the correct rc on success.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24190:6b3d8250ee2c
xen-unstable date:        Thu Nov 24 15:20:57 2011 +0000

13 years agox86/IO-APIC: refine EOI-ing of migrating level interrupts
Jan Beulich [Wed, 7 Mar 2012 08:02:59 +0000 (08:02 +0000)]
x86/IO-APIC: refine EOI-ing of migrating level interrupts

Rather than going through all IO-APICs and calling
io_apic_eoi_vector()
for the vector in question, just use eoi_IO_APIC_irq().

This in turn allows to eliminate quite a bit of other code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24155:0d50e704834f
xen-unstable date:        Fri Nov 18 09:18:41 2011 +0100

13 years agop2m: query/modify p2mt with p2m_lock held
Olaf Hering [Wed, 7 Mar 2012 07:59:58 +0000 (07:59 +0000)]
p2m: query/modify p2mt with p2m_lock held

Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   23908:88b6e08b8aa8
xen-unstable date:        Thu Oct 06 14:15:43 2011 +0100

13 years agoFix PV CPUID virtualization of XSave
Shan Haitao [Wed, 7 Mar 2012 07:55:10 +0000 (07:55 +0000)]
Fix PV CPUID virtualization of XSave

The patch will fix XSave CPUID virtualization for PV guests. The XSave
area size returned by CPUID leaf D is changed dynamically depending on
the XCR0. Tools/libxc only assigns a static value. The fix will adjust
xsave area size during runtime.

Note: This fix is already in HVM cpuid virtualization. And Dom0 is not
affected, either.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
xen-unstable changeset:   23853:b78235de5c64
xen-unstable date:        Sun Sep 18 00:01:58 2011 +0100

x86: Further fixes for xsave leaf in pv_cpuid().

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23955:bbde1453cbd9
xen-unstable date:        Thu Oct 13 15:58:55 2011 +0100

13 years agoxen: add missing unlock from gnttab_get_version
Ian Campbell [Thu, 23 Feb 2012 10:37:13 +0000 (10:37 +0000)]
xen: add missing unlock from gnttab_get_version

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Francisco Rocha <f.e.liberal-rocha@newcastle.ac.uk>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24871:66cc5b67e749
xen-unstable date:        Thu Feb 23 09:59:35 2012 +0000

13 years agomini-os: stop compiler complaint about unused variables
John McDermott [Thu, 23 Feb 2012 10:35:41 +0000 (10:35 +0000)]
mini-os: stop compiler complaint about unused variables

gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) complains about unused
variables
in mini-os drivers

Signed-off-by: John McDermott <john.mcdermott@nrl.navy.mil>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24743:86f2630d62a9
xen-unstable date:        Thu Feb 09 16:03:05 2012 +0000

minios: Remove unused variables warnings

s/DEBUG/printk/ in test_xenbus and all associated
do_*_test+xenbus_dbg_message
and always print the IRQ and MFN used by the xenbus on init.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: John McDermott <john.mcdermott@nrl.navy.mil>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24844:c78636d15ac5
xen-unstable date:        Mon Feb 20 18:48:32 2012 +0000

Backported-by: Keir Fraser <keir@xen.org>
13 years agognttab: miscellaneous fixes
Jan Beulich [Thu, 23 Feb 2012 10:34:14 +0000 (10:34 +0000)]
gnttab: miscellaneous fixes

- _GTF_* constants name bit positions, so binary arithmetic on them is
  wrong
- gnttab_clear_flag() cannot (on x86 and ia64 at least) simply use
  clear_bit(), as that may access more than the two bytes that are
  intended to be accessed

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24742:9fc810bb8145
xen-unstable date:        Thu Feb 09 16:39:16 2012 +0100

13 years agoIO-APIC: Reformat IO-APIC RTE debug info (v2)
Andrew Cooper [Thu, 23 Feb 2012 10:32:48 +0000 (10:32 +0000)]
IO-APIC: Reformat IO-APIC RTE debug info (v2)

Having the columns aligned makes for much easier reading.  Also remove
the commas which only add to visual clutter in combination with
spaces.

Furthermore, printing fewer characters makes it less likely that the
serial buffer will overflow resulting in loss of critical debugging
information.

Changes since v1:
 *  Format vector as hex rather than dec
 *  Contract some names
 *  destination mode uses 'L' or 'P' instead of full words
 *  trigger mode uses 'L' or 'E' instead of full words
 *  delivery mode uses short string instead of a number

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24700:5bd5830dea13
xen-unstable date:        Mon Feb 06 13:17:46 2012 -0800

13 years agox86: avoid deadlock after a PCI SERR NMI
David Vrabel [Thu, 23 Feb 2012 10:31:48 +0000 (10:31 +0000)]
x86: avoid deadlock after a PCI SERR NMI

If a PCI System Error (SERR) is asserted it causes an NMI. If this NMI
occurs while the CPU is in printk() then Xen may deadlock as
pci_serr_error() calls console_force_unlock() which screws up the
console lock.

printk() isn't safe to call from NMI context so defer the diagnostic
message to a softirq.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24690:dcc6d57e4c07
xen-unstable date:        Thu Feb 02 15:28:58 2012 +0000

13 years agoxen/xsm: fix incorrect handling of XSM hook return
Daniel De Graaf [Thu, 23 Feb 2012 10:30:50 +0000 (10:30 +0000)]
xen/xsm: fix incorrect handling of XSM hook return

If the XSM hook denied access, the execution incorrectly continued on
after an extra unlock domain.

Reported-by: John McDermott <john.mcdermott@nrl.navy.mil>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24684:833d80d3fbe7
xen-unstable date:        Thu Feb 02 15:23:04 2012 +0000

13 years agoxl: Drop -l option to xl cpupool-list
Ian Campbell [Mon, 13 Feb 2012 17:57:47 +0000 (17:57 +0000)]
xl: Drop -l option to xl cpupool-list

The implementation (which was a nop) was removed back in 22838:aab67c1c6b87 but
this now causes "set but not used" warnings from some compilers. Might as well
just nuke the option entirely.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24703:b611bff9a8fc
Backport-requested-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoUpdate QEMU_TAG, for CVE-2012-0029
Ian Jackson [Thu, 2 Feb 2012 13:56:13 +0000 (13:56 +0000)]
Update QEMU_TAG, for CVE-2012-0029

13 years agoxen: do not remap pirqs if !is_hvm_pv_evtchn_domain
Stefano Stabellini [Tue, 31 Jan 2012 11:47:29 +0000 (11:47 +0000)]
xen: do not remap pirqs if !is_hvm_pv_evtchn_domain

If the guest is an HVM guest and it is not using the vector callback
mechanism, refuse to remap pirqs onto event channels.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Tested-by: Paulian Bogdan Marinca <paulian@marinca.net>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24629:6c9a73817770
xen-unstable date:        Tue Jan 31 11:39:37 2012 +0000

13 years agovesa: flush lfb after zeroing
Andrew Cooper [Tue, 31 Jan 2012 11:45:57 +0000 (11:45 +0000)]
vesa: flush lfb after zeroing

If Xen is going to relinquish the VGA console, flush the linear frame
buffer after zeroing it in vesa_endboot().

Failing to do so in some circumstances leads to the actual linear
framebuffer on the graphics card still containing the output of the
Xen boot console can lead to ugly graphics output when dom0 is setting
up the graphics card for its own use.

While the patch is quite large, it is mostly just code motion to
prevent having to forward declare lfb_flush().  The only functional
change to vesa_endboot() is to insert a call to lbf_flush().

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24615:ac9f32525376
xen-unstable date:        Sat Jan 28 13:42:25 2012 +0000

13 years agoConsole: introduce console=none command line parameter
Andrew Cooper [Tue, 31 Jan 2012 11:45:37 +0000 (11:45 +0000)]
Console: introduce console=none command line parameter

Currenty, not specifying 'console=<foo>' on the command line causes
Xen to default to 'vga'.  Alternativly, the user can explicitly
specifiy 'console=vga|com1|com2'.

However, there is no way to specify that neither vga nor serial should
be used.  Specifying 'console=' does have the effect that neither vga
nor serial is set up, but at the cost of an "Bad console= option ''"
warning.

Therefore, expliticly support a 'console=none' option which does not
set up vga and does not set up serial, but does not trigger the bad
console warning.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24614:f8c2cf24a26c
xen-unstable date:        Sat Jan 28 13:41:42 2012 +0000

13 years agox86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.
Keir Fraser [Tue, 31 Jan 2012 11:44:57 +0000 (11:44 +0000)]
x86/hvm: Remove unnecessary packed attribute from hvm_hw_cpu_xsave struct.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24528:3d58058fc7a2
xen-unstable date:        Fri Jan 20 10:26:57 2012 +0000

13 years agoxen/xsm: Add missing dummy operation
James Carter [Fri, 20 Jan 2012 10:22:17 +0000 (10:22 +0000)]
xen/xsm: Add missing dummy operation

This patch adds a dummy op for the xsm_vcpuextstate operation.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
xen-unstable changeset:   23608:1a20a8586048
xen-unstable date:        Tue Jun 28 09:10:43 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>
13 years agoVMX: print Pause Loop Exiting disabled message just once
Jan Beulich [Tue, 17 Jan 2012 11:32:46 +0000 (11:32 +0000)]
VMX: print Pause Loop Exiting disabled message just once

... rather than per booting CPU.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24465:5b2676ac1321
xen-unstable date:        Mon Jan 09 16:01:44 2012 +0100

13 years agox86: emulate lea with two register operands correctly
David Vrabel [Tue, 17 Jan 2012 11:32:04 +0000 (11:32 +0000)]
x86: emulate lea with two register operands correctly

An lea instruction with two register operands should raise an
undefined instruction exception.

Skype does such a instruction and will crash when starting if it does
not get the exception.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24456:03781de56c31
xen-unstable date:        Thu Jan 05 15:47:16 2012 +0000

13 years agox86/vIRQ: IRR and TMR race condition bug fix
Yongan Liu [Tue, 17 Jan 2012 11:31:28 +0000 (11:31 +0000)]
x86/vIRQ: IRR and TMR race condition bug fix

In vlapic_set_irq, we set the IRR register before the TMR. And the IRR
might be serviced before setting TMR, and even worse EOI might occur
before TMR setting, in which case the vioapic_update_EOI won't be
called, and further prevent all the subsequent interrupt injecting.
Reorder setting the TMR and IRR will solve the problem.

Besides, KVM has fixed a similar bug in:
http://markmail.org/search/?q=APIC_TMR#query:APIC_TMR+page:1+mid:rphs4f7lkxjlldne+state:results

Signed-off-by: Yongan Liu<Liuyongan@huawei.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
xen-unstable changeset:   24453:02b92d035f64
xen-unstable date:        Thu Jan 05 09:29:59 2012 +0100

13 years agox86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.
Tim Deegan [Tue, 17 Jan 2012 11:30:37 +0000 (11:30 +0000)]
x86: Remove timeouts from INIT-SIPI-SIPI sequence when using x2apic.

Some of the timeouts are pointless since they're waiting for the ICR
to ack the IPI delivery and that doesn't happen on x2apic.
The others should be benign (and are suggested in the SDM) but
removing them makes AP bringup much more reliable on some test boxes.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23724:b3434f24b082
xen-unstable date:        Tue Jul 19 14:13:01 2011 +0100

X86: Add a delay between INIT & SIPIs for tboot AP bring-up in X2APIC case

Without this delay, Xen could not bring APs up while working with
TXT/tboot, because tboot needs some time in APs to handle INIT before
becoming ready for receiving SIPIs (this delay was removed as part of
c/s 23724 by Tim Deegan).

Signed-off-by: Gang Wei <gang.wei@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24447:a7b2610b8e5c
xen-unstable date:        Thu Dec 29 10:07:54 2011 +0000

13 years agox86/ucode: fix for AMD Fam15 CPUs
Christoph Egger [Sun, 15 Jan 2012 22:08:13 +0000 (22:08 +0000)]
x86/ucode: fix for AMD Fam15 CPUs

Remove hardcoded maximum size a microcode patch can have. This is
dynamic now.

The microcode patch for family15h can be larger than 2048 bytes and
gets silently truncated.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Backport from xen-unstable changeset 24411:ca5f588bd203 to Xen 4.1

13 years agopygrub: example grub2 configuration file (fedora-16-with-xen.grub2)
Michael Young [Tue, 10 Jan 2012 17:09:26 +0000 (17:09 +0000)]
pygrub: example grub2 configuration file (fedora-16-with-xen.grub2)

Sample grub2 configuration file (some duplication removed) from Fedora 16
with a xen hypervisor installed

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24003:c681dd5aecf3
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopyrgrub: cope with configurations with set default="${saved_entry}" line
Michael Young [Tue, 10 Jan 2012 17:08:27 +0000 (17:08 +0000)]
pyrgrub: cope with configurations with set default="${saved_entry}" line

Fedora 16 grub2 configuration file can have lines like
    set default="${saved_entry}"
and a string containing an integer is expected

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 24002:979bc34d0ad0
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: cope with configurations with submenus
Michael Young [Tue, 10 Jan 2012 17:08:22 +0000 (17:08 +0000)]
pygrub: cope with configurations with submenus

The grub2 configuration file in Fedora 16 can have one or more
menuentrys in a submenu, with configuration of the form
    submenu "Xen 4.1" {
    menuentry ... {
    ...
    }
    }
(this example occurs when the xen hypervisor is installed on the
guest)

Ignore the submenu line and the corresponding }

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 24001:152049468175
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: Allow GPT partition references
Michael Young [Tue, 10 Jan 2012 17:08:17 +0000 (17:08 +0000)]
pygrub: Allow GPT partition references

The grub2 configuration file in Fedora 16 can have GPT partition
references like (hd0,gpt2) so remove the "gpt" string where necessary

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 24000:65679fee0177
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: look in /boot/grub2 (for eg Fedora 16)
Michael Young [Tue, 10 Jan 2012 17:07:58 +0000 (17:07 +0000)]
pygrub: look in /boot/grub2 (for eg Fedora 16)

Fedora 16 puts grub configuration files in /boot/grub2/grub.cfg so
pygrub should look there as well

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 23999:138f707fa598
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: check all GPT partitions
Michael Young [Tue, 10 Jan 2012 17:05:02 +0000 (17:05 +0000)]
pygrub: check all GPT partitions

On Fedora 16 the first GPT partition is a boot partition for grub2 with
the grub2 configuration in the second partition.
Check all GPT partitions for grub configuration, not just the first.

[ Also remove now-inaccurate comment. -iwj ]

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 23998:85d7b207fabc
Backport-requested-by: Pasi Karkkainen <pasik@iki.fi>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: fix extlinux parsing
Roger Pau Monne [Tue, 10 Jan 2012 16:10:00 +0000 (16:10 +0000)]
pygrub: fix extlinux parsing

pygrub was unable to parse extlinux config files correctly, exactly
the ones like:

LABEL grsec
  KERNEL vmlinuz-3.0.10-grsec
  APPEND initrd=initramfs-3.0.10-grsec
root=UUID=cfd4a7b4-8c40-4025-b877-8205f1c622ee
modules=sd-mod,usb-storage,ext4 xen quiet

This patch fixes it, adding a new case when parsing the "append" line,
that searches for the initrd image.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
xen-unstable changeset: 24460:ff0685e8419b
Backport-requested-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoipxe: fix compilation issues with some gcc versions
Roger Pau Monne [Sun, 18 Dec 2011 14:52:52 +0000 (14:52 +0000)]
ipxe: fix compilation issues with some gcc versions

Backported some changes from current ipxe, to fix a issue with some
new versions of gcc that add -fPIC by default, and compilation fails
with the following error:

arch/i386/core/cpu.c: In function 'get_cpuinfo':
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'
arch/i386/include/bits/cpu.h:79:2: error: inconsistent operand
constraints in an 'asm'

Two patches from ipxe git have been added. The problem is reproducible
with at least this version of gcc:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-uclibc/4.6.2/lto-wrapper
Target: x86_64-alpine-linux-uclibc
Configured with:
/home/buildozer/aports/main/gcc/src/gcc-4.6.2/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--build=x86_64-alpine-linux-uclibc --host=x86_64-alpine-linux-uclibc
--target=x86_64-alpine-linux-uclibc --with-pkgversion='Alpine
4.6.2-r1' --disable-altivec --disable-checking --disable-fixed-point
--disable-libssp --disable-libstdcxx-pch --disable-multilib
--disable-nls --disable-werror --enable-__cxa_atexit --enable-cld
--enable-esp --enable-cloog-backend
--enable-languages=c,c++,objc,java,go --enable-shared
--enable-target-optspace --enable-tls --enable-threads
--with-dynamic-linker=ld64-uClibc.so.0.9.32
--with-dynamic-linker-prefix=/lib --with-system-zlib
--without-system-libunwind
Thread model: posix
gcc version 4.6.2 (Alpine 4.6.2-r1)

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoX86-MCE: fix a bug of xen-mceinj tool
Liu, Jinsong [Sun, 18 Dec 2011 14:48:28 +0000 (14:48 +0000)]
X86-MCE: fix a bug of xen-mceinj tool

Fix a bug of xen-mceinj tool which used to test mce by software way.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24429:9587ccc2ae31
xen-unstable date:        Sun Dec 18 14:40:00 2011 +0000

13 years agoAllow VMs to query their own grant table version.
Paul Durrant [Sun, 18 Dec 2011 14:47:23 +0000 (14:47 +0000)]
Allow VMs to query their own grant table version.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24427:931bf1105730
xen-unstable date:        Sun Dec 18 14:38:32 2011 +0000

13 years agox86/AMD: use correct shift count when merging model and stepping
Jan Beulich [Sun, 18 Dec 2011 14:45:44 +0000 (14:45 +0000)]
x86/AMD: use correct shift count when merging model and stepping

... for legacy errata matching.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24412:99caac2e35df
xen-unstable date:        Thu Dec 15 14:28:45 2011 +0100
Committed-by: Keir Fraser <keir@xen.org>