Commit Graph
20842 Commits
Author SHA1 Message Date
Keir Fraser d6aaa9ee0f libxc: New hcall_buf_{prep,release} pre-mlock interface
Allow certain performance-critical hypercall wrappers to register data
buffers via a new interface which allows them to be 'bounced' into a
pre-mlock'ed page-sized per-thread data area. This saves the cost of
mlock/munlock on every such hypercall, which can be very expensive on
modern kernels.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-22 10:59:03 +00:00
Keir Fraser 379e63ed3d x86: kill msix_flush_writes()
The (only) two callers of it don't need it, as the MSI-X case of
msi_set_mask_bit() already does the necessary readl().

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-21 15:13:00 +00:00
Keir Fraser 231123f755 x86: dump full IRQ affinity
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-21 15:12:38 +00:00
Keir Fraser ceb3df776e x86: add keyhandler to dump MSI state
Equivalent to dumping IO-APIC state; the question is whether this
ought to live on its own key (as done here), or whether it should be
chanined to from the 'i' handler.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-21 15:12:17 +00:00
Keir Fraser ec78952374 xend: Dis-allow device assignment if PoD is enabled.
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-01-21 14:40:05 +00:00
Keir Fraser b304702a73 tools: fix sysfs error path
Attached patch fixes sysfs error path.
NetBSD also has a /proc/mounts file but no sysfs.
On Linux you can test this with sysfs not mounted.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2010-01-21 11:27:11 +00:00
Keir Fraser 92181f1829 VT-d: warn on bogus RMRR entry
Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-01-21 11:26:26 +00:00
Keir Fraser 41a41718c4 xentrace: XC_PAGE_SIZE should be used
20827:fad80160c001 cannot be compiled on ia64:
  xentrace.c:647: error: 'PAGE_SIZE' undeclared (first use in this

This patch fixes it.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
2010-01-21 09:13:46 +00:00
Keir Fraser 3a007e1577 VT-d: improve RMRR validity checking
Currently, Xen checks RMRR range and disables VT-d if RMRR range is
set incorrectly in BIOS rigorously. But, actually we can ignore the
RMRR if the device under its scope are not pci discoverable, because
the RMRR won't be used by non-existed or disabled devices.

This patch ignores the RMRR if the device under its scope are not pci
discoverable, and only checks the validity of RMRRs that are actually
used. In order to avoid duplicate pci device detection code, this
patch defines a function pci_device_detect for it.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-01-21 09:12:01 +00:00
Keir Fraser 1ac4cf5651 VT-d: handle return value of deassign_device
deassign_device may fail, so need to capture its failure for
appropriate handling. This patch captures return values of
deassign_device, and prints error messages if it fails.

In addition, this patch also fixes some code style issues.

Signed-off-by: Weidong Han <Weidong.han@intel.com>
2010-01-21 09:11:06 +00:00
Keir Fraser d7efbf3bac libxc: Unbreak HVM live migration after 0b138a019292.
0b138a019292 was a little too ambitious replacing xc_map_foreign_batch
with xc_map_foreign_pages in xc_domain_restore. With HVM, some of the
mappings are expected to fail (as "XTAB" pages).

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2010-01-21 09:03:20 +00:00
Keir Fraser 1e4743291b xend: Unbreak live migration with tapdisk2 after 20691:054042ba73b6
vm.image does not exist at this point in the restore process.
I haven't looked at the memory_sharing code. It's likely something
better is needed to make that work across relocation.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
2010-01-21 09:03:00 +00:00
Keir Fraser 55274e039f libxl, hvm: Add support to trigger power or sleep button events
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
2010-01-20 20:36:19 +00:00
Keir Fraser 9e2b86f486 hvm: Add ACPI fixed sleep button
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
2010-01-20 20:34:19 +00:00
Keir Fraser 650afa3995 xentrace: Per-cpu xentrace buffers
In the current xentrace configuration, xentrace buffers are all
allocated in a single contiguous chunk, and then divided among logical
cpus, one buffer per cpu.  The size of an allocatable chunk is fairly
limited, in my experience about 128 pages (512KiB).  As the number of
logical cores increase, this means a much smaller maximum per-cpu
trace buffer per cpu; on my dual-socket quad-core nehalem box with
hyperthreading (16 logical cpus), that comes to 8 pages per logical
cpu.

This patch addresses this issue by allocating per-cpu buffers
separately.

Signed-off-by: George Dunlap <dunlapg@umich.edu>
2010-01-20 20:33:35 +00:00
Keir Fraser 9e5e0eb840 xend: Fix 20825:49a2c1069e14
Converting an Python Int, sizeof(long) already returns byte length
rather than bit length so do not divide-by-8.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-20 09:51:38 +00:00
Keir Fraser 2e883df395 xend: Properly interpret vcpu_avail Long Integer in xc.hvm_build().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-20 09:33:59 +00:00
Keir Fraser f1315aa62e Enable IOMMU by default.
Can be disabled with 'iommu=0' boot parameter.

Note that iommu_inclusive_mapping is now also enabled by default, to
deal with systems with broken BIOS tables specifying bad RMRRs. Old
behaviour can be specified via 'iommu_inclusive_mapping=0'.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-19 15:44:54 +00:00
Keir Fraser 567340d815 x86: Clean up TSC_RELIABLE handling after 20705:a74aca4b9386
Set the feature by default and disable it if we can detect TSC warp,
rather than leaving the feature cleared and setting it if we happen
not to detect TSC warp.

This way round fixes dom0 kernel boot for Masaki Kanno.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-19 10:56:59 +00:00
Keir Fraser 7d4ad5a07e xc_domain_save: allocate pfn_err before use
Due to recent changes related to xc_map_foreign_bulk, xc_domain_save
segfaults because it tries to use pfn_err without allocating it first.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-19 09:40:30 +00:00
Keir Fraser 61802642f7 libxl: fix "xl list" output
This simple patch fixes the "xl list" output and cleans
libxl_list_domain after the recent API changes to list domains and
VMs.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-18 14:49:00 +00:00
Keir Fraser 6127bd73bd minios: implement xc_map_foreign_bulk
In order to do so it modifies map_frames_ex and do_map_frames to take
an int *err as parameter and return any error that way.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-18 14:48:18 +00:00
Keir Fraser 41449bf35b Revert 20746:042b371d8728 --- Breaks stubdoms.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-18 10:37:28 +00:00
Keir Fraser 458e5ec73c x86 hvm: Pre-allocate per-cpu HVM memory before bringing CPUs online
after boot. Avoids doing the allocations on the CPU itself, while in a
not-fully-online state and with irqs disabled. This way we avoid
assertions about irqs being disabled in e.g., tlb flush logic.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-18 10:35:36 +00:00
Keir Fraser 36197bd847 xend: Use max_node_id rather than nr_nodes where appropriate.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-17 18:20:04 +00:00
Keir Fraser bec38bcec6 Change default cpufreq governor to ondemand
Back in c/s 18950 the default cpufreq governor was set to userspace
(it had previously been performance).  However, since there is no
supplied userspace program or script that will change the frequency
this is at best a no-op.  Worse, on some hardware with some BIOS
revisions, this actually sets the CPUs running at their lowest
frequency rather than their highest and there is a corresponding (and
initially puzzling) drop in performance.

This patch changes the default governor to "ondemand" which should
make it the same as the Linux default and will provide power savings
for the majority without needing to write a userspace governor.  For
those that want to install their own governor, that is still possible.

Signed-off-by: John Haxby <john.haxby@oracle.com>
2010-01-17 18:07:10 +00:00
Keir Fraser 9ae9051662 libxenlight: add a list-vm options to xl that only list vms uuid, domid, name
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-17 18:05:32 +00:00
Keir Fraser 24cdde59ca libxenlight: separate logically list_vm and list_domain
previously list_domain was something between listing VM and domains.
provide 2 separates API calls to list domains and list vms.  the list
vms API filters utility domains like stubdomains, and domain 0

change is_stubdom to properly check the integer and also return a
boolean value.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-17 18:05:03 +00:00
Keir Fraser 590ab745d2 Update QEMU_TAG to a0066d08514ecfec34c717c7184250e95519f39c 2010-01-17 18:03:00 +00:00
Keir Fraser c9aa64e062 xend: NUMA: fix division by zero on unpopulated nodes
nodes without memory will currently be disabled by also moving the
physical cores connected to them to other nodes. This leads to nodes
without CPUs and thus to a division by zero in the node allocation
algorithm.  Attached patch fixes this by checking for 0 before the
division. This fixes domain creation on boxes with memory-less nodes.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2010-01-17 18:01:08 +00:00
Keir Fraser 185c296921 libxenlight: Add the line number to the config file parsing error message
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-17 17:57:44 +00:00
Keir Fraser b558580d6f libxl: add a newline to xl logging
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-01-17 17:57:11 +00:00
Keir Fraser 4a7e234457 x86: A further fix to xen_in_range().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-15 08:27:27 +00:00
Keir Fraser 46785b54f8 Make sure the minimum shadow allocation is never zero.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-01-14 14:11:25 +00:00
Keir Fraser 2d8eb0f62d libxc: Fix IOCTL_PRIVCMD_MMAPBATCH_V2 fallback check
privcmd_ioctl returns EINVAL if the type is not supported.
This fixes the guest booting issue caused by C/S 20791.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-14 14:10:40 +00:00
Keir Fraser 58a1c38594 x86: Fix and clarify 20803:50bd4235f486
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 11:46:53 +00:00
Keir Fraser fb95b70c12 xend: Fix wait-for-stubdom loop to avoid possible infinite loop
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:14:17 +00:00
Keir Fraser 56b0c617c9 Linux: Use losetup -f where available.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:12:58 +00:00
Keir Fraser 53374cadd7 x86: Fix xen_in_range() for fragmented percpu data area.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2010-01-14 10:03:44 +00:00
Keir Fraser 735f8ebd53 xend, NUMA: Fix computation of needed nodes
Enumerate the best nodes and add CPU affinity until all VCPUs can be
backed by at least one physical core. This should fix problems with
asymmetric NUMA configurations and cropped number of CPUs in Xen.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2010-01-14 09:44:08 +00:00
Keir Fraser 0b5e4f99ae libxenlight: fix name to domid conversion.
also simplify massively the function that iterate over all domains to
find the corresponding domid to a name.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:42:40 +00:00
Keir Fraser 9ff53e8d1a libxenlight: add error in disk_add if phystype is not recognized
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:42:06 +00:00
Keir Fraser b325401ccf libxenlight: add fuse around generic_device_add related to invalid kinds
prevent segfault in case the backend or frontend kinds have
not been set to a correct kind value (or not initilized).

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:41:34 +00:00
Keir Fraser 4137596283 libxenlight: initialize enum to 1, to prevent defaulting to the 0
values when structure when not properly initialized by the client.

Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:40:55 +00:00
Keir Fraser 2effe36292 libxenlight: add some return values testing in stubdom
Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
2010-01-14 09:40:01 +00:00
Keir Fraser a243d80da3 x86 hvm: Change default setting of guest CPUID RDTSCP bit
Expose RDTSCP CPUID to guest only when tsc_mode == TSC_MODE_DEFAULT
and host_tsc_is_safe() returns 1.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2010-01-13 08:33:34 +00:00
Keir Fraser 54954172e4 x86: fix unmaskable msi assignment issue.
Currently, unmasked msi irq's EOI write is deferred untile guest
writes EOI, so needs to keep eoi_vector unchanged before guest writes
EOI. However, irq migration breaks the assumption and changs
eoi_vector when interrupts are generated through new vector.

The patch removes the dependency for eoi_vector and directly recoreds
the irq info in the EOI stack, and when guest writes EOI, just do the
physical EOI for the specific irq(recorded in EOI stack)on the cpus
according to the cpu_eoi_map.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2010-01-13 08:18:38 +00:00
Keir Fraser a5f80565fb x86: minor cleanup to arch_memory_op()
There's a function-wide variable rc, so no need to re-declare it in
individual case handling blocks.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-13 08:17:00 +00:00
Keir Fraser 9cf11a576c Update Xen version to 4.0.0-rc2-pre 2010-01-13 08:16:37 +00:00
Keir Fraser b3eb2c1e8b x86: add and use XEN_DOMCTL_getpageframeinfo3
To support wider than 28-bit MFNs, add XEN_DOMCTL_getpageframeinfo3
(with the type replacing the passed in MFN rather than getting or-ed
into it) to properly back xc_get_pfn_type_batch().

With xc_get_pfn_type_batch() only used internally to libxc, move its
prototype from xenctrl.h to xc_private.h.

This also fixes a couple of bugs in pre-existing code:
- the failure path for init_mem_info() leaked minfo->pfn_type,
- one error path of the XEN_DOMCTL_getpageframeinfo2 handler used
  put_domain() where rcu_unlock_domain() was meant, and
- the XEN_DOMCTL_getpageframeinfo2 handler could call
  xsm_getpageframeinfo() with an invalid struct page_info pointer.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-01-13 08:14:01 +00:00