Commit Graph
19772 Commits
Author SHA1 Message Date
Keir Fraser c93bd0e6ea tmem: fix 32-on-64 support
This implicitly required coverting the tmem_op structure from
anonymous to standard struct/union sub-fields, and extending the
get-fields.sh helper script to deal with typedef-ed guest handles used
as types of translated compound type fields.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-17 07:14:02 +01:00
Keir Fraser c133cc38e2 x86: fix s3 resume on AMD CPUs
Avoid longjmp as it has different semantics than on Intel CPUs in long
mode. Also add a few comments and remove a pointless reload of DS.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-06-16 14:19:34 +01:00
Keir Fraser 50f27130b5 x86: Allow guests to allocate up to 2MB (superpage) memory extents.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-06-16 14:04:15 +01:00
Keir Fraser cc0de53a90 x86: improve output resulting from sending '0' over serial
While the original logic already implied that the kernel part of the
guest's address space is identical on all vCPU-s (i.e. for all guest
processes), it didn't fully leverage the potential here: As long as
the top page table currently active is owned by the subject domain
(currently only Dom0), the stack dump can be done without extra
effort.

For x86-64, additionally add page table traversal so that the stack
can be dumped in all cases (unless it's invalid or user space).

I left the 32-bit variant of do_page_walk() unimplemented for the
moment as I couldn't convince myself using map_domain_page() there is
a good idea, and didn't want to introduce new fixmap entries either.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-16 13:57:18 +01:00
Keir Fraser 360f174b3d x86/hvm: don't pass through port 0x80 in a few special cases
In a recent commit (99f85a28a78e96d28907fe036e1671a218fee597), KVM
disabled the passthrough of this port due to known problems on certain
HP laptops (see
http://lkml.indiana.edu/hypermail/linux/kernel/0712.3/0872.html
and http://lkml.indiana.edu/hypermail/linux/kernel/0801.0/2388.html).

For Xen, don't do this globally, but rather based on a DMI black list.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-16 13:52:13 +01:00
Keir Fraser 767d7a478a vtd: ats and queued invalidation cleanup
Use iommu_qinval in place of qinval_enabled flag.  Use
ecap_queued_inval() for determining whether queued invalidation is
available on this vt-d engine or not.

Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2009-06-16 13:41:17 +01:00
Keir Fraser 2d61801bce x86, hvm: set vcpu->is_initialised after restore/migration
After restore/migration, the xenctx command for auxiliary vcpus
fails with a message "xc_vcpu_getcontext: No data available".

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-06-16 13:39:00 +01:00
Keir Fraser 9640ac9154 x86, hvm: fix a domain_lock leak
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-06-16 13:33:12 +01:00
Keir Fraser 9ed6a7c5dd xend: support for older pciutils without -vmm option, and improve
error handling in get_info_from_lspci().

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
2009-06-16 11:53:47 +01:00
Keir Fraser 7cd9ff256c tmem: cleanups
- don't mis-use guest handle for passing an MFN value
- eliminate unnecessary (and misplaced) use of XEN_GUEST_HANDLE_64
- use copy_from_guest() instead of __copy_from_guest() for loading the
  argument structure

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-16 11:47:09 +01:00
Keir Fraser afd4c19a15 xend: pass-through: Use common parsing code in preprocess_pci()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:41:31 +01:00
Keir Fraser bf17cf4c4c xend: pass-through: Use PCIDevice as the parameter for the constructor for PCIQuirk
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:39:02 +01:00
Keir Fraser 6c4c01bd43 xend: pass-through: Remove PciDeviceNotFoundError, it is never used
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:38:33 +01:00
Keir Fraser 52ecedb262 xend: pass-through: sxp.merge() cant deal with values being a list
sxp.merge() can't deal with values being a list so instead
of storing pci options as:

[ 'opts', [ 'key1' 'value1'], [ 'key2', 'value2'], ...]

store them as:

[ 'opts', [ 'key1' 'value1'], ['opts', [ 'key2', 'value2']], ...

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:37:41 +01:00
Keir Fraser fb8a264cd0 xend: pass-through: cleanupDevice: move and remove recently added vslot entry
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:36:40 +01:00
Keir Fraser 005f6dc9a8 xend: pass-through: tidy up PciController()
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:36:03 +01:00
Keir Fraser e5c65dc72e xend: pass-through: fix typo: spx -> sxp
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:35:16 +01:00
Keir Fraser 678e6d8b30 xend: pass-through: Only call setupOneDevice() once per device
As observed by Dexuan Cui, when PCI devices are passed through at
domain-creation-time setupOneDevice() will be called twice.

Once via setupDevice() and once via econfigureDevice() which
is called in pci_device_configure().

This patch removes the first of these.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Cc: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-16 11:33:23 +01:00
Keir Fraser 70ba0db350 vtd: Clean up lock for VT-d register writes
It should get lock to write VT-d registers. Currently there are some
register writes without lock. This patch complements register_lock for
those writes.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-06-16 11:31:20 +01:00
Keir Fraser 2e9127c7a5 vtd: Fix flush for SRTP and SIRTP set
SRTP (Set Root Table Pointer) operation must be set before enable or
re-enable DMA remapping. And after set it, software must globally
invalidate the context-cache and then globally invalidate the
IOTLB. This is required to ensure hardware uses only the remapping
structures referenced by the new root-table pointer, and not stale
cached entries. Similarly, SIRTP (Set Interrupt Remap Table Pointer)
operation must be set before enable or re-enable Interrupt
remapping, and after set it, software must globally invalidate the
interrupt entry cache. This patch adds global context and iotlb
flush after set root entry, and globally flushs interrupt entry
cache before enabling Interrupt remapping. And remove the
iommu_flush_all in iommu_resume becuase it becomes redundant after
adds flush for SRTP in init_vtd_hw.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-06-16 11:30:45 +01:00
Keir Fraser 7e03843de6 xend: support multiple consoles per domain
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-16 11:25:37 +01:00
Keir Fraser c811d0d548 xenconsole: support for multiple consoles per domain
This patch adds a new command line argument to xenconsole to specify
to which console to connect to in case a domain has more than one.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-16 11:24:58 +01:00
Keir Fraser f84ee327e5 tmem: fix minor accounting error
Reset a counter when all tmem pages are released.  This
only affects status reporting (as displayed by xm tmem-list
or the just patched xenballoon-monitor) but the incorrectly
reported result is misleading.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-06-16 11:18:32 +01:00
Keir Fraser 78c4e40239 tools/xenballoond: add tmem capability to directed/self-ballooning
and monitor tool

This patch adds tmem support to the largely unknown/unused
xenballoond scripts that implement both self-ballooning and
a foundation for directed-ballooning.  Tmem and automated
ballooning are highly complementary in that, when ballooning
is over-aggressive, paging and swapping can increase noticably.
Precache preserves evicted pages that may be needed again soon
(thus eliminating disk reads) and preswap provides memory-based
swapping that occurs if ballooning is insufficiently responsive
to a sudden increase in activity and memory demand (thus
eliminating disk writes and reads).

There are two changes in this patch:

1) The xenballoond service is a convenient place to implement
   userland "preswap shrinking".**
2) The xenballoon-monitor script is a convenient place to
   report (and view with "watch -d") the frequent memory
   rebalancing that results from tmem usage on a busy system.

Note that for best results (and for the monitor script to
work), the xenstore-* tools should be installed on each guest.

(** In a disk-based swap device, stale pages are often left
  on-disk even after they are no longer needed or valid; they
  are simply overwritten if/when the disk blocks are needed
  again, which may be a very long time.  Preswap behaves
  much like a disk, but uses precious pages of memory that
  count against a guest's memory allocation; thus stale
  pages are very undesirable.  Preswap shrinking periodically
  attempts to remove stale pages from preswap by using a
  sysfs interface created by the linux-side tmem patch.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-06-16 11:17:28 +01:00
Keir Fraser 662b95dadd x86: Switch to using pvops kernel by default for Linux
Keave ia64 on 2.6.18 since it currently has no dom0 support in pvops

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2009-06-16 11:15:48 +01:00
Keir Fraser 3cc3cacd42 Remove bogus link from COPYING file.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-06-16 11:11:59 +01:00
Keir Fraser 9c7be4de83 Fix dependencies in tools/include/xen-foreign/Makefile
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2009-06-16 11:01:17 +01:00
Keir Fraser 51e4a7555d xend: allow config file compatibility with new tap syntax
Recently the format of the tap syntax in the config file changed to
using a 4 part specifier (tap:tapdisk:<format>:<filename>) instead
of the old 3-part one (tap:<qcow>:<filename>).
This breaks compatibility with existing config files: a guest start
will throw a Python exception and will be aborted.
AFAICS currently tap:tapdisk is redundant, so the attached patch
simply catches the above mentioned exception and tries to parse the
old format in this case.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
2009-06-16 11:00:29 +01:00
Keir Fraser e966818264 x86 mca: Support MCA recovery actions for latest Intel platforms
When an UC = 1 PCC = 0 MCE happens, there're more types of software
recoverable error defined on on latest Intel Platform. For identifying
those new errors, some new bit (S/AR bit) is defined in MCi_STATUS
register. Also we need MCACOD help's to judge the detailed
error. Combined with the OVER bit, different recovery policies are
required for containing those new errors.

SRAO error  is an software recoverable MCA error, no recovery action
required. while SRAR  is an software recoverable MCA error, recovery
action is required.

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
2009-06-16 10:58:56 +01:00
Keir Fraser 3e71ff4418 xend: Show "bootable" information only once in 'xm list --long'
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-16 10:55:36 +01:00
Keir Fraser 71489b7cd2 blktap2/vhd, daemon: serialize subdirs-all and subdirs-install
make install in vhd and daemon, subdirs-all and subdirs-install
are invoked parallel causing nasty error.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2009-06-16 10:54:10 +01:00
Keir Fraser b8d155220b Update QEMU_TAG to e0bb6b8df60863bca0163a1688baf4854e931e55 2009-06-08 18:23:57 +01:00
Keir Fraser 54c07de022 xend: pci: fix extract_the_exact_pci_names()
Changeset 19726: d8b7b51f482b neglects the case pci_names could be
types.ListType.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-06-08 12:24:14 +01:00
Keir Fraser e54c12cdbd x86 hvm: move dirty_vram into struct hvm_domain
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-05 14:04:03 +01:00
Keir Fraser 7c18f04cb3 vmx: Change xen macro name for Intel vmexit reason 41
This VMEXIT (reason 41) indicates MCE during a VMENTRY, the old macro
definition is misleading us.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
2009-06-05 09:32:03 +01:00
Keir Fraser 819d2f263c blktap2: README updates
As promised, this brings the long out-of-sync documentation up to
date, and adds some getting started information about tapdisk driver
development - I get the occasional email on this latter subject.

Signed-off-by: Dutch Meyer <dmeyer@cs.ubc.ca>
2009-06-05 09:31:23 +01:00
Keir Fraser 532f0ae513 xend: Convert the type of superpages to integer to fix a TypeError.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-06-05 09:30:36 +01:00
Keir Fraser 90731c414d VT-d: correct way to submit command to GCMD register
Per VT-d spec, software should submit only one "incremental" command
at a time to Global Command reigster. Current implementation uses a
variable (gcmd) to record the state of Global Status register. It's
error prone.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-06-05 09:29:42 +01:00
Keir Fraser 2de77a2754 VT-d: define a macro for waiting hardare completion
When set some registers of VT-d, it must wait for hardware
completion. There are lots of duplicated code to do that. This patch
defines a macro for it, thus it is much cleaner.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-06-05 09:27:18 +01:00
Keir Fraser ab6167c090 VT-d: remove useless variables
This patch removes global variable "vtd_enabled", which is
redundant. "iommu_enabled" is enough. And also removes useless global
variables qi_ctrl and ir_ctrl, which are not used at all.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2009-06-05 09:26:39 +01:00
Keir Fraser 840f3824a7 Intel VT-d: fix Stoakley boot issue with iommu=1
Signed-off-by: Weidong Han <Weidong.han@intel.com>
Signed-off-by: Allen Kay <allen.m.kay@intel.com>
2009-06-05 09:25:50 +01:00
Keir Fraser 8334041ac4 docs: Note that changelog is not up to date for Xen 3.4+
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-06-04 22:26:38 +01:00
Keir Fraser 183d02baf2 x86: hap dirty vram tracking
Currently HAP systems suffer a significant performance loss when a vnc
client is connect or the sdl interface is used, because HAP is lacking
an implementation of track_dirty_vram.
As a consequence qemu always tries to update the whole screen because
it does not know which areas of the screen have been updated by the
guest.

This patch implements track_dirty_vram for HAP enabling the logdirty
mechanism only in a specific gfn range and adding a
paging_log_dirty_range function that returns the log dirty bitmap in a
requested range.

Paging_log_dirty_range is different from paging_log_dirty_op because
operates on a range and also because it does not pause the domain. In
order not to lose any update I moved clean_dirty_bitmap at the
beginning of the function before evaluating the logdirty bitmap.
The bitmap is still safe because it is protected by the logdirty lock.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2009-06-04 22:25:10 +01:00
Keir Fraser 57d9503643 xm: Remove redundant os.waitpid() call from do_console()
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-06-04 10:57:39 +01:00
Keir Fraser 5f555eacb7 vtd: ia64 fix of intremap.c
19707:07cf79dfb59c caused compilation error on ia64.
This patch fixes it.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-06-04 10:48:45 +01:00
Keir Fraser e6e2645a53 xend: pci: only extract the exact pci BDFs
On some hosts:
[root@localhost ~]# ls /sys/bus/pci/devices/0000:00:05.0/
0000:00:05.0:pcie00  0000:05:00.0          class   driver  local_cpus
resource          subsystem_vendor
0000:00:05.0:pcie01  broken_parity_status  config  enable  modalias
subsystem         uevent
0000:00:05.0:pcie02  bus                   device  irq     power
subsystem_device  vendor

Here we should only get 0000:05:00.0, but we also get 0000:00:05.0
unexpectedly. With this patch, xend only extracts the exact BDF(s).

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-06-04 10:47:56 +01:00
Keir Fraser a161e0d852 xm: Don't die when trying to conect the console to short-lived domains
As observed by Mick Joran, if short-lived domain exits cleanly
then os.waitpid() will throw the following exception. This appears
to be because the child process that is used to start the domain
has detached from its parent.

OSError: [Errno 10] No child processes

Cc: Mick Jordan <Mick.Jordan@sun.com>
Signed-off-by: Simon Horman <horms@verge.ent.au>
2009-06-04 10:46:13 +01:00
Keir Fraser 45cb888069 blktap2: fix parallel Make.
sub make in tools/blktap2/daemon/lib and tools/lvd/lib
can be triggered many times at the same time which results in
weired link error because one target is linking a library while
another target is trying to recreate the library.

This patch makes it invoke submake only once.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2009-06-04 10:45:24 +01:00
Keir Fraser 57dde9ed01 xm: pass-through: sort the output of xm pci-list
Other than being arguably more human readable,
this patch reconciles the output differences between
using Xen API and xmlrpc to manipulate domains.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-04 10:43:44 +01:00
Keir Fraser 9a2e04d1d1 xend: pass-through: Use AUTO_PHP_SLOT as unknown vslot
This fixes a few cases where 0 is still used for an known vslot.

Signed-off-by: Simon Horman <horms@verge.net.au>
2009-06-04 10:43:20 +01:00