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.
George Dunlap [Thu, 7 Apr 2011 14:41:05 +0000 (15:41 +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
George Dunlap [Thu, 7 Apr 2011 14:40:44 +0000 (15:40 +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
In certain cases this will allow us to load old HVM save images where
an HVM saved chunk has subsequently been extended with new
fields. Rather than fail to load the chunk, we can pad the extended
structure with zeroes, if the caller knows how to handle that.
Signed-off-by: Keir Fraser <keir@xen.org> Acked-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 22524:1f08b2932a52
xen-unstable date: Wed Dec 15 10:21:05 2010 +0000
Ian Campbell [Sat, 26 Mar 2011 09:34:08 +0000 (09:34 +0000)]
tools/blktap, blktap2: include <sys/mount.h> instead of <linux/fs.h>
The former is a userspace sanitised header which contains the
definitions we need. In some distros linux/fs.h defines WRITE which
conflicts with blktaps own use of that name.
Also there is no reason to use <linux/errno.h> over the more normal
<errno.h>.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22765:0dbad563a659
xen-unstable date: Mon Jan 17 17:14:20 2011 +0000
Fix the xencommons init script chkconfig configuration since the
priority was missing here and chkconfig was complaining about invalid
chkconfig script so I added both start and stop priorities to the
chkconfig line and it was working fine, the script was successfully
added to chkconfig when using `chkconfig --add xencommons` and
management using the chkconfig utility was now possible.
Tested on RHEL-5 Server with Xen-4.1-unstable installed, running on
PVops kernel 2.6.32.15 and it was working fine.
Signed-off-by: Michal Novotny <minovotn@redhat.com>
xen-unstable changeset: 21657:e2f5e4f3481c
xen-unstable date: Tue Jun 22 16:22:30 2010 +0100
Jan Beulich [Tue, 15 Mar 2011 13:57:11 +0000 (13:57 +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
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>
xen-unstable changeset: 22967:5bc39222773d
xen-unstable date: Thu Mar 03 16:55:27 2011 +0000
Jan Beulich [Sat, 12 Mar 2011 13:28:05 +0000 (13:28 +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
Ian Jackson [Thu, 10 Mar 2011 18:39:48 +0000 (18:39 +0000)]
tools: provide startup script for libxl
In Xen 4.0 there is no /etc/init.d/xencommons. This means that in
most situations you don't get xenstored, and xl doesn't work, unless
you do something shonky like starting and then immediately stopping
xend.
To test xl, my automatic testing system therefore provides its own
init script to start xenstored and xenconsoled. This script was
created by borrowing from /etc/init.d/xend and other init scripts in
various versions of xen.hg.
Here it is[1], as a new "xencommons" script. The user will still have
to add appropriate rc links, and only a script for Linux is provided.
We do not want to backport the refactoring of /etc/init.d/xend, so
xend users should not enable this script.
Keir Fraser [Thu, 24 Feb 2011 09:36:23 +0000 (09:36 +0000)]
amd-k8-mce: remove a stray break statement
This was a leftover of converting from a switch to an if/else
somewhere between 3.4 and 4.0.
It also looks suspicious that MCEQUIRK_K7_BANK0 is not actually used
anywhere. Perhaps amd_k7_mcheck_init() and amd_k8_mcheck_init() were
intended to get (partially) folded?
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22947:598d1fc295b6
xen-unstable date: Thu Feb 24 09:33:19 2011 +0000
Keir Fraser [Thu, 10 Feb 2011 09:04:05 +0000 (09:04 +0000)]
amd iommu: Fix a xen crash after pci-attach
pci-detach triggers IO page table deallocation if the last passthru
device has been removed from pdev list, and this will result a BUG on
amd systems for next pci-attach. This patch fixes this issue.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
xen-unstable changeset: 22872:cba9a84d32fb
xen-unstable date: Sun Feb 06 16:54:01 2011 +0000
Keir Fraser [Sun, 6 Feb 2011 17:40:19 +0000 (17:40 +0000)]
trace: Change trace_var argument to void*, to match __trace_var
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 22877:575d2f40acc4
xen-unstable date: Sun Feb 06 17:22:44 2011 +0000
Keir Fraser [Sun, 6 Feb 2011 17:39:10 +0000 (17:39 +0000)]
hvm amd: Fix 32bit guest VM save/restore issues associated with SYSENTER MSRs
This patch turn-on SYSENTER MSRs interception for 32bit guest VMs on
AMD CPUs. With it, hvm_svm.guest_sysenter_xx fields always contain the
canonical version of SYSENTER MSRs and are used in guest save/restore.
The data fields in VMCB save area are updated as necessary.
Reported-by: James Harper <james.harper@bendigoit.com.au> Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset: 22873:186162762071
xen-unstable date: Sun Feb 06 17:03:09 2011 +0000
Wei Gang [Wed, 26 Jan 2011 09:05:53 +0000 (09:05 +0000)]
x86: Fix pirq teardown on domain destruction.
The privilege check in unmap_domain_pirq() fails since the teardown
completes in RCU (idle domain) context. We can remove the check since
it is covered in physdev_op() already, which is the only potentially
unprivileged caller.
Signed-off-by: Wei Gang <gang.wei@intel.com>
xen-unstable changeset: 22816:e7f44fb4ecc3
xen-unstable date: Wed Jan 26 08:54:12 2011 +0000
Keir Fraser [Wed, 26 Jan 2011 09:04:36 +0000 (09:04 +0000)]
x86: blacklist new AMD CPUID bits for PV domains
there are some new CPUID bits (and leaves) which Dom0 and PV domains
should not see to avoid trouble, since we don't emulate the features.
The most prominent one is a topology leaf, which contains information
specific to the physical CPU, not the virtual one. To avoid confusion
(and possibly crashes) due to a confused Dom0 scheduler simply disable
these bits.
Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 22815:4785c70c2b6d
xen-unstable date: Wed Jan 26 08:45:40 2011 +0000
Keir Fraser [Fri, 14 Jan 2011 08:17:07 +0000 (08:17 +0000)]
pv-drivers: use PCI interfaces to request IO and MEM resources on platform device
This is the correct interface to use and something has broken the use
of the previous incorrect interface (which fails because the request
conflicts with the resources assigned for the PCI device itself
instead of nesting like the PCI interfaces do).
pci_request_region() has been available since at least Linux 2.6.5.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22747:7bc5e072d986
xen-unstable date: Fri Jan 14 08:02:26 2011 +0000
John Weekes [Fri, 14 Jan 2011 08:04:48 +0000 (08:04 +0000)]
stubdom: Fix stubdom-dm using "grep" improperly
stubdom-dm uses "grep" on "xm list" output to determine whether it is
already running. The existing behavior is to use "grep $domname-dm"
but this will result in a false-positive in the case of another domU
running whose name ends with the full new name; for instance, if
"abctest-dm" is running, a new "test-dm" will spin forever, waiting
for it the end.
Any easy fix is to have it use "grep -w" instead of "grep", searching
for the whole word only.
It also might be worth considering a switch to "xl list" from "xm
list", here and in other places.
Signed-off-by: John Weekes <lists.xen@nuclearfallout.net> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22714:6852e3e7ef58
xen-unstable date: Tue Jan 11 16:42:41 2011 +0000
Keir Fraser [Sat, 8 Jan 2011 10:45:22 +0000 (10:45 +0000)]
x86: Fix atomic_write*() macros to correctly inform GCC that memory
it knows about is being written to.
The bug is a copy-and-paste error from inline asm that writes to I/O
memory. In that case, as with asm for accessign guest memory,
specifying memory as a read-only parameter is acceptable because the
memory cannot alias with anything that GCC reads directly.
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 22683:533d6e5c0099
xen-unstable date: Sat Jan 08 10:05:55 2011 +0000
Keir Fraser [Wed, 5 Jan 2011 10:01:11 +0000 (10:01 +0000)]
relax vCPU pinned checks
Both writing of certain MSRs and VCPUOP_get_physid make sense also for
dynamically (perhaps temporarily) pinned vcpus.
Likely a couple of other MSR writes (MSR_K8_HWCR, MSR_AMD64_NB_CFG,
MSR_FAM10H_MMIO_CONF_BASE) would make sense to be restricted by an
is_pinned() check too, possibly also some MSR reads.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22649:39194f457534
xen-unstable date: Wed Jan 05 09:57:15 2011 +0000
Keir Fraser [Fri, 24 Dec 2010 10:29:50 +0000 (10:29 +0000)]
VT-d: fix and improve print_vtd_entries()
Fix leaking of mapped domain pages (root_entry and ctxt_entry when
falling out of the level traversing loop). Do this by re-arranging
things slightly so that a mapping is retained only as long as it
really is needed.
Fix the failure to use map_domain_page() in the level traversing loop
of the function.
Add a mssing return statement in one of the error paths.
Also I wonder whether not being able to call print_vtd_entries() from
iommu_page_fault_do_one() in ix86 is still correct, now that
map_domain_page() is IRQ safe.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22632:7cc87dcf30a1
xen-unstable date: Fri Dec 24 10:14:01 2010 +0000
Keir Fraser [Fri, 24 Dec 2010 10:29:14 +0000 (10:29 +0000)]
re-add calls accidentally deleted from run_all_nonirq_keyhandlers()
c/s 22538:a3a29e67aa7e, having got applied in a form different from
the one submitted, resulted in the calls to
console_{start,end}_log_everything() getting removed without
replacement. Add them back since, other than run_all_keyhandlers(),
this doesn't run with log-everything already in effect.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22631:dca1b7cf2e2c
xen-unstable date: Fri Dec 24 10:12:58 2010 +0000
Keir Fraser [Fri, 24 Dec 2010 10:28:35 +0000 (10:28 +0000)]
x86 hvm ept: Remove EPT guest linear address validation
For EPT violation resulting from an attempt to load the guest PDPTEs
as part of the execution of the MOV CR instruction, the EPT_GLA_VALID
is not valid. This situation should not happen in most situation,
since we always populate guest memory. But this is not ture for PAE
guest under the PoD/Page sharing situation. In that situation, a page
pointed by CR3 may be un-populated, and we need handle it in such
situation.
Keir Fraser [Mon, 20 Dec 2010 10:21:20 +0000 (10:21 +0000)]
tools/python: fix xm list for Python 2.7
This patch fixes
Unexpected error: <type 'exceptions.AttributeError'>
This is due to xmlrpc changes in Python 2.7. This patch should
fixe it for both old and new versions.
Signed-off-by: Michael Young <m.a.young@durham.ac.uk> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22045:2940165380de
xen-unstable date: Thu Aug 19 17:09:30 2010 +0100
Keir Fraser [Fri, 17 Dec 2010 17:57:33 +0000 (17:57 +0000)]
tools: fetch remote changesets when force refetching/resetting qemu
This makes "make tools/ioemu-dir-force-update" usable for picking up
an entirely new QEMU_TAG.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22425:d6c2695f05eb
xen-unstable date: Tue Nov 23 19:29:13 2010 +0000
Keir Fraser [Fri, 17 Dec 2010 17:56:52 +0000 (17:56 +0000)]
tools: provide explicit target for refetching/resetting qemu
This patch adds an explicit update mechanism:
make tools/ioemu-dir-force-update
This isn't brilliant but is better than doing "cd tools/ioemu-remote
&& git reset --hard <sha1...>" by hand.
Note that invoking this target will destroy all working tree changes
made to qemu-xen.
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22381:2bedffabbcab
xen-unstable date: Tue Nov 09 18:15:25 2010 +0000
Keir Fraser [Fri, 17 Dec 2010 17:56:00 +0000 (17:56 +0000)]
tools/python: Replace python string exceptions with ValueError exceptions
There are at least some syntax errors when trying to use the xen utils
with python2.6. The attached patch changes these string exception
into ValueErrors:
- tools/python/xen/util/bugtool.py (getBugTitle)
- tools/python/xen/xend (class XendBase): not catched
- tools/python/xen/xm/xenapi_create.py (sxp2xmlconvert_sxp_to_xml):
the method already raises a ValueError for similiar condition.
- tools/python/xen/xm/main.py (xm_network_attach): not catched.
For all but maybe the first one, the replacement of the string
exceptions into ValueErrors seems to be safe.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22153:95c90bd63aed
xen-unstable date: Tue Sep 14 17:46:21 2010 +0100
Keir Fraser [Fri, 17 Dec 2010 16:13:54 +0000 (16:13 +0000)]
tools/hotplug/Linux: Avoid dependency on iptables conntrack module.
Checking for RELATED,ESTABLISHED traffic being sent to a domU requires
connection tracking, which adds unexpected (to most users) load to
dom0. Heavily loaded systems can fill the conntrack tables.
So avoid this, be more liberal in what we accept, and leave it to domU
to police its own input.
tools/hotplug/Linux: supply --physdev-is-bridged in iptables runes
With newer (pvops) kernels logs get flooded with this iptables
warning: physdev match: using --physdev-out in the OUTPUT, FORWARD and
POSTROUTING chains for non-bridged traffic is not supported anymore
Using the --physdev-is-bridged option prevents this.
See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571634#10
Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22385:b0fe8260cefa
xen-unstable date: Wed Nov 10 14:37:19 2010 +0000
Keir Fraser [Wed, 15 Dec 2010 10:47:52 +0000 (10:47 +0000)]
ept: Remove lock in ept_get_entry, replace with access-once semantics.
This mirrors the RVI/shadow situation, where p2m read access is
lockless because it's done in the hardware (linear map of the p2m
table).
This fixes the original bug (call it bug A) without introducing bug B
(a deadlock).
Bug A was caused by a race when updating p2m entries: between testing
if it's valid, and testing if it's populate-on-demand, it may have
been changed from populate-on-demand to valid.
My original patch simply introduced a lock into ept_get_entry, but
that caused bug B, caused by circular locking order: p2m_change_type
[grabs p2m lock] -> set_p2m_entry -> ept_set_entry ->
ept_set_middle_level -> p2m_alloc [grabs hap lock] write cr4 ->
hap_update_paging_modes [grabes hap lock] -> hap_update_cr3 ->
gfn_to_mfn -> ept_get_entry -> [grabs p2m lock]
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 22526:7a5ee3800417
xen-unstable date: Wed Dec 15 10:47:05 2010 +0000
Keir Fraser [Wed, 15 Dec 2010 10:32:22 +0000 (10:32 +0000)]
tmem: two wrongs (or three lefts and a wrong) make a right
These two bugs apparently complement each other enough that
they escaped problems in my testing, but eventually gum
up the works and are obviously horribly wrong.
Found while developing tmem for native Linux.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 22525:01f3b3509023
xen-unstable date: Wed Dec 15 10:27:18 2010 +0000
Keir Fraser [Wed, 15 Dec 2010 10:31:59 +0000 (10:31 +0000)]
x86/iommu: account for necessary allocations when calculating Dom0's
initial allocation size
As of c/s 21812:e382656e4dcc, IOMMU related allocations for Dom0
happen only after it got all of its memory allocated, and hence the
reserve (mainly for setting up its swiotlb) may get exhausted without
accounting for the necessary allocations up front.
While not precise, the estimate has been found to be within a couple
of pages for the systems it got tested on.
For the calculation to be reasonably correct, this depends on the
patch titled "x86/iommu: don't map RAM holes above 4G" sent out
yesterday.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22506:618ba64260fa
xen-unstable date: Tue Dec 14 09:54:10 2010 +0000
Keir Fraser [Wed, 15 Dec 2010 10:31:08 +0000 (10:31 +0000)]
x86 acpi: Follow Windows behaviour more closely during reset.
This follows some changes proposed for upstream Linux:
1. Do not check the FADT reset register size/offset
2. Try ACPI poking twice during our reset attempt sequence
Hopefully this will help us reset reliably on a wider range of
platforms.
Keir Fraser [Fri, 10 Dec 2010 11:34:28 +0000 (11:34 +0000)]
x86 hvm: Add a new HVMOP to get the current Xen system time
Xen absolute system time, so that it can use SCHEDOP_poll in a
sensible fashion. HVM PV drivers can't use the normal PV clock
because they might have TSC offsets that hey don't know about.
Keir Fraser [Thu, 9 Dec 2010 10:14:57 +0000 (10:14 +0000)]
x86/mm: change ASSERTs to BUG_ONs in mem_sharing.c
These two ASSERTs have important side-effects so make them into
BUG_ONs
consistent with the rest of the file.
Bug found by Jui-Hao Chiang <juihaochiang@gmail.com>.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 22467:89116f28083f
xen-unstable date: Wed Dec 08 10:46:31 2010 +0000
Keir Fraser [Tue, 7 Dec 2010 18:37:31 +0000 (18:37 +0000)]
x86: remove BUG_ON() from QUIRK_IOAPIC_*_REGSEL handler
Since (non-pvops, 32-bit only up to 2.6.27) Linux would report "BAD"
unconditionally on all SiS chipset versions (it only looks for a PCI
device at 0000:00:00.0 with SiS as the vendor), we must not crash if
the report on a 64-bit hypervisor doesn't match the #define (which is
zero).
While we could honor the quirk indication even on 64-bit, it doesn't
seem worthwhile, as there's no evidence that newer SiS chipsets
(supporting 64-bit CPUs) are actually affected.
This should also address bug 1687 (mis-reported, however, afaict).
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22466:bfd13358b8bf
xen-unstable date: Tue Dec 07 18:32:04 2010 +0000
Keir Fraser [Wed, 1 Dec 2010 20:14:56 +0000 (20:14 +0000)]
x86: fix IRQ migration when using directed EOI (broken with c/s 20465)
In directed-EOI mode, there is no chance to do the migration in
mask_and_ack_level_ioapic_irq(), as the remote IRR bit can't possibly
be clear after issuing the EOI to the LAPIC. Consequently, there's no
point to even try. Instead, migration must be done in
end_level_ioapic_irq(), and it requires masking the interrupt source
prior to issuing the EOI to the IO-APIC.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 22452:62bf12040b0f
xen-unstable date: Wed Dec 01 20:10:27 2010 +0000
Keir Fraser [Tue, 30 Nov 2010 11:38:16 +0000 (11:38 +0000)]
x86 hvm: Do not overwrite boot-cpu capability data on VMX/SVM startup.
Apparently required back in the earliest days of Xen, we now properly
initialise CPU capabilities early during bootstrap. Re-writing
capability data later now causes problems if specific features have
been deliberately masked out.
Thanks to Weidong Han at Intel for finding such a bug where XSAVE
feature is masked out by default, but then erroneously written back
during VMX initialisation. This would cause memory corruption problems
during boot for XSAVE-capable systems.
Keir Fraser [Mon, 29 Nov 2010 14:46:43 +0000 (14:46 +0000)]
x86: tighten filter on ptwr_do_page_fault()
Even not-so-recent Linux may, due to post-2.6.18 changes to the
process creation code, cause quite a number (depending on environment
and argument size) of faulting accesses to user space originating from
kernel mode. Generally those happen for non-present pages and would
lead to a nested page fault from guest_get_eff_l1e(). They can be
avoided by checking for PFEC_page_present as long as the guest isn't
running on shadow page tables.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 22449:3afb5ecbf69f
xen-unstable date: Mon Nov 29 14:40:55 2010 +0000
Keir Fraser [Mon, 29 Nov 2010 14:46:01 +0000 (14:46 +0000)]
x86-64: don't crash Xen upon direct pv guest access to GDT/LDT mapping area
handle_gdt_ldt_mapping_fault() is intended to deal with indirect
accesses (i.e. those caused by descriptor loads) to the GDT/LDT
mapping area only. While for 32-bit segment limits indeed prevent the
function being entered for direct accesses (i.e. a #GP fault will be
raised even before the address translation gets done, on 64-bit even
user mode accesses would lead to control reaching the BUG_ON() at the
beginning of that function.
Fortunately the fix is simple: Since the guest kernel runs in ring 3,
any guest direct access will have the "user mode" bit set, whereas
descriptor loads always do the translations to access the actual
descriptors as kernel mode ones.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Further, relax the BUG_ON() in handle_gdt_ldt_mapping_fault() to a
check-and-bail. This avoids any problems in future, if we don't
execute x86_64 guest kernels in ring 3 (e.g., because we use a
lightweight HVM container).
Keir Fraser [Wed, 10 Nov 2010 14:16:45 +0000 (14:16 +0000)]
hvmloader: fix off-by-one-bit error when initialising PCI devices
hvmloader is responsible for - amoungst other things - initialising
the PCI device BARs prior to loading the guest BIOS. The previous
code only probed for devfn up to 128. The lower 3 bits are function
IDs so this meant that only devices in slots 0-15 were actually being
initialized.
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
xen-unstable changeset: 22383:cba667fb80cf
xen-unstable date: Wed Nov 10 13:58:16 2010 +0000
hvmloader: Fix 22383:cba667fb80cf iterating over defns 0..255
We need to declare devfn as wider than 8 bits for a loop 0<devfn<256
to terminate.
Keir Fraser [Mon, 8 Nov 2010 15:36:58 +0000 (15:36 +0000)]
Fix "Error: Device 51952 not connected" error when using pygrub
The following is the process of booting a DomU with 'mounted-blktap2'
(VHD
for example) and 'pygrub' as bootloader:
1. Connect boot-device to Dom0 as '/dev/xpvd'
2. Pygrub get info for load DomU
3. Disconnect boot-device from Dom0
4. Boot DomU
During step 3 the created device is disconnected from Dom0, but
xenstore does not scrape away after the device is disconnected so you
get the following error:
"Error: Device /dev/xvdp (51952, tap2) is already connected."
During step 3 xend calls destroyDevice always with 'tap' as argument.
Keir Fraser [Mon, 8 Nov 2010 15:35:30 +0000 (15:35 +0000)]
tools/xenpaging: Add _XOPEN_SOURCE to fix build problems with recent gcc
This patch fixes compilation issues with
gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21).
Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 22023:af6799abc6e9
xen-unstable date: Wed Aug 18 16:48:25 2010 +0100
Keir Fraser [Wed, 3 Nov 2010 08:28:36 +0000 (08:28 +0000)]
VT-d: fix device assignment failure (regression from Xen c/s 19805:2f1fa2215e60)
If the device at <secbus>:00.0 is the device the mapping operation was
initiated for, trying to map it a second time will fail, and hence
this second mapping attempt must be prevented (as was done prior to
said c/s).
While at it, simplify the code a little, too.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Weidong Han <weidong.han@intel.com>
xen-unstable changeset: 22348:2dfba250c50b
xen-unstable date: Wed Nov 03 08:18:51 2010 +0000