tools/hotplug: locking.sh script: fix lock directory remains on error bug
_release_lock should be used instead of release_lock.
sigerr is introduced so that it can be redefined by
xen-hotplug-common.sh to a version which writes error status to
xenstore.
This matches similar checks done in Linux, since no good can come from
a domain trying to enable both MSI and MSI-X on the same device at the
same time.
This patch masks PIC and IOAPIC RTE's before x2APIC enabling, unmask
and restore them after x2APIC enabling. It also really enables
interrupt remapping before x2APIC enabling instead of just checking
interrupt remapping setting. This patch also handles all x2APIC
configuration including BIOS settings and command line
settings. Especially, it handles that BIOS hands over in x2APIC mode
(when there is apic id > 255). It checks if x2APIC is already enabled
by BIOS. If already enabled, it will disable interrupt remapping and
queued invalidation first, then enable them again.
x2APIC/VT-d: improve interrupt remapping and queued invalidation enabling and disabling
x2APIC depends on interrupt remapping, so interrupt remapping needs to
be enabled before x2APIC. Usually x2APIC is not enabled
(x2apic_enabled=0) when enable interrupt remapping, although x2APIC
will be enabled later. So it needs to pass a parameter to set
interrupt mode in intremap_enable, instead of checking
x2apic_enable. This patch adds a parameter "eim" to intremap_enable to
achieve it. Interrupt remapping and queued invalidation are already
enabled when enable x2apic, so it needn't to enable them again when
setup iommu. This patch checks if interrupt remapping and queued
invalidation are already enable or not, and won't enable them if
already enabled. It does the similar in disabling, that's to say don't
disable them if already disabled.
A drhd is created when parse ACPI DMAR table, but drhd->iommu is not
allocated until iommu setup. But iommu is needed by x2APIC which will
enable interrupt remapping before iommu setup. This patch allocates
iommu when create drhd. And then drhd->ecap can be removed because
it's the same as iommu->ecap.
Currently "make stubdom" on its own fails because it depends on files
being installed by the results of "make tools". This also means that
in some circumstances a parallel "make tools stubdom" (or "make all")
can fail due to races. So make "make stubdom" depend on "make tools"
having completed first.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset: 21760:84719437205c
xen-unstable date: Fri Jul 09 12:22:52 2010 +0100
The hardware CPUID-levelling features level the feature flags but
don't change the CPU family/model/stepping. Relax the HVM restore
check on family/model/stepping to printk but not veto the load, so
that VMs can be migrated between machines that have been
CPUID-levelled.
xen: allow HVM save/restore from different changesets
Allow HVM save/restore from different changesets of Xen. The HVM save
records are supposed to be backwards compatible; XenServer
live-migrates between versions of Xen during upgrades.
xen: make the shadow allocation hypercalls include the p2m memory
in the total shadow allocation. This makes the effect of allocation
changes consistent regardless of p2m activity on boot.
Otherwise vcpu_periodic_timer_work() can think the next timer is in
the future (and re-issue it unchanged) while timer_softirq_action()
thinks it's in the past (and fires it immediately), leading to
livelock.
tools/libxl: allow setting of timer_mode, hpet and vpt_align parameters
Implement parsing for timer_mode, hpet and vpt_align parameters.
These are all HVM only parameters and hpet/vpt_align are boolean so
change types and place in hvm union accordingly. Also HPET is x86 only
on principle so make this compile-time conditional on arch as-is
viridian.
This path enables AMD OSVW (OS Visible Workaround) feature for
Xen. New AMD errata will have a OSVW id assigned in the future. OS is
supposed to check OSVW status MSR to find out whether CPU has a
specific erratum. Legacy errata are also supported in this patch:
traditional family/model/stepping approach will be used if OSVW
feature isn't applicable. This patch is adapted from Hans Rosenfeld's
patch submitted to Linux kernel.
After getting a report of 3.2.3's xenmon crashing Xen (as it turned
out this was because c/s 17000 was backported to that tree without
also applying c/s 17515), I figured that the hypervisor shouldn't rely
on any specific state of the actual trace buffer (as it is shared
writable with Dom0)
[GWD: Volatile quantifiers have been taken out and moved to another
patch]
To make clear what purpose specific variables have and/or where they
got loaded from, the patch also changes the type of some of them to be
explicitly u32/s32, and removes pointless assertions (like checking an
unsigned variable to be >= 0).
I also took the prototype adjustment of __trace_var() as an
opportunity to simplify the TRACE_xD() macros. Similar simplification
could be done on the (quite numerous) direct callers of the function.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 21706:ae68758f8862
xen-unstable date: Fri Jul 02 18:56:34 2010 +0100
This patch implements HVMOP_pagetable_dying: an hypercall for
guests to notify Xen that a pagetable is about to be destroyed so that
Xen can use it as a hint to unshadow the pagetable soon and unhook the
top-level user-mode shadow entries right away.
Gianluca Guida is the original author of this patch.
"I am removing the tsc_scaled variable that is never actually used
because when tsc needs to be scaled vtsc is 1. I am also making this
more explicit in tsc_set_info. I am also removing hvm_domain.gtsc_khz
that is a duplicate of d->arch.tsc_khz. I am using scale_delta(delta,
&d->arch.ns_to_vtsc) to scale the tsc value before returning it to the
guest like in the pv case. I added a feature flag to specify that the
pvclock algorithm is safe to be used in an HVM guest so that the guest
can now use it without hanging."
Version 2 fixes a bug which breaks PV domU time.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset: 21445:c1ed00d49534
xen-unstable date: Sat May 22 06:31:47 2010 +0100
Keir Fraser [Wed, 30 Jun 2010 17:23:19 +0000 (18:23 +0100)]
Use fixed-width types in the memory event interface
Set the types in the public memory_event header file to use
fixed-sized and self-aligned fields rather than "unsigned long". AIUI
this feature only works with 64-bit hypervisors but I think this
change will be necessary to use 32-on-64 dom0 tools.
This breaks compatibility with older builds of the tools, but I can't
see any way to avoid it short of __attribute__((__packed__)).
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: Patrick Colp <pjcolp@cs.ubc.ca>
xen-unstable changeset: 21694:2a3a5979e3f1
xen-unstable date: Tue Jun 29 18:17:44 2010 +0100
Keir Fraser [Wed, 30 Jun 2010 17:20:11 +0000 (18:20 +0100)]
xentrace: restrict trace buffer MFNs
Since they're being passed to Dom0 using an array of uint32_t, they
must be representable as 32-bit quantities, and hence the buffer
allocation must specify an upper address boundary.
Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset: 21682:7e46fdbe8a11
xen-unstable date: Mon Jun 28 16:27:56 2010 +0100
Keir Fraser [Wed, 30 Jun 2010 17:19:35 +0000 (18:19 +0100)]
tmem: skip special case in alloc_heap_pages() if tmem holds no pages Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 21658:c362e793f0a0
xen-unstable date: Wed Jun 23 23:23:22 2010 +0100
Keir Fraser [Tue, 22 Jun 2010 06:25:14 +0000 (07:25 +0100)]
Remus: python netlink fixes
Fix deprecation warning in Qdisc class under python 2.6.
Fix rtattr length and padding (rta_len is unaligned).
Null-terminate qdisc name in rtnl messages.
Keir Fraser [Mon, 21 Jun 2010 18:20:15 +0000 (19:20 +0100)]
Enable tmem functionality for PV on HVM guests. Guest kernel
must still be tmem-enabled to use this functionality (e.g.
won't work for Windows), but upstream Linux tmem (aka
cleancache and frontswap) patches apply cleanly on top
of PV on HVM patches.
Also, fix up some ASSERTS and code used only when bad guest
mfns are passed to tmem. Previous code could crash Xen
if a buggy/malicious guest passes bad gmfns.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 21648:72c6228b5f0f
xen-unstable date: Mon Jun 21 19:19:25 2010 +0100
Keir Fraser [Mon, 21 Jun 2010 09:03:11 +0000 (10:03 +0100)]
vmx: Fix bug in VMX VPMU fixed function PMC offset
This is a minor fix to the calculation of bit-width of fixed function
perfmon counters in Intel processors. Bits 5-12 of edx register
should be calculated as (edx & 0x1fe0) >>5 instead of using 0x1f70.
Keir Fraser [Fri, 18 Jun 2010 13:24:05 +0000 (14:24 +0100)]
x86: return value of domain_pirq_to_irq() is signed
That value can, for forcibly unbound PIRQs, validly be negative, and
for the respective check to catch those cases (and prevent using these
negative values as array index), the respective variables must be of
signed type.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset: 21620:b0f7f710f512
xen-unstable date: Tue Jun 15 13:21:03 2010 +0100
Keir Fraser [Fri, 11 Jun 2010 13:01:02 +0000 (14:01 +0100)]
tmem: Fix domain lifecycle synchronisation.
Obtaining a domain reference count is neither necessary nor
sufficient. Instead we simply check whether a domain is already dying
when it first becomes a client of tmem. If it is not then we will
correctly clean up later via tmem_destroy() called from domain_kill().
Keir Fraser [Fri, 11 Jun 2010 13:00:36 +0000 (14:00 +0100)]
Tmem: fix domain refcount leak by returning to simpler model
which claims a ref once when the tmem client is first associated
with the domain, and puts it once when the tmem client is
destroyed.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
xen-unstable changeset: 21595:39657b168068
xen-unstable date: Thu Jun 10 22:12:36 2010 +0100
This disables superpage restore support, but should gain us acceptable
performance when restoring a domain using a pv_ops dom0 kernel. This
is because single-page allocations will be batched rather than issued
singly.
Keir Fraser [Thu, 10 Jun 2010 08:50:02 +0000 (09:50 +0100)]
xend: A few blktap2 fixes
1. Bug fix for error: "Error: Device /dev/xvdp (51952, tap2) is
already connected." (xenstore does not clean after DomU stoped)
2. Bug fix for error: "File 'vhd:/path/.../disk.img' doesn't exist."
(not correct parsing)
3. Bug fix for error: "Error: Device 51952 not connected" (in config
file for DomU we should be use prefix "tap2:tapdisk:xxx" for devices
from (aio, ram, qcow, vhd, remus) or "tap:tapdisk:xxx" for devices
from (sync, vmdk, qcow2, ioemu))
4. Bug fix for error: "Disk is not accessible" (if use 'tap2'-device
type, then '/dev/xpvd' may not be accessible immediately after its
creation)
Keir Fraser [Fri, 4 Jun 2010 09:50:28 +0000 (10:50 +0100)]
Add a safety valve to the HVM RTC model for big time jumps
If xen's time leaps forward by a large amount, the RTC will try to
model a tick for every second that it thinks has passed. This can
livelock a CPU with a series of timer requests each of which fires
immediately and requests the next one.
This patch treats a delay of more than a day between ticks as a
special case, abandoning the attempt to catch up. That should be good
enough to avoid livelock but doesn't fix the underlying time problem.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 21515:1b6c9732436b
xen-unstable date: Fri Jun 04 10:05:42 2010 +0100
tools: assume that special Xen devices have been created by the platform
Remove all the magic surrounding the special Xen devices in Linux
specific code whereby we attempt to figure out what the correct
major:minor number is and check the the existing device has these
numbers etc. In 2010 we really should be able to trust that the
platform has created the devices correctly or provide correct
configuration settings such that they are without resorting to tearing
down the platform configured state and rebuilding it.
tools/hotplug/Linux/xen-backend.rules already contains the necessary
udev rules to create /dev/xen/evtchn and friends in the correct place.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
xen-unstable changeset: 21507:a3bdee5a20da
xen-unstable date: Wed Jun 02 10:54:32 2010 +0100
Keir Fraser [Fri, 4 Jun 2010 09:39:24 +0000 (10:39 +0100)]
xen: update_runstate_area for 32 bit PV on HVM guests
The current implementation of update_runstate_area is unable to handle
32 bit PV on HVM guests because the check is_pv_32on64_domain doesn't
cover that case. This patch fixes it.
Keir Fraser [Fri, 4 Jun 2010 09:36:53 +0000 (10:36 +0100)]
xenconsoled: Discard guest console data in bigger chunks
Discard guest console data in bigger chunks so that there are fewer
discontinuities in the console data. Also avoid discarding data if
space is available at the front of the buffer by reclaiming that
space.
Patch from: Christian Limpach <Christian.Limpach@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 21464:83a3f9556a05
xen-unstable date: Thu May 27 08:21:24 2010 +0100
Keir Fraser [Fri, 4 Jun 2010 09:36:29 +0000 (10:36 +0100)]
xenstore: Make sure that libxs reports an error if xenstored drops
the connection, rather than getting stuck forever.
Patch from: Steven Smith <steven.smith@eu.citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset: 21463:5be2d2a7f445
xen-unstable date: Thu May 27 08:20:26 2010 +0100