Commit Graph
22401 Commits
Author SHA1 Message Date
Keir Fraser 652ec2d1ec Define Linux-style <preempt.h> interface.
Use it to disable sleeping in spinlock and rcu-read regions.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-18 11:45:33 +00:00
Keir Fraser c03ec255cd waitqueue: Add license info to source file.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-18 11:44:40 +00:00
Keir Fraser 49778ecb72 x86_64: Fix booting 32-bit dom0
dom0/vcpu0 was not getting allocated a hypercall xlat area.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-17 20:40:30 +00:00
Keir Fraser 9e81df9a42 x86/hvm/pmtimer: improving scalability of virtual time update
Mitigate the heavy contention on handle_pmt_io when running a HVM
configured with many cores (e.g., 32 cores). As the virtual time of a
domain must be fresh, there should be someone updating it,
periodically. But it is not necessary to let a VCPU update the virtual
time when another one has been updating it. Thus the update can be
skipped when the VCPU finds someone else is updating the virtual time.
So every time a VCPU invoke handle_pmt_io to update the current
domain's virtual time, it will first try to acquire the pmtimer lock.
If it succeeds, it will update the virtual time. Otherwise, it can
skip the update, waits for the pmtimer lock holder to finish updating
the virtual time and returns the updated time.

Signed-off-by: Xiang Song <xiangsong@fudan.edu.cn>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-17 17:28:17 +00:00
Keir Fraser 9b231b6bc2 Wait queues, allowing conditional sleep in hypervisor context.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-17 16:42:37 +00:00
Keir Fraser 89b31d1255 Add locking-depth debugging, introduce in_atomic() boolean.
This will be useful for debugging use of sleep-in-hypervisor
primitives.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 15:41:28 +00:00
Keir Fraser 106f2288c2 x86_64: Make 32-bit-hypercall translate area per-vcpu.
This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 14:16:36 +00:00
Keir Fraser 561e917937 x86: Clean up vcpu initialisation (especially xsave save area)
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 14:09:13 +00:00
Keir Fraser 430203d65f Make multicall state per-vcpu rather than per-cpu
This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 13:01:43 +00:00
Keir Fraser 43e7d2b21a x86 hvm: Make a couple of hypercall state flags per-vcpu
This is a prerequisite for allowing guest descheduling within a
hypercall.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 12:42:35 +00:00
Keir Fraser 36ba5243d4 x86 hvm vpmu: Print error if VPMU cannot be init'ed on this CPU.
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-16 11:44:09 +00:00
Keir Fraser 7118250f93 amd iommu: Fix HV crash with 32bit pv_ops kernel
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Tested-by: Conny Seidel <conny.seidel@amd.com>
2010-11-16 11:28:33 +00:00
Keir Fraser 2988e3b9d2 x2apic: Remove a panic condition in enabling x2APIC
Currently Xen triggers a panic if user disables VT-d by command line
while not disable x2APIC. This requires users to specify both
"iommu=0" and "x2apic=0" to disable VT-d if the platform supports
x2APIC. It's not user friendly. This patch removes the panic
condition. That's to say, don't require user to specify "x2apic=0"
when specify "iommu=0". As long as VT-d is not enabled (disabled in
BIOS or in command line), x2APIC won't be enabled naturally (x2APIC
depends on VT-d Interrupt remapping).

Signed-off-by: Weidong Han <weidong.han@intel.com>
2010-11-15 09:31:38 +00:00
Keir Fraser 9a36faf0c6 x86 xsave: Adding back CPUID support for Xsave (version 2)
XSave support via CPUID virtualization for both PV and HVM guests.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2010-11-15 09:27:53 +00:00
Ian Campbell d549bdb2a0 libxc: correct dirty_bitmap bounce size in xc_hvm_track_dirty_vram
The size should be in bytes not 32-bit words. Fixes graphics
corruption issues for HVM guests due to bouncing too little data.

