Commit Graph
20344 Commits
Author SHA1 Message Date
Keir Fraser 5cee2dafd8 xend: Cast oos flag to int before arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-20 08:43:27 +01:00
Keir Fraser 6f8b0338a4 vtd: Disable VT-d if no DRHD units are probed.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-19 16:50:14 +01:00
Keir Fraser 0353ecb9b9 vtd: A few cleanups to avoid dereferencing NULL drhd pointers.
In most cases I simply remove the reference since it is never actually
used.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-19 13:31:21 +01:00
Keir Fraser c45937b714 Revert 20338:5f28661bb2bb
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-19 13:03:03 +01:00
Keir Fraser a5d39947cb Allow guests to register secondary vcpu_time_info
Allow a guest to register a second location for the VCPU time info
structure for each vcpu.  This is intended to allow the guest kernel
to map this information into a usermode accessible page, so that
usermode can efficiently calculate system time from the TSC without
having to make a syscall.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-19 11:58:36 +01:00
Keir Fraser 980aa0a42f vt-d: do not enable VT-d on acpi=off
This reverts changeset 20323: 2370e16ab6d3 and adds a small
check to iommu_setup() which should more correctly cover all cases.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-10-19 10:57:58 +01:00
Keir Fraser 89329d832a x86 shadow: Update cr3 in PAE mode when guest walk succeed but shadow walk fails
When running in PAE mode, Windows 7 (apparently) will occasionally
switch cr3 with one of the L3 entries invalid, make it valid, and then
expect the hardware to load the new value.  (This behavior is
explicitly not promised in the hardware manuals.)  This leads to a
situation where on a shadow fault, the guest walk succeeds but the
shadow walk fails.  The code assumes this can only happen when the
domain is dying, and makes an ASSERT() to that effect.  So currently,
in debug mode, this will cause the host to crash; in non-debug mode,
this will cause a page-fault loop.

This patch solves the problem by calling update_cr3() in that path
when the guest is in PAE mode, and only ASSERT()ing when the guest is
not in PAE mode.  The guest will get one spurious page fault, but
subsequent accesses will succeed.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2009-10-19 10:56:58 +01:00
Keir Fraser 90abd2437a Per-domain switch to disable oos shadow page tables
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
2009-10-19 10:55:46 +01:00
Keir Fraser ed71370de1 [IOMMU] clean interrupt remapping and queued invalidation
This patch enlarges interrupt remapping table to fix the out-of range
table access when using many multiple-function PCI devices.
Invalidation queue is also expanded.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
Signed-Off-By: Cui Dexuan <dexuan.cui@intel.com>
2009-10-19 10:54:35 +01:00
Keir Fraser 88cc4a0fc5 x86: vMSI: Fix msi irq affinity issue for hvm guest.
There is a race between guest setting new vector and doing EOI on old
vector.  Once guest sets new vector before its doing EOI on vector,
when guest does eoi, hypervisor may fail to find the related pirq, and
hypervisor may miss to EOI real vector and leads to system hang.  We
may need to add a timer for each pirq interrupt source to avoid host
hang, but this is another topic, and will be addressed later.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-10-19 10:50:46 +01:00
Keir Fraser 70829c3d48 gdbsx: malloc extra bye for null char
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
2009-10-19 10:49:23 +01:00
Keir Fraser d1c22b7f83 xm,xend: Add commands to hotplug usb devices to hvm guests
Signed-off-by: James Song Wei <jsong@novell.com>
2009-10-19 10:48:47 +01:00
Keir Fraser c288a6ff89 xm: Fix xm network2-{attach,detach}
"xm help" is aborted due to a missing comma.
Some fixes in passing.
- less help message.
- typo.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-10-19 10:47:09 +01:00
Keir Fraser 27759c390c xend: Implement VBD.media_change
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 09:04:53 +01:00
Keir Fraser 5a0730a435 xm: Use 'vifname' config option to construct a qemu tap name.
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2009-10-16 08:36:22 +01:00
Keir Fraser dea1048d11 xend: Check no VBDs attached on VDI.destroy
We can destroy a VDI by VDI.destroy even if the VDI is being used
to VBDs. This patch checks that the VDI is not used to VBDs.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 08:35:21 +01:00
Keir Fraser 81a8a749f5 x86: document tsc_native configuration option in xmexample.hvm.
Set the default value to 1

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-10-16 08:34:49 +01:00
Keir Fraser 106c81c683 xm,xend: A few fixes for changeset 20314
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-16 08:32:34 +01:00
Keir Fraser 555a0408d2 x86: Update powernow.c to latest cpufreq code
The general cpufreq infrastructure has been improved over the
last year.  Update the AMD PowerNow! driver powernow.c to
take advantage of those improvements.

