Ian Jackson [Tue, 6 Jul 2010 15:55:49 +0000 (16:55 +0100)]
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.
Ian Jackson [Tue, 6 Jul 2010 12:10:14 +0000 (13:10 +0100)]
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.
Ian Jackson [Tue, 6 Jul 2010 10:57:20 +0000 (11:57 +0100)]
tools/xenstore: add XS_RESTRICT operation to C xenstore client libs.
The OCaml xenstored supports the XS_RESTRICT operation, which
deprivileges a dom0 xenstore connection so it can only affect one
domain's entries. Add the relevant definitions to the C libraries
so that callers can use it.
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.
Signed-off-by: Weidong Han <weidong.han@intel.com>
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.
Signed-off-by: Weidong Han <weidong.han@intel.com>
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.
Signed-off-by: Weidong Han <weidong.han@intel.com>
VMX: fix ept pages free up when ept superpage split fails:
1) implement ept super page split in a recursive way to
form an ept sub tree before real installation;
2) free an ept sub tree also in a recursive way.
3) change ept_next_level last input parameter from shift
bits # to next walk level;
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.
Signed-off-by: Wei Huang <wei.huang2@amd.com> Signed-off-by: Hans Rosenfeld <hands.rosenfeld@amd.com> Acked-by: Jan Beulich <jbeulich@novell.com>
blktap2: make protocol specific usage of shared sring explicit
I don't think protocol specific data really belongs in this header
but since it is already there and we seem to be stuck with it let's at
least make the users explicit lest people get caught out by future new
fields moving the pad field around.
This is the Xen portion of this change. The kernel portion will be
sent separately. There is no dependency between the two.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: Daniel Stodden <daniel.stodden@citrix.com> Cc: Dongxiao Xu <dongxiao.xu@intel.com>
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>
Keir Fraser [Tue, 29 Jun 2010 17:17:44 +0000 (18:17 +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>
Ian Jackson [Tue, 29 Jun 2010 15:23:13 +0000 (16:23 +0100)]
tools/pygrub: Fix default when out of range
This is the patch to fix pyGrub default value when it's being set out of
range. This patch makes the quiet and interactive mode select the same
default image when the default value for boot entry is out of range,
i.e. when the guest is having wrong configuration in it's boot loader
(like 3 entries with default mistakenly set to 10 etc).
When the boot entry number is being set out of range it falls back to 0
(first entry of boot loader).
Signed-off-by: Michal Novotny <minovotn@redhat.com>
Ian Jackson [Tue, 29 Jun 2010 14:07:17 +0000 (15:07 +0100)]
tools: init.d/xencommons: Wait for xenstored to start before setting dom0 name
On one of my boxes, the xenstore-write setting dom0's name starts
before xenstored is actually ready to handle the connection properly,
resulting in the name set failing. Wait for xenstored to be up and
responding to reads before continuing, timing out after 30 seconds.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Ian Jackson [Tue, 29 Jun 2010 13:52:51 +0000 (14:52 +0100)]
tools/xend, xm: add a command to get the state of VMs
add a command "domstate" to get the state of Vms, which may have one state of
{'shutoff', 'idle','shutdown','running','crashed','paused' or 'paused by
admin"}.
For case of pause, I distinguish it into two conditions. One is "paused" the
other is "paused by admin".
"pasued by admin" means that users pause a domain voluntary by "xm paused
VM" or " API"
Ian Jackson [Mon, 28 Jun 2010 16:13:43 +0000 (17:13 +0100)]
libxl: Specify no nics to qemu when no emulated nics
qemu will default to one emulated NIC if no network configuration is
specified on the command-line. If there are no emualted NICs (i.e.,
no NICs or all NICs are PV), specify no nics to avoid getting an
emulated NIC by default.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Keir Fraser [Mon, 28 Jun 2010 15:27:56 +0000 (16:27 +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>
Keir Fraser [Fri, 25 Jun 2010 14:44:58 +0000 (15:44 +0100)]
x86 paging_domctl: reinstates the breaks in the flow control (and
folds two identical cases together) and fixes the memory leak that was
causing a crash.
Ian Jackson [Fri, 25 Jun 2010 14:43:50 +0000 (15:43 +0100)]
libxc: Fix ia64 build for interface change
This patch fixes ia64 by the following method:
- rename xc_handle xch
- rename guest_xc xch
- add xc_interface *xch to arguments of some functions
- replace xc_dom_printf with macros
- Add *xch argument to corresponding x86 functions [iwj]
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 24 Jun 2010 11:45:32 +0000 (12:45 +0100)]
ocaml: remove bogus /dev/xen/ev[en]tchn
Oxenstored should not try to create the evtchn device, as it:
* creates the wrong name (/dev/xen/eventchn rather than evtchn)
* uses a hard-coded minor number, even though this dynamically
depends on what other misc devices are in the kernel
Remove all this code and just rely on the system to create the device.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Ian Jackson [Wed, 23 Jun 2010 16:05:31 +0000 (17:05 +0100)]
libxl: support reset file on sysfs
Recent kernels have a reset file on sysfs per PCI device, to allow PCI
device reset from userspace.
This patch adds support to libxl for resetting PCI devices using the
reset file on sysfs, in case the do_flr file is not preset.
Ian Jackson [Wed, 23 Jun 2010 16:04:26 +0000 (17:04 +0100)]
libxl: make libxl_wait_for_device_model clearer
at the moment libxl_wait_for_device_model waits on a xenstore watch
before checking the current value of the xenstore node, that might
contain already the value the function was looking for.
This patch changes libxl_wait_for_device_model so that it checks the
value of the xenstore node first, then waits for the watch.
xenstore watch automatically fire one time when you install them for
this exact same purpose, so the previous code is not wrong, but this
version is clearer.
Ian Jackson [Tue, 22 Jun 2010 15:37:53 +0000 (16:37 +0100)]
python/xc: [PATCH 3/3] add flask capabilities in python xc bindings
The flask library is small, and putting everything in libxenctrl make
relying on flask functionalities in libxl easier.
libflask is left for compatibility purpose, but should be considered
deprecated, and remove in the near future. all flask_ symbols are now
xc_flask_ symbols in libxenctrl.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Ian Jackson [Tue, 22 Jun 2010 15:36:04 +0000 (16:36 +0100)]
libxc: [PATCH 1/3] merge libflask into libxenctrl
The flask library is small, and putting everything in libxenctrl make
relying on flask functionalities in libxl easier.
libflask is left for compatibility purpose, but should be considered
deprecated, and remove in the near future. all flask_ symbols are now
xc_flask_ symbols in libxenctrl.
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
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>
Ian Jackson [Tue, 22 Jun 2010 15:07:00 +0000 (16:07 +0100)]
Check "mac" address sooner in device_create function, before doing device_add.
In XendDomainInfo.py device_create function, when device type is
"vif", it has a paragraph to check the validity of "mac"
address. Before checking validity, device_add has been done. But after
checking validity, if the mac address is invlid, it raises VmError and
exits directly without doing clean work like removing the device item
from config info. This will cause that the incorrect mac address is
saved into VM Config file and VM fails to restart. If check "mac"
validity before doing device_add, there will be no problem.
this patch implements few missing options in xl so that it can be
used as a replacement of xm in xendomains:
- dryrun and quiet, long options to xl create;
- l, option to xl list.
printf_info is now used to print the configuration of the running VMs so
the output has been reformatted to be similar to the output of xm list -l.
There is still one command used in xendomains that is not implemented in
xl and not covered by this patch: xm shutdown. However a patch has been
sent to the list in the past and we are expecting a new version of it
soon.
Keir Fraser [Mon, 21 Jun 2010 18:19:25 +0000 (19:19 +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>
Keir Fraser [Mon, 21 Jun 2010 18:18:27 +0000 (19:18 +0100)]
x86 hvm: implement HVMOP_pagetable_dying
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.
Keir Fraser [Mon, 21 Jun 2010 08:59:10 +0000 (09:59 +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 [Mon, 21 Jun 2010 08:58:17 +0000 (09:58 +0100)]
xend: fix "xm list hangs"
If a command hold domains_lock, "xm list" would hang for waiting for
the lock. Such as creating many VMs at a script (such as 20), command
of "xm list" could hang for long time(10 mins). I think domains_lock
here only protect update(). So, we shouldn't do update before command
of "list" really get this lock, but xm do need show the domain's
information quickly. In this patch, if command couldn't get the
domains_lock after 20 times trying, "xm list" would show the
information of VMs without update().
Signed-off-by: James Song (Wei) <jsong@novell.com>