Commit Graph
22904 Commits
Author SHA1 Message Date
Keir Fraser effe2763b8 Added signature for changeset 8df0c7f9cda6 2011-02-10 17:24:11 +00:00
Keir Fraser 9115622791 Added tag 4.1.0-rc4 for changeset 8df0c7f9cda6 2011-02-10 17:24:02 +00:00
Keir Fraser 4e0f60c5ad Update Xen version to 4.1.0-rc4 4.1.0-rc4 2011-02-10 17:23:57 +00:00
Keir Fraser 1accdcc8c3 x86: suppress HPET broadcast initialization in the presence of ARAT
This follows Linux commit 39fe05e58c5e448601ce46e6b03900d5bf31c4b0,
noticing that all this setup is pointless when ARAT support is there,
and knowing that on SLED11's native kernel it has actually caused S3
resume issues.

A question would be whether HPET legacy interrupts should be forced
off in this case (rather than leaving whatever came from firmware).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-02-10 14:19:54 +00:00
Keir Fraser 68ef426319 x86: tighten conditions under which writing certain MSRs is permitted
MSRs that control physical CPU aspects generally are pointless (and
possibly dangerous) to be written when the writer isn't sufficiently
aware that it's running virtualized.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2011-02-10 14:19:23 +00:00
Keir Fraser 8ad67c8e05 ix86: re-do permanent disabling of x2apic
Move logic into check_x2apic_preenabled() (to make sure
generic_apic_probe() doesn't see genapic already set).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-10 14:14:24 +00:00
Tim Deegan 1146a5b639 x86/mm: make log-dirty code do all its allocations outside the lock
to avoid taking the shadow/EPT lock with the lgd lock held.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-10 11:27:52 +00:00
Tim Deegan 17f709bb8d x86/mm: shuffle log-dirty code so only one path allocates memory
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-10 11:27:51 +00:00
Juergen Gross 32e7954462 Cpupools: vcpu affinity handling
If a vcpu is pinned to multiple physical cpus, the pinning is not
removed if all those physical cpus are removed from the cpupool. When
disabling the scheduler on a cpu, the affinity mask must be checked
against the cpumask of the cpupool.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-10 09:02:50 +00:00
Tim Deegan ebe3e6440c x86/mm/shadow: fix unlocking on error path in p2m allocator
One unlock path wasn't gated to match the lock.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-09 12:03:09 +00:00
Wei Gang aa479ce9d1 x86: reduce magic number usage in XSAVE code
Signed-off-by: Wei Gang <gang.wei@intel.com>
2011-02-09 08:58:11 +00:00
Wei Wang 76bb33a03e amd iommu: dynamic page table depth adjustment.
IO Page table growth is triggered by amd_iommu_map_page and grows to
upper level. I have tested it well for different devices (nic and gfx)
and different guests (linux and Win7) with different guest memory
sizes (512M, 1G, 4G and above).

Signed-off-by: Wei Wang <wei.wang2@amd.com>
2011-02-09 08:57:12 +00:00
Ian Jackson 45c717772e docs: document vbd numbering and naming
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-09 08:54:37 +00:00
Keir Fraser 7fc001c2c2 cpupool: Fix __cpupool_find_by_id(), clean up accessor functions.
Firstly, __cpupool_find_by_id() would dereference NULL, at the end of
an exact search if the search loop exited with *q==NULL. Fix this.

Secondly, provide suitable accessor functions so that no caller needs
to use the __-prefixed versions which take a boolean flag.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-09 08:53:43 +00:00
Keir Fraser 657c5ca696 cpupool: Strict parameter checking for cpupool operations
Some cpupool actions didn't check the cpupool_id exactly. For some
actions this doesn't make any sense, so refuse those actions if the
specified cpupool doesn't exist.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-09 08:44:38 +00:00
Keir Fraser f4b185362d [VTD][QUIRK] add spin lock across snb pre/postamble functions
Added a spinlock across snb_vtd_ops_preamble() and
snb_vtd_ops_postamble() to make modifications to IGD registers atomic.
Continue keeping snb_igd_quirk default off.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2011-02-09 08:40:05 +00:00
James Harper 31960417a9 xend: canonicalise symlinks found in /dev for vbds (helps vscsi)
By default, vscsi expects to be passed the final device name (eg
/dev/st3) instead of one of the various udev symlinks (eg
/dev/tape/by-path/pci-0000:01:08.0-scsi-0:0:2:0-st). The following patch
resolves the path to the real path if the name starts with /dev/

Signed-off-by: James Harper <james.harper@bendigoit.com.au>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-08 16:35:35 +00:00
Kamala Narasimhan 090b27a6fa libxl: initialise some variables in print_bitmap, to suppress bogus warning
GCC 4.2.4 cannot figure out that three variables aren't used before
initialisation:
 xl_cmdimpl.c: In function `print_domain_vcpuinfo':
 xl_cmdimpl.c:3351: warning: `firstset' may be used uninitialized in this function
[etc]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Andre Przywara <andre.przywara@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-07 17:02:46 +00:00
Olaf Hering 0f850909c8 tools/hotplug: set mtu from bridge also on vif interface
Apply mtu size from bridge interface also in vif interface.
This depends on a kernel change which allows arbitrary mtu sizes until
the frontend driver has connected to the backend driver. Without this
kernel change, the vif mtu size will be limited to 1500 even with this
change to the vif-bridge script.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-07 16:55:25 +00:00
Keir Fraser f681990e7f cpupool: Correct cpupool diag printing
Some of the cpupool_dprintk() calls are using undefined or
uninitialized variables. Correct the argument lists to be able to
define cpupool_printk as printk.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-07 15:04:32 +00:00
Ian Campbell 26f91ef506 minios: do not export {test,set,clear}_bit etc to applications
Fixes ioemu stubdom build:
CC    i386-stubdom/piix4acpi.o
[...]/stubdom/ioemu/hw/piix4acpi.c:272: error: expected ')' before '?' token
[...]/stubdom/ioemu/hw/piix4acpi.c:277: error: conflicting types for 'set_bit'
[...]/stubdom/../extras/mini-os/include/x86/mini-os/os.h:396: error: previous definition of 'set_bit' was here
[...]/stubdom/ioemu/hw/piix4acpi.c:282: error: conflicting types for 'clear_bit'
[...]/stubdom/../extras/mini-os/include/x86/mini-os/os.h:414: error: previous definition of 'clear_bit' was here
[...]/stubdom/ioemu/hw/piix4acpi.c: In function 'gpe_sts_write':

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-07 12:13:24 +00:00
Keir Fraser 00cee37d37 Pack some hvmop memory structures better
Some of the hvmop memory structures have a shocking amount of
unnecesssary padding in them.  Elements which can have only 3 values
are given 64 bits of memory, and then aligned (so that there is
padding behind them).

This patch resizes and reorganizes in the following way, (hopefully)
without introducing any differences between the layout for 32- and
64-bit.

xen_hvm_set_mem_type:
 hvmmem_type -> 16 bits
 nr -> 32 bits (limiting us to setting 16TB at a time)

xen_hvm_set_mem_access:
 hvmmem_access -> 16 bits
 nr -> 32 bits

xen_hvm_get_mem_access:
 hvmmem_access -> 16 bits

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-02-07 09:58:11 +00:00
Keir Fraser 462236bac9 hvm_op: Clean up hvm_op() target domain lockign using rcu_lock_remote_target_domain_by_id().
Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-07 09:52:11 +00:00
Keir Fraser 78f17e33f3 Introduce rcu_lock_remote_target_domain_by_id().
Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-07 09:51:33 +00:00
Tim Deegan cb6e62fc99 x86/hvm: don't let domains call HVMOP_set_mem_type on themselves.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2011-02-07 09:39:59 +00:00
Keir Fraser b6f72ecd9e hvm: fix XSAVE leaf 0 EBX size calculation
Fixes a size calculation bug when enabled bits in XFEATURE_MASK (xcr0)
aren't contiguous.

Current for_loop will stop when xcr0 feature bit is 0. But in reality,
the bits can be non-contiguous. One example is that LWP is bit 62 on
AMD platform. This patch iterates through all bits to calculate the
size for enabled features.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
2011-02-06 17:26:31 +00:00
Keir Fraser 20a91fe64a trace: Change trace_var argument to void*, to match __trace_var
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2011-02-06 17:22:44 +00:00
Keir Fraser e6d97230f5 hvm_op: Clean up new mem_access and inject_trap ops.
Firstly, they are only for use from privileged entities, so mark them
as usable only by code defining __XEN_TOOLS__.

Secondly, the check for must-not-operate-on-myself can be done more
cleanly.

Signed-off-by: Keir Fraser <keir@xen.org>
2011-02-06 17:21:17 +00:00
Keir Fraser 95eddf1e87 xsm/flask: Fix permission tables
At some point, it seems that someone manually added Flask permission
definitions to one header file without updating the corresponding
policy configuration or the other related table.  The end result is
that we can get uninterpretable AVC messages like this:
# xl dmesg | grep avc
(XEN) avc:  denied  { 0x4000000 } for domid=0
scontext=system_u:system_r:dom0_t tcontext=system_u:system_r:domU_t
tclass=domain

Fix this by updating the flask config and regenerating the headers
from it.  In the future, this can be further improved by integrating
the automatic generation of the headers into the build process as is
presently done in SELinux.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2011-02-06 17:10:31 +00:00
Keir Fraser 75f04e45d0 xsm: Fix compilation error (unused variable)
Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>
2011-02-06 17:09:32 +00:00
Keir Fraser 6dbb66c9e5 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>
2011-02-06 17:03:09 +00:00
Keir Fraser 77c01bba24 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>
2011-02-06 16:54:01 +00:00
Keir Fraser b9a9873c2e cpupool: Check for memory allocation failure on switching schedulers
When switching schedulers on a physical cpu due to a cpupool operation
check for a potential memory allocation failure and stop the operation
gracefully.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2011-02-06 16:07:27 +00:00
Ian Jackson a69a0358f6 libxl: vncviewer: make autopass work properly
The file we write the vnc password to must be rewound back to the
beginning, or the vnc viewer will simply get EOF.

When the syscalls for communicating the password to the vnc client
fail, bomb out with an error messsage rather than blundering on (and
probably producing a spurious password prompt).

Following this patch, xl vncviewer --autopass works, provided the qemu
patch for writing the password to xenstore has also been applied.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:47:39 +00:00
Ian Jackson 2cc64e2e7c libxl: vncviewer: unconditionally read listen port address and password
The /local/domain/DOMID/device/vfb/0/backend path is irrelevant.
libxl does not create it, so the branch would never be taken.

Instead, simply read the target paths of interest.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:47:20 +00:00
Ian Jackson e887904db6 libxl: vncviewer: fix use-after-free
This bug can prevent xl vncviewer from working at all.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:46:22 +00:00
Ian Jackson a7dce8960c libxl: actually print an error when execve (in libxl__exec) fails
The header comment says libxl__exec logs errors.  So it should do so.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:46:00 +00:00
Ian Jackson eab5a930c5 libxl: SECURITY: always honour request for vnc password
qemu only sets a password on its vnc display if the value for the -vnc
option has the ",password" modifier.  The code for constructing
qemu-dm options was broken and only added this modifier for one of the
cases.

Unfortunately there does not appear to be any code for passing the vnc
password to upstream qemu (ie, in the case where
libxl_build_device_model_args_new is called).  To avoid accidentally
running the domain without a password, check for this situation and
fail an assertion.  This will have to be revisited after 4.1.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:45:26 +00:00
Ian Jackson c6adcbdc01 QEMU_TAG update 2011-02-04 18:43:53 +00:00
Stefano Stabellini ec5fb67597 libxl: fix console autoconnect with pygrub, by invoking xenconsole twice
When using pygrub we have to connect to the console twice: once at the
beginning to connect to pygrub and a second time after creating the pv
console to connect to the guest's console.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 18:29:55 +00:00
Stefano Stabellini 1a5becfd17 Update list of VT-D maintainers. 2011-02-04 17:41:37 +00:00
Andre Przywara 89cff80968 xl: fix broken xl vcpu-list output (tool hangs on large machines)
The algorithm for printing the CPU affinity in a condensed way
looks for a set bit in a zero-byte:
             for (i = 0; !(pcpumap & 1); ++i, pcpumap >>= 1)
Looking at the code I found that it is entirely broken if more than 8
CPUs are used. Beside that endless loop issue the output is totally
bogus except for the "any CPU" case, which is handled explicitly earlier.
I tried to fix it, but the whole approach does not work if the outer
loops actually iterates (executing more than once).
This fix reimplements the whole algorithm in a clean (though not much
optimized way). It survived some unit-testing.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-04 17:32:39 +00:00
Allen Kay 7990584bb0 libxl: pass gfx_passthru parameter to QEMU
Pass gfx_passthru parameter to QEMU.  Keep it boolean for now as QEMU
does not expect any other integer value.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-02 17:06:36 +00:00
Ian Jackson daf42cb995 libxl: change default HVM emulated network card to rtl8139
xend uses rtl8139, and we want xl to be compatible with xm.  Some
older operating systems don't have e1000 drivers, and we want widest
compatibility rather than best performance (people who want good
performance are best advised to use PV-on-HVM drivers).

We'll probably switch to a new default when switching to upstream
qemu, in the Xen 4.2 release cycle.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-02 17:05:27 +00:00
Ian Jackson 6569b94cca xen/Makefile: Belatedly update XEN_EXTRAVERSION for rc3 release
In rc3, XEN_EXTRAVERSION should mention rc4-pre.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-02 17:04:46 +00:00
Ian Campbell 04d1f61a1f libxc: maintain a small, per-handle, cache of hypercall buffer memory
Constantly m(un)locking memory can have significant overhead on
systems with large numbers of CPUs. This was previously fixed by
20841:fbe8f32fa257 but this was dropped during the transition to
hypercall buffers.

Introduce a small cache of single page hypercall buffer allocations
which can be resused to avoid this overhead.

Add some statistics tracking to the hypercall buffer allocations.

The cache size of 4 was chosen based on these statistics since they
indicated that 2 pages was sufficient to satisfy all concurrent single
page hypercall buffer allocations seen during "xl create", "xl
shutdown" and "xl destroy" of both a PV and HVM guest therefore 4
pages should cover the majority of important cases.

This fixes http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1719.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Zheng, Shaohui <shaohui.zheng@intel.com>
Tested-by: Haitao Shan <maillists.shan@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-01 19:26:36 +00:00
Stefano Stabellini 3ddd6a650b The current libxl_set_memory_target function subtracts a negative amount
from an uint32_t variable without checking if the operation wraps
around.

This patch fixes this bug (that I previously believed to be an
hypervisor issue):
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1729

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-01 19:25:08 +00:00
Ian Campbell 047b1675f8 tools: disable linker --as-needed option.
The Xen build system is not currently compatible with the --as-needed
linker option. The proper fix for this is turning out to be rather
invasive to the build system so simply disable for now with the
intention of revisiting for the 4.2 release.

The --no-as-needed option is available at least since binutils 2.15
(released in May 2004) and hence I think can be unconditionally relied
on.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Nathan March <nathan@gt.net>
Tested-by: Nathan March <nathan@gt.net>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-01 19:23:31 +00:00
Michael Young d3e77ae6b6 tools/Makefiles: install libvhd and libblktap with INSTALL_PROG
Shared libraries should be executable.

(rpm (4.9.0) doesn't automatically supply a "provides" entry for a
library unless it is executable.  Non-executable libraries can cause
other trouble too.)

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-01 19:19:58 +00:00
Michael Young 388b2546dd docs: Bring comments about NetworkManager and bridging up to date
Update a comment about NetworkManager not supporting bridging in
Fedora 11 to refer instead to Fedora 14.  Clarify the wording.

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-02-01 19:18:42 +00:00