Also the dirty_bitmap buffer is output only and therefore only needs
bouncing in one direction.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-10 14:56:06 +00:00
Sander Eikelenboom adee1dd918 tools/hotplug/Linux: supply --physdev-is-bridged in iptables runes
With newer (pvops) kernels logs get flooded with this iptables
warning: physdev match: using --physdev-out in the OUTPUT, FORWARD and
POSTROUTING chains for non-bridged traffic is not supported anymore

Using the --physdev-is-bridged option prevents this.
See also: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=571634#10

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-10 14:37:19 +00:00
Keir Fraser 57f1362319 hvmloader: Fix 22383:cba667fb80cf iterating over defns 0..255
We need to declare devfn as wider than 8 bits for a loop 0<devfn<256
to terminate.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-10 14:15:23 +00:00
Keir Fraser cf17821447 hvmloader: fix off-by-one-bit error when initialising PCI devices
hvmloader is responsible for - amoungst other things - initialising
the PCI device BARs prior to loading the guest BIOS.  The previous
code only probed for devfn up to 128.  The lower 3 bits are function
IDs so this meant that only devices in slots 0-15 were actually being
initialized.

Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Acked-by: Gianni Tedesco <gianni.tedesco@citrix.com>
2010-11-10 13:58:16 +00:00
Keir Fraser e0dbccc8fe hvmloader: Fix acpi static tables for new ACPI ioports location.
This change some fadt values -- the address of the acpi ioports -- and
the pm1a_evt_address value wrote for the pci bus.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
2010-11-09 20:37:46 +00:00
Ian Campbell cb6c757fa4 tools: provide explicit target for refetching/resetting qemu
This patch adds an explicit update mechanism:
  make tools/ioemu-dir-force-update
This isn't brilliant but is better than doing "cd tools/ioemu-remote
&& git reset --hard <sha1...>" by hand.

Note that invoking this target will destroy all working tree changes
made to qemu-xen.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-09 18:15:25 +00:00
Anthony Perard 8fe49db6bd firmware, qemu: Change ACPI IO values to match QEMU BIOS
As part of the QEMU/Xen merge, this patch comes to change the value of
sleep states and add some information in the PCI registers to match the
implementation of the BIOS of QEMU.

It also does a hypercall (HVM_PARAM_ACPI_IOPORTS_LOCATION) that tell the
Xen to use the new Port I/O instead of the old one.

[ Also, in this patch, update QEMU_TAG to the qemu-xen revision
  with the corresponding qemu change. -iwj ]

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-09 18:03:55 +00:00
KUWAMURA Shin'ya e737da7402 tools: libxl: fix cpuid compilation errors for ia64
ia64 does not have cpuid.  So break out cpuid-related functions into a
separate file, with stubs for ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-09 17:43:12 +00:00
Ian Jackson 4831e2743f tools: libxl: Fix some "const const"s introduced in 711cb4229900
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-09 12:00:05 +00:00
Keir Fraser bc01a5837a ia64: fix the build (again)
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-09 11:50:37 +00:00
Keir Fraser 9f41c22a55 x86: allow passing initrd to kernel without exposing it through the initial mapping
The (Dom0 only for now) kernel can indicate that it doesn't need its
initrd mapped through a newly added ELF note - it gets passed the PFN
of the initrd in this case instead of the virtual address.

Even for kernels not making use of the new feature, the initrd will
no longer get copied into the initial mapping, but the memory it lives
in will get assigned to and mapped for the guest instead.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-09 11:50:14 +00:00
Keir Fraser 5a77180011 x86: do away with the boot time low-memory 1:1 mapping
By doing so, we're no longer restricted to be able to place all boot
loader modules into the low 1Gb/4Gb (32-/64-bit) of memory, nor is
there a dependency anymore on where the boot loader places the
modules.

We're also no longer restricted to copy the modules into a place below
4Gb, nor to put them all together into a single piece of memory.