Specifically, addresses Novell bugzilla # 530035.

Signed-of-by: Mark Langsdorf <mark.langsdorf@amd.com>
2009-10-16 08:31:39 +01:00
Keir Fraser 6edd9aaf78 xend: passthrough: do not check non-page-aligned MMIO BAR if not strict-check
When the option pci-passthrough-strict-check of
/etc/xen/xend-config.sxp is set to 'no', we don't check the
non-page-aligned MMIO BAR.  This could be useful in some cases, e.g.,
when there is only 1 device in the range of the page and we try to
assign the device to pv guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-10-16 08:30:13 +01:00
Keir Fraser 4cf3febf20 vt-d: Fixpanic in msi_msg_read_remap_rte with acpi=off
Xen panics when "acpi=off noacpi" is set. Problem is caused by
dereferencing NULL pointer in drhd after calling
acpi_find_matched_drhd_unit. As acpi_find_matched_drhd_unit can
return NULL, checks has to be done before returned value is used.

From: Miroslav Rezanina <mrezanin@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-10-16 08:28:47 +01:00
Keir Fraser c5ff46d8d4 x86: Fix ept and vt-d co-existence issue.
For vt-d's mmio address ranges, once ept enables, they should
be added to ept page tables with p2m lock held, and then guest can
access these ranges like conventional ram, but to change the ept
entries, it should take the p2m lock first.

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-10-16 08:25:17 +01:00
Keir Fraser 242a16c3d1 xend: add a description config item for each guest.
Add a new option "description=" to each VM to increase the
manageability of VM, which could be accessed via "xm list -l
MACHINE".e.g add "description='(name, james),(priority 5), (owner
james.song@company.com)'" to configure file, User can get the VM's
attribute easily by "xm list -l Machine" or some tools.

Signed-off-by: James Song<jsong@novell.com>
2009-10-16 08:24:47 +01:00
Keir Fraser 94140f9757 Remove bogus call to get_domain_by_id() in do_domctl().
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-10-15 16:49:21 +01:00
Keir Fraser 61f2a44029 gdbsx: a gdbserver stub for xen.
It should be run on dom0 on gdbsx enabled hypervisor. For details,
please see tools/debugger/gdbsx/README

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-15 09:36:40 +01:00
Keir Fraser f8e61527db xm: Reuse VDI if location is same
In XenAPI mode, when we start a VM by using xm create command, VDIs
are always automatically created for VBDs.  Once we shut down the
VM, then start the VM again, then VDIs are newly created.  As a
result, a vdi.xml file continues to expand.

This patch reuses VDIs if location of the VDIs is same.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-15 08:31:08 +01:00
Keir Fraser 89b6b19a22 x86: Remove unused temporay variable 'old_gvec'.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
2009-10-15 08:30:31 +01:00
Keir Fraser 01dbe55471 lockprof: Fix x86_32 build and clean up coding style
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-15 08:29:33 +01:00
Keir Fraser 51f36202c4 xend: destroy stubdoms synchronously
This patch makes the destruction of stubdoms a synchronous event,
therefore it is no longer possible to run out of memory when rebooting
a guest because the stubdom of the old guest is always destroyed
before the creation of the new guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-15 08:16:42 +01:00
Keir Fraser b1fd365cec xm,xend: Add new option "change_home_server" to xm migrate
This patch adds a new option to xm migrate command.  A concept of the
option is inspired from XenServer/XenCenter.  The concept is "Change
home server (affinity)."  The option name is "change_home_server."

Currently, a config.sxp file of a managed domain is not migrated to a
destination server even if the migration of the managed domain
succeeds.  The config.sxp file is kept in a source server.

By the patch, the config.sxp file is migrated with the managed domain.
The config.sxp file is unregistered from the source server, then the
config.sxp file is registered to the destination server.

BTW, should the config.sxp file be always migrated without the option?
If the managed domain is migrated without the option, the managed
domains exist on both the source server and the destination server.
(Of course, the managed domain on the source server is "halted" state,
and the managed domain on the destination server is "running" state.)
Is it good that the managed domains with a same UUID exist on both
servers?  (In the patch, I added the option for compatible.)

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-14 09:09:23 +01:00
Keir Fraser 11a92ae1f0 Update QEMU_TAG to 71324566f3b95bb88105659439adaef1d5bd155c 2009-10-14 09:08:16 +01:00
Keir Fraser 0482af4d96 Spinlock profiling (enable in build with lock_profile=y)
Adds new tool xenlockprof to run from dom0.

