Commit Graph
19307 Commits
Author SHA1 Message Date
Keir Fraser f6be8835a3 passthrough: fix some spinlock issues in vmsi
Apart from efficiency, I hasten to fix the assertion failure.

- acquire pcidevs_lock before calling pt_irq_xxx_bind_vtd
- allocate msixtbl_entry beforehand
- check return value from domain_spin_lock_irq_desc()
- typo: spin_unlock(&irq_desc->lock) ->
- spin_unlock_irq(&irq_desc->lock)
- acquire msixtbl_list_lock with irq_disabled

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-03-11 10:09:21 +00:00
Keir Fraser 5a039efe11 xenconsole: Compile fixes for console code on Solaris
Signed-off-by: John Levon <john.levon@sun.com>
2009-03-11 10:08:31 +00:00
Keir Fraser 408cf363fa xentrace: TRC_SCHED_DOM_REM is defined, but never used. Use it.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-03-11 10:07:06 +00:00
Keir Fraser 8c28e3d47d passthrough: allow pass-through devices to share virtual GSI
Allow multiple pass-through devices to use the same guest_gsi.

The motivation for this is:

* Allow multi-function devices to be passed through as multi-function
  devices
* Allow more than two pass-through devices.
  - This will place more contention on the GSI-space, and allocation
    becomes a lot simpler if GSI sharing is allowed.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-11 10:05:00 +00:00
Keir Fraser e8ebaf831c passthrough: pt_irq_time_out() should act on all machine_irq
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-03-11 10:03:54 +00:00
Keir Fraser 9c3f0a9659 xentrace: trace when we continue with the same task
Trace when the scheduler decides to continue running the same process.
This lets us see that this is happening for one; it also lets us see
domains in a trace which are actively running on pcpu but never
scheduled out.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-03-09 15:01:34 +00:00
Keir Fraser a61271f61a Fix the perfc=y build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 13:52:59 +00:00
Keir Fraser 4720717da5 hvm/vpt: Check that an irq is not blocked before waking the vcpu
Currently, when a timer fires for a vpt interrupt, the interrupt
handler calls vcpu_kick() without checking to see if the IRQ is
blocked.  This causes the vcpu to wake up out of a halt when it
shouldn't.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-03-09 13:50:45 +00:00
Keir Fraser 6874f24099 [DOC] Add boot option vcpu_migration_delay in user.tex
Signed-off-by: Atsushi SAKAI <sakaia@jp.fujitsu.com>
2009-03-09 13:35:47 +00:00
Keir Fraser e164be5e29 scheduler: Use perf_counter subsystem for stats
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 10:32:24 +00:00
Keir Fraser 100f5738dc Avoid deadlock in tasklet_schedule() after console_force_unlock().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 09:56:16 +00:00
Keir Fraser 8591975c24 pvscsi: Some fixes for xm scsi-attach
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-03-09 09:49:50 +00:00
Keir Fraser 19801a52bf blktap: Fix compile warnings in block-qcow2.c
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
2009-03-09 09:48:45 +00:00
Keir Fraser 2441e7179c Add vcpu_migration_delay=<microsecs> boot option to scheduler
The idea is borrowed from Linux kernel: if the vCPU is just
scheduled out and put to run-queue, it's likely cache-hot on its
current pCPU, and it may be scheduled in in a short period of time;
however, if vCPU is migrated to another pCPU, it need to re-warm the
cache.

The patch introduces an option vcpu_migration_delay to avoid
aggressive vCPU migration (actually we really see migration frequency
is very high most of the time.), while in the meantime keeping load
balancing over slightly longer time scales.

Linux kernel uses 0.5ms by default. Considering the cost may be
higher (e.g. VMCS impact) than in native, vcpu_migration_delay=1000 is
chosen for our tests, which are performed on a 4x 6-core Dunnington
platform. In 24-VM case, there is ~2% stable performance gain for
enterprise workloads like SPECjbb and sysbench. If HVM is with
stubdom, the gain is more: 4% for the same workloads.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 09:37:52 +00:00
Keir Fraser 881f28d8e8 [IA64] fix compilation error caused by 19286:dd489125a2e7
This patch fixes compilation error caused by 19286:dd489125a2e7

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-03-09 09:19:42 +00:00
Keir Fraser 178897b9f2 pygrub: Enable domU boot without xen specific arg
This patch makes domUs bring up without xen specific args to guest
kernels. A domU should be bootable without args parameter because
tools/examples/xmexample1 doesn't have one.