Further it allows even the 32-bit Dom0 kernel to be loaded anywhere in
physical memory (except if it doesn't support PAE-above-4G).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-09 11:49:49 +00:00
Keir Fraser e04aea7477 x86 hvm: Fix MTRR physaddr-width check.
Should be checking against physaddr width presented to teh guest,
rather than the host physaddr width.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-09 11:48:43 +00:00
Keir Fraser e9cc934b59 hvmloader: Fix e820 printing routine -- addresses are 64-bit
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-09 10:34:43 +00:00
Anthony Perard a6aa655723 libxc: Save the HVM_PARAM_ACPI_IOPORTS_LOCATION
This will save the acpi_ioport_location hvm_param in the checkpoint file
and set the parameter in Xen at restore.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-08 17:25:54 +00:00
Ian Jackson d32628fe37 QEMU_TAG update 2010-11-08 17:14:50 +00:00
Ian Jackson deaa319f11 tools: xl: more const-correctness
The implementation of xl was lacking a lot of consts on its char*s.
In this patch we improve matters.  It doesn't fix everything.  In
particular:

  * I only changed char*s and not other structs that ought to be const.

  * libxl_send_debug_keys should take a const char* but the pointer
    ends up getting sent to DECLARE_HYPERCALL_BOUNCE from xc_private.h
    and that won't take a const char*.  I wasn't sure what to do so
    I have left it.

  * There is a great deal of in-place string tokenisation (both
    ad-hoc, and using strtok_r).  I haven't changed any of that.

  * I haven't changed any of the occurrences of char **argv because of
    the castless assignment incompatibility between const char** and
    char **.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-08 17:05:14 +00:00
Jim Fehlig 0d84911192 Fix pci passthru in xend interface used by libvirt
Attempting to define or create a domain whose XML config contains a
passthru PCI device fails with libvirt

xen84: # cat win2k8r2.xml
...
   <hostdev mode='subsystem' type='pci' managed='no'>
      <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
      </source>
    </hostdev>
...

xen84: # virsh create ./win2k8r2.xml
error: Failed to create domain from ./win2k8r2.xml
error: POST operation failed: xend_post: error from xen daemon:
  (xend.err "Error creating domain: 'key'")

The PCI device config maintained by xend includes a 'key' field, which is
initialized by xm client when using that tool and traditional xen config
file.  libvirt, which uses xend's sexpr-over-http interface (is that the
proper name for that interface??), does not initialize this field - and
shouldn't be expected to do so IMO.  Clients should not be bothered with
xend's internal representation of a PCI device.

This patch populates the 'key' field within xend if it is uninitialized,
similar to current initialization of 'uuid' field.  The 'vdevfn' field
suffers a similar problem if not (optionally) specified by user.
AFAICT, the xm client initializes 'vdevfn' to 0x100 if not specified so
I've done the same here.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-08 16:24:22 +00:00
Keir Fraser 47a3fb9662 x86: xsave save/restore support for both PV and HVM guests (version 2)
I have tested the patch in the following senarios:
1> Non-xsave platform
2> Xsave-capable platform, guest does not support xsave, xen support xsave
3> Xsave-capable platform, guest does support xsave, xen supports xsave
4> Guest (non-xsave) saved on platform without xsave, restored on a
   Xsave-capable system.

All passed.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Han Weidong <weidong.han@intel.com>
2010-11-08 15:44:02 +00:00
Keir Fraser 59e3eeb9ef x86: Fix PV guest xsave support.
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
2010-11-08 15:41:01 +00:00
Keir Fraser f3eb58ef29 hvmloader: Use ipxe 1.0.0 final rather than a release candidate.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-08 15:32:55 +00:00
Keir Fraser 63296c53de x86-64: more fixes for Fam10 MMCONF enabling
Unfortunately it turned out the original Linux code had more issues:
We want to place the region above 4G in any case (even if TOM2 isn't
enabled or invalid), and the base mask definition was improperly typed
(thus causing shifts by FAM10H_MMIO_CONF_BASE_SHIFT to produce other
than the intended result). Fixing this in turn allowed simplifying the
MMIO region detection code, as regions ending below TOM2 now aren't of
interest anymore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-08 15:32:05 +00:00
Keir Fraser ae27bff616 hgignore: Rename gpxe -> ipxe 2010-11-04 16:42:34 +00:00
Keir Fraser 0806f13b3e hvmloader: Replace gPXE with iPXE for ethernet boot ROM
It is actively maintained.