From: Juergen Gross <juergen.gross@ts.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-14 09:07:51 +01:00
Keir Fraser c637aa4f78 minios: fix console end of line: \n\r -> \r\n
Change the end of line produced by minios' console from \n\r to \r\n.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:58:47 +01:00
Keir Fraser a45c214328 xend: call pci_device_configure on the stubdom
Whenever pci_device_configure is called on a guest that has a stubdom,
call pci_device_configure on the stubdom as well.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:56:55 +01:00
Keir Fraser 1ce3e83dc7 xend: allow a device to be assigned to a guest and its stubdom
This patch allows a pci device to be passed through an HVM guest and
its own stubdom at the same time.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:56:25 +01:00
Keir Fraser 17af1d38f3 minios: fix minios console
MiniOS' console_print tries to expand '\n' into "\n\r" in place,
causing page faults if the string resides in text.
Use a duplicate of the string instead.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:55:43 +01:00
Keir Fraser fda49f9b3f Add build option to allow more hypercalls from stubdoms
Stubdoms need to be able to make all the passthrough related
hypercalls on behalf of the guest (for now).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-14 08:54:58 +01:00
Keir Fraser ae72c3f2af stubdom pcilib: define endianness for minios
Include endian.h for MiniOS.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:33:11 +01:00
Keir Fraser 2757a76076 minios pcifront: translate physical into virtual addresses
Qemu understands physical pci addresses while pciback expects virtual
pci addresses: this patch adds a translation function in pcifront to
make the conversion.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-10-14 08:31:07 +01:00
Keir Fraser 49d46b98d6 pv-on-hvm: Adjust mkbuildtree to handle pv_ops header placement
Due to the movement of the arch include directories, we need to adjust
where mkbuildtree looks for headers when building the pv drivers.
Also add a check for the location of features.c

Signed-off-by: Charles Arnold <carnold@novell.com>
2009-10-14 08:29:56 +01:00
Keir Fraser 5a153a9f8c x86: reduce the uses of CONFIG_COMPAT
... to where it really is needed and meaningful (i.e. in some places
it seems to make more sense to use __x86_64__ instead).

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-10-12 12:56:00 +01:00
Keir Fraser f98ee759c5 x86: trust new architecturally-defined TSC Invariant bit on Intel systems
Trust new architecturally-defined TSC Invariant bit (on
Intel systems only for now, AMD TBD).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-09 09:34:03 +01:00
Keir Fraser 50030962ce x86: Fix build after ia64 grant-table build fix.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-09 09:33:29 +01:00
Keir Fraser 2f42a37e57 xend: Fix VDI-VBD link for XenAPI
I detected problems of VDI-VBD link again.
  - In the case of inactive managed domains, VDI->VBD link was lost
    by xend restarting (or host OS rebooting).
  - In the case of active domains, both VDI->VBD link and VBD->VDI
    link were lost by xend restarting.

When xend is restarted, information of VDI instances is restored from
a vdi.xml file.  But the vdi.xml file does not have UUID of VBD
because xend does not write the UUID to the vdi.xml file.  Therefore,
VDI->VBD link is lost.  When xend is restarted, information of VBD
instances is restored from xenstore.  But xenstore does not have UUID
of VDI.  Therefore, VBD->VDI link is lost.

This patch solves the problems.  VDI instances stop having UUID of
VBD.  Instead, xend gathers UUID of VBD each time it's required.  The
method is the same as Network->VIF link.  Information of VBD instances
is restored not only from xenstore but from a config.sxp file.  UUID
of VDI is restored from the config.sxp file.

FYI, VBD->VDI link of inactive managed domains is not lost because
information of VBD instances is restored from the config.sxp file.
UUID of VDI is written by xend to the config.sxp file.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-10-09 08:56:43 +01:00
Keir Fraser a60d80e39e blktap2: Check gcrypt library has MD5() function.
From: Dulloor <dulloor@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-09 08:55:43 +01:00
Keir Fraser 537f073c37 Fix the IA64 build of the hypervisor.
This is completely untested, beyond confirming that it compiles.

Signed-off-by: Steven Smith <steven.smith@citrix.com>
2009-10-09 08:54:25 +01:00
Keir Fraser d680037667 xend: Fix bug in superpage flag handling
During testing I discovered that using a bootloader magically clears
the superpage flag out of the config.  This small patch fixes that
behavior.

From: Dave McCracken <dcm@mccr.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-09 08:53:42 +01:00
Keir Fraser a09edd4427 Obtain Linux kernels via git-over-http
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-08 09:24:32 +01:00
Keir Fraser e82a2fb608 x86 tsc: Fix check_tsc_warp() bug and add copyright notice
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-10-08 08:51:51 +01:00
Keir Fraser e9bb68a99b xsm: Correct the usage of XSM_ENABLE after c/s 20285.
Signed-off-by : Machon Gregory <mbgrego@tycho.ncsc.mil>
2009-10-08 08:48:52 +01:00