Commit Graph
22420 Commits
Author SHA1 Message Date
Ian Jackson 16f2fb18bc Revert 61c0c52a8c6c "qemu-xen: build adjustments"
It appears that the changeset
  qemu-xen: build adjustments to support out-of-tree builds
broke the build.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-23 18:38:16 +00:00
Jan Beulich 762626dd33 qemu-xen: build adjustments to support out-of-tree builds
QEMU by itself can be built outside of its source directory. With the
qemu repository being separate from the hypervisor/tools one it seems
to make sense to make use of this feature, but doing so requires a
couple of adjustments to the Xen changes to it. Basically, if
CONFIG_QEMU is found to indicate an existing directory, this directory
will be used rather than cloning the git repo into the build tree.

[ This changeset is the xen-unstable part of the patch but also
  includes the QEMU_TAG update to pull in the qemu part. -iwj ]

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-23 16:43:38 +00:00
Keir Fraser 3ed6a063d2 x86 hvm: Fix VPMU issue on Nehalem cpus
Fix an issue on Nehalem cpus where performance counter overflows may
lead to endless interrupt loops on this cpu.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
2010-11-22 19:16:34 +00:00
Keir Fraser 566f838239 x86: Check for MWAIT in CPUID before using it in ACPI idle code.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-22 19:13:00 +00:00
Keir Fraser d4076a1e3c event_channel: Fix uninitialised variable build error.
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-22 08:29:03 +00:00
Ian Jackson 47aec067a5 QEMU_TAG update 2010-11-19 18:55:18 +00:00
Jan Beulich 65a03ea9ca stubdom: allow building with read-only sources
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-19 18:39:33 +00:00
Andre Przywara ec527f3ef9 libxc: fix tracing (broken with hypercall buffers)
the attached patch makes Xen tracing work again, after the introduction
of the hypercall buffers broke it. Just a missing line.

Thanks to Uwe Dannowski for reporting this.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2010-11-19 18:15:14 +00:00
Keir Fraser 9bd7a35715 x86-64: Re-map all physdev_op struct names in compat shim.
Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-19 13:49:54 +00:00
Keir Fraser 77598c0f3d Introduce PHYSDEVOP_get_free_pirq
Introduce a new physdev_op called PHYSDEVOP_get_free_pirq to allow a
guest to get a free pirq number from Xen; the hypervisor would keep
that pirq free for the guest to use in a mapping.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-11-19 13:45:08 +00:00
Keir Fraser 0b469cd687 Interrupt remapping to PIRQs in HVM guests
This patch allows HVM guests to remap interrupts and MSIs into pirqs;
once the mapping is in place the guest will receive the interrupt (or
the MSI) as an event.  The interrupt to be remapped can either be an
interrupt of an emulated device or an interrupt of a passthrough
device and we keep track of that.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-11-19 13:43:24 +00:00
Keir Fraser 26b1575bf3 VPMU: Add the Intel CPU X7542 to the list of supported prcocessors
Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
2010-11-19 13:26:42 +00:00
Keir Fraser 4c776a32dc consolidate custom parameter parsing routines looking for boolean values
Have a single function for this, rather than doing the same in half a
dozen places.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-19 13:25:54 +00:00
Keir Fraser a1650a41d7 x86-64: one more adjustment for Fam10 MMCONF enabling
The BASE_VALID() macro needs adjustment to match the other changes
done to the original Linux code (which are all queued to be merged
into Linus' tree), plus per Hypertransport specification the range
0xff00000000-0xffffffffff also needs to be excluded.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-19 13:24:00 +00:00
Keir Fraser 8f28bee303 iommu: adjust section annotations in pass-through code
Most importantly, anything Dom0 construction related can be __init.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2010-11-19 13:23:34 +00:00
Keir Fraser 2c7d8f610b x86/mm: Allocate log-dirty bitmaps from shadow/HAP memory.
Move the p2m alloc and free functions back into the per-domain paging
assistance structure and allow them to be called from the log-dirty
code.  This makes it less likely that log-dirty code will run out of
memory populating the log-dirty bitmap.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-11-19 13:21:09 +00:00
Keir Fraser a681f36c2e x86/mm: don't override an existing shadow memory allocation when
enabling log-dirty shadows on a PV guest.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2010-11-19 13:20:48 +00:00
Keir Fraser 138880600a x86 hvm: Refuse to perform __hvm_copy() work in atomic context.
Soon we will properly handle paged out memory in this function by
sleeping in hypervisor context. This will require that all callers can
sleep.

If this check is too strong, we can reduce it to only applying to
guests with paging enabled (which also currently implies only guests
using Intel EPT). However my brief testing seems to indicate it works
okay.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-18 12:28:31 +00:00
Keir Fraser 6020fcb848 rcu_lock(current->domain) does not need to disable preemption.
If the guest sleeps in hypervisor context, it should not be destroyed
until execution reaches a safe point (i.e., guest context). This is
not implemented yet. :-) But the next patch will rely on it, to allow
an HVM guest to execute hypercalls that indirectly invoke __hvm_copy()
within an rcu_lock_current_domain() region.

Signed-off-by: Keir Fraser <keir@xen.org>
2010-11-18 12:26:27 +00:00
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