From: Gianni Tedesco <gianni.tedesco@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-04 16:38:13 +00:00
Keir Fraser f2136c6133 libelf: move to init text/data when built for the hypervisor
Rather than annotating each and every function and data object (and
then still missing some compiler generated ones, plus getting into
ugliness due to the code also being built from tools/libxc/), use
objcopy to rename all relevant sections.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-04 16:37:29 +00:00
Keir Fraser 0cd09703b1 x86: clean up AMD Fam10 xenoprof IBS code
Arrange for (almost) no code to be generated for x86-32, where the
functionality is disabled anyway. Properly __init-annotate the code.
Remove some pointless bits.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-04 16:36:37 +00:00
Keir Fraser c8bb5635de x86-64: enable MMCONFIG on AMD Fam10 systems even if the BIOS didn't
Code for this has been in Linux since 2.6.26, and since Xen itself
wants to use the MMCONFIG access method when possible, clone it
(fixing some rather obvious bugs in that code at once).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-04 16:35:58 +00:00
Keir Fraser 769bd508c3 [VTD] fix a typo and some minor cleanup of quirks.c
Fixed a typo for IGD_DEV define and some minor cleanup to ease future
enhancement.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2010-11-04 16:35:17 +00:00
Keir Fraser bd19080b52 x86: Do not expose XSAVE/AVX to guests.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-04 16:29:47 +00:00
Keir Fraser f0f9b2df89 Revert 22347:16093532f384 "x86: xsave save/restore support"
Completely broken when xsave is not enabled or supported on the host.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-04 16:25:26 +00:00
Keir Fraser 24f2a60c5f x86/mm: tidy up m2p checks in audit_p2m
to handle freshly allocated pages.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-11-03 17:40:10 +00:00
Keir Fraser 6c629332f0 xenpaging: whitespace fixes after addition of __get_paged_frame
Cleanup whitespace which was introduced in patch that added
__get_paged_frame.
Convert tabs to spaces to follow the coding style in this file.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
2010-11-03 17:39:23 +00:00
Lutz Dube eb37dccf5b tools: fix cpu_weight/cap loss (22000:4fc66044477d)
Correction/Extension of changeset 22000:4fc66044477d
  "Values of cpu_weight and cpu_cap are lost after xend restart"

Values of cpu_weight and cpu_cap taken from managed SXP file have to
be converted from str to int.

Signed-off-by: Lutz Dube <lutz.dube@ts.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 17:23:42 +00:00
Ian Jackson dca1b6e714 QEMU_TAG update 2010-11-03 12:51:14 +00:00
Ian Campbell c894e6dae7 libxc: fix bounce buffers in xc_pm_get_cx_stat and xc_pm_get_pxstat
We should bounce the buffers themselves, not the pointers to them!

Error introduced by 22292:a1b39d2b9001 and reported by Yang Z Zhang.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 12:35:04 +00:00
KUWAMURA Shin'ya f0188031b6 libxc, ia64: ia64 counterpart of 22275:e95dc0eb152d and 22285:36a317494429
This patch fixes compilation errors by 22275:e95dc0eb152d:
  ia64/xc_ia64_linux_save.c:797: error: too few arguments to function 'callbacks->switch_qemu_logdirty'
and applies 22285:36a317494429 to ia64.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-03 12:27:00 +00:00