Signed-off-by: INAKOSHI Hiroya <inakoshi.hiroya@jp.fujitsu.com>
2009-03-09 09:19:10 +00:00
Keir Fraser 7402207f8c [IA64] fix issue of can not find the qemu-dm in ia64
IA64 uses the /usr/lib/ for xen. We do not=20
need to check the arch_libdir in ia64. It will
return the wrong value to arch_libdir. And guest
can not boot.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
2009-03-09 09:18:08 +00:00
Keir Fraser 4c0b25e05d hvmloader acpi: Describe PIRQ routing for all 32 PCI devices on bus 0.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 09:13:50 +00:00
Keir Fraser 5269962096 x86: Mask X86_FEATURE_XSAVE in cpuid leaf 1, ecx, as we don't allow
guests to use it (by setting cr4.OSXSAVE).

This prevents crashes in pvops kernels, as new versions of Linux
try to use this feature.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-09 08:54:19 +00:00
Keir Fraser 6db42837ce minios: Fix 18874 memory clipping
Fix 18874's memory clipping: there are three page-sized holes between
direct mapping, demand mapping, heap pages and the end of memory.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2009-03-09 08:43:11 +00:00
Keir Fraser e4865c2315 Page offline support in Xen side
This patch add support to offline a page. The basical idea is, when a
page is assigned, it will be marked offline pending and be moved out of
buddy when freed, when a page is free, it will be moved out of buddy directly.

One notice after this change is, now the page->count_info is not
always 0, especially for shadow page, since the PGC_offlining bit may be set.

Signed-off-by: Wang, Shane <shane.wang@intel.com>
Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-03-06 19:18:39 +00:00
Keir Fraser 3c6846fa34 x86/mm: Do not set page's count_info directly
Page offline patch add several flag to page_info->count_info. However,
currently some code will try to set count_info after alloc_domheap_pages
without using "&" or "|" operation, this may cause the new flags lost, since
there are no protection. This patch try to make sure all write to
count_info will only impact specific field.

Also currently shadow code assume count_info is 0 for shadow page,
however, this is invalid after the new flags. Change some assert in
shadow code.

Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
2009-03-06 19:14:50 +00:00
Keir Fraser 3ba7d233c7 xend: allow VM configuration with both sdl=1 and vnc=1
In the stubdom case you can now specify sdl=1 and vnc=1 (again, both
can be selected at the same time) in the vfb configuration.
So instead of:

vfb = [ 'type=vnc' ]

now you have:

vfb = [ 'vnc=1,sdl=1' ]

the former configuration option is deprecated but still supported for
backward compatibility.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-03-06 19:13:23 +00:00
Keir Fraser 31e93ebbdd tboot: Fix return code for S3 integrity
The original patch left in a debug return value from one of the memory
integrity checks.  This patch returns the correct error code in case of a
failure.  This was re-tested to ensure that it still passes for the
expected case.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-06 19:10:29 +00:00
Keir Fraser 8033414951 i386: Build fix.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 19:07:15 +00:00
Keir Fraser f2c104206e Clean xen/crypto on make clean.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 19:07:00 +00:00
Keir Fraser 1aa391a262 vt-d: Better restrict memory ranges considered to be in Xen
The current implementation of xen_in_range() misses several memory
ranges that are used by the hypervisor and thus shouldn't get mapped
into dom0's VT-d tables.  This patch should make the check complete.

This patch is only against x86 because I'm not familiar enough with
IA64 to know how much, if any, of these checks apply there.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-06 19:06:30 +00:00
Keir Fraser f3cc74d2f1 tool: make management of PCI D-states by guest optional
D3hot state in some PCI devices causes the failure of domain
creation/destruction.

The default is "pci_power_mgmt=3D0" which disables the guest OS from
managing D-states because it would be better to avoid the trouble than
advantage of low power consumption.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-03-06 18:58:41 +00:00
Keir Fraser 7468faf8d3 xm-test: Identifying the network env specified in xend config fails,
if an additional parameter is given for the network-bridge
(e.g. netdev=eth1) The patch splits the network command into the
command name and its parameters to determine the netenv (bridge,
route, nat)

Signed-off-by: juergen.gross@fujitsu-siemens.com
2009-03-06 18:56:28 +00:00
Keir Fraser adfb6cc3c0 Panic rather than BUG if an error is encountered decompressing a bzImage
This gives a more useful error message without an unnecessary stack dump.

Noticed by Jeremy Fitzhardinge.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-03-06 18:55:05 +00:00
Keir Fraser 2ff253bcb6 Fix cpu selection at the time vCPU allocation
After cpu_[online/offline], set bits in cpu_online_map could be not
continuous. Use cycle_cpu() to pick the next one.

Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-06 18:54:09 +00:00
Keir Fraser b3a3ac0f6b Do not deadlock in scheduler when sending VIRQ_CON_RING.
Instead defer the virq notification to tasklet context.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-06 14:28:27 +00:00
Keir Fraser 6976476d8c xend: Handle missing s3_integrity value, default to zero.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 17:50:05 +00:00
Keir Fraser eea1a2ea39 xend: blkif hda regexp fix
Signed-off-by: Michal Novotny <minovotn@redhat.com>
2009-03-05 15:10:17 +00:00
Keir Fraser b6f1cfa1c3 init script: Enable to run xend stop when dom0 shutdown
Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
2009-03-05 15:06:06 +00:00
Keir Fraser f78e2193b6 x86: Enable THERM_CONTROL_MSR write for dom0 even when cpufreq=xen
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 15:02:02 +00:00
Keir Fraser ca1c7b25a6 vtd: Fix iommu_inclusive_mapping to map all under 4GB.
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-05 14:55:24 +00:00
Keir Fraser 4e3057fddb [IA64] Remove compilation warning and typo caused by 19268:4b7d638a8b89
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-03-05 09:32:37 +00:00
Keir Fraser ce870565b6 Be careful with page_get_owner() now that owner field can be clobbered
by some users. Introduce get_page_owner_and_reference() where that can
be more useful.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-04 14:28:50 +00:00
Keir Fraser 86d2a1cec5 blktap: Allow creation of qcow2 files.
Signed-off-by: Yang Zhang <yang.zhang@intel.com>
2009-03-03 13:22:28 +00:00
Keir Fraser b47276c18f x86: Fix event-channel access for 32-bit HVM guests.
Based on a patch by Joe Jin <joe.jin@oracle.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-03 13:17:05 +00:00
Keir Fraser 6deab1ae31 txt: perform per-domain (and frametable and xenheap) MAC on entry into
S3 and verification on resume.

The MAC algorithm is called VMAC and was developed by Ted Krovetz and
Wei Dai (more details are in the files).  It is based on a universal hash
function.  The universal hash is passed through a pseudo-random function,
implemented using AES.  More details can be found at
http://fastcrypto.org/vmac/. =
 The AES code comes from the OpenBSD implementation (which is derived
 from the implementation referenced in VMAC site).

As Xen does not have a good source of entropy to generate its own key
(for the keyed hash), it uses the key that tboot passes in.

Although the code attempts to MAC all of a domain's pages (code/data,
VT-d tables) based on its s3_integrity flag, some of a domain's memory may
always be MAC'ed, e.g. shadow page tables.  Only xenheap pages that are in
use are MAC'ed.  We believe that the memory MAC'ed by the Xen code and the
ranges passed to tboot to MAC cover all of the memory whose integrity needs
to be protected on S3.  Any suggestions or ranges that we missed are
welcome.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-03 12:48:16 +00:00
Keir Fraser 8aaf870611 txt: Xen per-domain S3 integrity config
This patch adds a per-domain flag to specify whether a domain will be
S3 integrity protected when Xen is launched using tboot/TXT.

The tools now support an integer domain configuration parameter called
's3_integrity', which defaults to 1, to enable S3 integrity protection.

The struct arch_domain structure has been extended to have an
's3_integrity' field that represents this setting.

Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
2009-03-03 11:52:44 +00:00
Keir Fraser 43246f5e26 hvm: passthrough MSI-X: fix ia64 link and MSI-X clean up
This patch fixes the ia64 link error and some clean up of MSI-X code.
- add ia64 dummy function to link
- fix unmatched prototype
- add error check

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-03-03 11:46:52 +00:00
Keir Fraser 9b82af4b03 libxen: fix a problem preventing use of xen_event_register().
The conversion of input parameter xen_string_set to XML format creates
a XML "struct" tag instead of "array". The patch sets the XML tag for
SET now to "array".

Signed-off-by: Lutz Dube <Lutz.Dube@fujitsu-siemens.com>
2009-03-03 11:41:15 +00:00
Keir Fraser 7fabf1409c xend: Make /var/lib/xen if not already present.
Signed-off-by: Christoph Egger <christoph.egger@amd.com>
2009-03-03 11:37:31 +00:00
Keir Fraser b57f88e746 ia64: fix build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-02 16:24:50 +00:00
Keir Fraser bb8b9cf891 When a domain crashes, ignore shutdown deferrals.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-03-02 14:09:21 +00:00
Keir Fraser e1608e7efb x86: Minimize the TSC drift between pCPUs
Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
2009-03-02 13:56:47 +00:00
Keir Fraser 6efe0dfb1c vtd: boolean boot parameter to allow inclusive mapping of all memory below 4GB
Signed-off-by: Ross Philipson <ross.philipson@citrix.com>
2009-03-02 11:23:23 +00:00