Commit Graph
20037 Commits
Author SHA1 Message Date
Keir Fraser 22d91502ea xend: Rename device backend value when xm save/migrate
The Xend has a problem that it often fails to restore/migrate
a PV domain whose device backends are partly a driver domain.

Because a checkpoint of the PV domain has device backend value as
domain id, you can restore/migrate the PV domain only when a driver
domain is the same id as device backend value in the checkpoint.

I attached a patch to fix it by renaming device backend value in a
checkpoint from domain id to domain name when xm save/migrate.

This patch doesn't rename device backend value if the value is 0,
which is Domain-0, so the checkpoint format is compatible if you use
only Domain-0 as device backend.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
2009-08-07 17:22:04 +01:00
Keir Fraser b1b6362f10 x86_emulate: Fixes for 'mov rm16,sreg'
1. Memory reads should be 16 bits only
2. Attempt to load %cs should result in #UD

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-07 10:53:22 +01:00
Keir Fraser 26fd181703 x86_emulate: protmode_load_seg() cannot load system segments in long mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-07 09:54:43 +01:00
Keir Fraser 990e56e3ec hvmloader: Regression tests need 16MB to run. Check for this.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-06 11:14:48 +01:00
Keir Fraser 38ee492948 ept: code clean up and formatting.
Fix alignment and comments and add and remove spaces and lines where
appropriate.

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-08-06 10:02:20 +01:00
Keir Fraser 0297087090 x86_emulate: Remove cmpxchg retry loop from protmode_load_seg().
It is safer to retry in a loop via the caller.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-06 09:54:22 +01:00
Keir Fraser 94df1707a3 tmem: Remove bogus variable decl, fixing build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-06 09:53:37 +01:00
Keir Fraser 734a7f6677 tmem: save/restore/migrate/livemigrate and shared pool authentication
Attached patch implements save/restore/migration/livemigration
for transcendent memory ("tmem").  Without this patch, domains
using tmem may in some cases lose data when doing save/restore
or migrate/livemigrate.  Also included in this patch is
support for a new (privileged) hypercall for authorizing
domains to share pools; this provides the foundation to
accomodate upstream linux requests for security for shared
pools.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-06 09:19:55 +01:00
Keir Fraser 70fc2398f0 ept mtrr: replace unsigned long with mfn_t for mfns.
Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-08-06 09:15:42 +01:00
Keir Fraser 376235d7ce ept p2m: replace unsigned long with mfn_t for mfns.
Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-08-06 09:15:24 +01:00
Keir Fraser df30f28749 ept p2m: set rwx flags to 0 for invalid and mmio_dm types.
Read/write/execute flags are set to 1 before calling the type_to_flags
function which sets them to their appropriate values depending on the
p2m type. However, in invalid, mmio_dm, and default/unknown cases in
type_to_flags just falls through, unsafely leaving full access to
these pages.

Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
2009-08-06 09:14:52 +01:00
Keir Fraser 3c11d89e35 Revert 20006:edf21ab7d7a4 and 20023:2b28320c6f8c. 2009-08-05 14:56:29 +01:00
Keir Fraser 80ae271d20 Revert to pulling QEMU GIT repo via HTTP.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-05 14:39:46 +01:00
Keir Fraser 41f4eefa05 xend: Remove _setSchedParams
Currently, xc.sched_credit_domain_set is called twice when domains
are created.

start@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _initDomain
    _setSchedParams
      domain_sched_credit_set
        xc.sched_credit_domain_set  --- 2nd

resume@XendDomainInfo
  _constructDomain
    xc.sched_credit_domain_set  --- 1st
  _setSchedParams
    domain_sched_credit_set
      xc.sched_credit_domain_set  --- 2nd

This patch removes _setSchedParams method added by changeset 19955,
because xc.sched_credit_domain_set was added into _constructDomain
method by changeset 20006.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2009-08-05 14:03:38 +01:00
Keir Fraser 77ec53b686 x86 vmx: Accelerate VLAPIC EOI writes
Our testing indicates that most apic accesses are eoi writes. This
patch accelerate guest EOI emulation utilizing HW VM Exit
information.

Without this patch, xentrace shows the apci access average tsc costs
is ~7.8k in our case and it down to ~3k with it. We also save 3% cpu
in our case.

From: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-05 14:02:46 +01:00
Keir Fraser 0d22c8d92c x86: CPU synchronization while doing MTRR register update
The current Xen code does not synchronize all the cpus while
initializing MTRR registers when a cpu comes up.=20

As per IA32 SDM vol 3: Section: 10.11.8 MTRR Considerations in MP
Systems, all the processors should be synchronized while updating
MTRRs.

Processors starting with westmere are caching VMCS data for better VMX
performance. These processors also has Hyper-threading support. With
hyper-threading, when one thread's cache is disabled, it also disables
cache for the sibling threads. And MTRR register updating procedure
involves cache disabling. So if cpus are not synchronized, updating
MTRR registers on a thread, results in the VMCS data from sibling
threads becoming inaccessible, and it causes system failure.

With this patch while updating the MTRR registers, all the cpus are
synchronized as per the IA32 SDM. Also at the boot time and resume
time when multiple cpus are brought up, an optimization is added to
delay the MTRR initialization until all the cpus are up, to avoid
multiple times cpu synchronization.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: Suresh B Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Asit K Mallick <asit.k.mallick@intel.com>
2009-08-05 13:50:36 +01:00
Keir Fraser 37455c3436 x86: Enable GNTTABOP_copy hypercall for HVMs
This requires plumbing 32-bit compat guests through the compat version
of teh grant-table hypercall.

Signed-off-by: Jayaraman, Bhaskar <Bhaskar.Jayaraman@lsi.com>
2009-08-05 13:49:35 +01:00
Keir Fraser 4eecae4a4e xm-test restore: use ext3 (instead of ext2) and xvda (instead of hda)
This patch fixes the xm-test restore 04 testcase:
o uses ext3 instead of ext2 - which is not supported by the standard
kernel config
o uses xvdX instead of hdX for disks

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:40:21 +01:00
Keir Fraser 53fd4502a1 xm-test: Disable DEBUG_STACK_USAGE which breaks test cases
The unnecessary 'used greatest stack depth' messages on the console
breaks xm-test cases by random.  Typically a testcase reads input from
the console and parses it.  When DEBUG_STACK_USAGE is enabled, these
stack usage messages are printed by random - the test case reads this
message, cannot handle it and fails.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:39:37 +01:00
Keir Fraser 5239cb1be7 xm-test: fix network13 test (protocol and extensions)
Attached there is a patch that fixes the used protocol (was udp - but
nobody was listening...) to icmp echo and added the extension, that
the dom0 and the other guest ips are also pinged.
Because of the many different scenarios (three nested loops) over
packet sizes, two guests and different ip addresses, one run of this
test case takes now about 4.5 minutes.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:38:38 +01:00
Keir Fraser ccb359dbfc xm-test: Adapt memory setting to up-to-date kernel memory consumption
The attached patch fixes xm-test memset 04 that it can be used with up
to date kernels.  The old version sets the memory to 15MByte which is
too low for modern kernels: the oom-killer in this case kills the
login shell of the test-case and init.  Increased the size to 18M
which gives the userspace about 2.5 MByte memory.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:37:26 +01:00
Keir Fraser f0e70fe598 xm-test: 10_block_attach_detach_multiple_devices fixed
This patch fixes and (re-)enables test 10 of the block-create suite.
The tests by random attach and detach devices to / from a domU and
checks if everything is ok.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 13:36:24 +01:00
Keir Fraser efc6741a48 xm-test block-create: use ext3 as filesystem
The current implementation uses ext2 for tests.  The tests currently
fail, because the current kernel does not support ext2 by default.
This patch creates an ext3 filesystem for the tests.


Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-05 12:06:24 +01:00
Keir Fraser f275a935a2 xend: fix memory leak resulting in long garbage collector runs
In the method xen.xend.XendStateStore.XendStateStore.load_state and
xen.xend.XendStateStore.XendStateStore.save_state the minidom objects
used to load/save the current state of a device type, can't be freed
by the python garbage collector after all references to the top node
are cleared, because of cyclic references between the DOM nodes. So
memory usage of xend increases after calling these methods.  To solve
this problem, the unlink() method must be called for a minidom object
before the last reference to the top node is cleared (see python
docs). This breaks the cyclic references, so the garbage collector can
free these objects.

Signed-off-by: juergen.gross@ts.fujitsu.com
2009-08-05 12:04:39 +01:00
Keir Fraser ce09aeeba7 xend: pass-through: Extend multi-function mapping
This extends the mapping between physical and virtual PCI functions
for multi-function pass-through in two ways. If neither of these
rules apply the existing identity-mapping of physical to virtual
functions is used.

1) If physical function zero is not present in a multi-function
   pass-through device then the numerically lowest physical function
   whose virtual function hasn't explicitly been set will be mapped
   to virtual function 0.

   This is to satisfy the requirement that a (virtual) device
   must always have function 0 present.

2) The virtual function to be used for a physical function may
   be explicitly set.

   e.g. 00:1d.2=3D0,1=3D1,0=3D2@7 will result in the following
   mapping:

        physical | virtual
        ---------+--------
        00:1d.2  | 00:07.0
        00:1d.1  | 00:07.1
        00:1d.0  | 00:07.2

   Ranges may also be used with explicit assignment.
   The following would result in the same mapping as above:

       00:1d.2=3D0-0=3D2@7

Please be aware that it is very likely that using these extensions
it is possible to create mappings that do not work. If in doubt
please use identity-mapping.

Cc: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
2009-08-05 12:03:53 +01:00
Keir Fraser bc60687a50 xend: passthrough: add checking when a device is hotplugged into pv guest.
When we 'xm pci-attach' device into pv guest, we also need to check if
the device is owned by pciback or pci-stub, if the device has been
assigned, etc.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-05 12:03:08 +01:00
Keir Fraser 2d986e611f Add a single trigger for all diagnostic keyhandlers
Add a new keyhandler that triggers all the side-effect-free
keyhandlers.  This lets automated tests (and users) log the full set
of keyhandlers without having to be aware of which ones might reboot
the host.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-02 13:43:15 +01:00
Keir Fraser 91baae515e Make ACPI Cx keyhandler always print something
...so that from a serial log you can tell the difference between not
pressing the key and not having anything interestying to print.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-08-02 12:29:25 +01:00
Keir Fraser 18a76bf453 xend: pci: Use PCIe FLR for VF of Intel 82599 10GbE Controller
We know it does have PCIe FLR capability even if it doesn't report
that.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-02 12:28:22 +01:00
Keir Fraser 2cdf870d54 xend: passthrough: loosen the pci co-assignment for pv guest
In current xend, we can not assign co-assignment devices to different
guests, even for pv guests. This patch loosens the policy for pv
guest: if none of the co-assignment devices have been assigned to hvm
guest, we can assign the devices to different pv guests.

The patch also adds a detection: if a device has been assigned to
guest, we can't try to "xm pci-attach" it to the same guest again.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-08-02 12:27:51 +01:00
Keir Fraser 2707e9adc1 xend: save/restore cpu_weight and cpu_cap
This patch allows vcpus_params cpu_weight and cpu_cap to be saved and
restored.  Most the code to support this already existed, but the save
path needed to be updated to explicitly save these params, and the
restore path needed to be updated to resend the params down to the
kernel.

From: Andrew Jones <drjones@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-02 12:26:23 +01:00
Keir Fraser 3bdedbcbc0 Compile the kernel by default with bridge support
This one-liner adds bridge support to the Linux kernel
(CONFIG_BRIDGE=y).  It is a precondition for some xm-tests that
bridge is enabled.  Also IMHO it makes sense to configure a dom0 with
bridge capabilities.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-02 12:25:01 +01:00
Keir Fraser f289595214 xm-test: ramdisk fs type is changed to ext3 if needed
This (one line) patch changes the type of the xm-test initrd from ext2
to ext3 when needed.  It first checks, if ext2 support is missing and
ext3 support is available.  If so the fs type is changed to ext3.

Signed-off-by: Andreas Florath <xen@flonatel.org>
2009-08-02 12:23:46 +01:00
Keir Fraser 00ee63bf97 tools/tests/regression/: Fix some paths and scripts.
o scripts and Makefile are mostly location independent now
  (exception XEN_ROOT in Makefile)
o use of $() instead of ${} in Makefile

From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <Keir.Fraser@eu.citrix.com>
2009-08-02 12:22:03 +01:00
Keir Fraser 109cae48ec i386: fix full-value calculation of wrmsr handling for pv guests
The MSR value must be held in a 64-bit variable, not an unsigned long.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-30 17:56:23 +01:00
Keir Fraser 41859f6925 xm-test: Fix memset 01 and 02 tests: add support for sysfs memory interface
From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-29 09:20:46 +01:00
Keir Fraser d0c233bbf8 xend: pci: fix a typo in do_Dstate_transition
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-29 09:19:30 +01:00
Keir Fraser d1c98f05a1 xend: pass-through Use pci_dict_to_bdf_str() in hvm_pci_device_create()
* Use pci_dict_to_bdf_str() in hvm_pci_device_create()
* Use pci_name instead of pci_str in error message, pci_str does not
* exist

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-29 09:19:13 +01:00
Keir Fraser 887dbf4a5c ns16550: check_existence() can be marked __init
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-28 16:48:06 +01:00
Keir Fraser 060cc4dbc7 ns16550: More robust check for presence of FIFO
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-07-28 16:47:37 +01:00
Keir Fraser 00f0eadc52 xend: make a crash dump directory per DomU
Currently, xend dumps a core file of a DomU
in the directory "/var/xen/dump/", when the DomU has crashed.

The patch modifies this directory to "/var/xen/dump/<domain name>/".

It enables you to select HDD partition per DomU to dump core by using
mount command.

Signed-off-by: Rikiya Ayukawa <ayukawa.rikiya@jp.fujitsu.com>
2009-07-28 16:43:50 +01:00
Keir Fraser fb4a420c9b xend: pass-through: fix "xm pci-list-assignable-devices' for pv_guest
xc.test_assign_device(dev) can only tell us if dev is assigned to hvm
guest; if a device is assigned to pv guest, xc.test_assign_device()
still tells us the device is not assigned yet, as a result, the device
still appears in the output of "xm pci-list-assignable-devices", and
xend would not prevent us from assigning the device to a new pv or hvm
guest.

To judge if a device has been assigned to guest, we have to scan
xenstore.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-28 16:42:12 +01:00
Keir Fraser 0a8f3082f6 xend: pass-through: fix pci passthrough for pv guest
C/S 19754: a5f584c1e2f6 breaks pci passthrough for pv guest.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
2009-07-28 16:41:13 +01:00
Keir Fraser aee7151ee7 x86,hvm: clean up vpt's period_cycles field
In struct periodic_time, pt->period_cycles is not cpu cycles since c/s
17716 and its value is always the same as pt->period.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-07-28 16:40:34 +01:00
Keir Fraser 59efc1880b tools/tests: Add syntax check for different versions of python
From: Andreas Florath <xen@flonatel.org>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-28 16:38:08 +01:00
Keir Fraser d7de9aa5e8 x86: Initialize the ACPI "safe" power state to C1.
Initialize the ACPI "safe" power state to C1.  This avoids a null
dereference on BIOS tables which define C3 but not C2 or C1.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-07-28 16:34:16 +01:00
Keir Fraser 54b4e4c5df xend: fix migration hangs by closing fds on exec
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Reviewed-by: Xiaowei Hu <xiaowei.hu@oracle.com>
2009-07-28 16:33:46 +01:00
Keir Fraser dd512dd1e2 xend: pass-through: device state in xenstore may be null
Signed-off-by: Tom Rotenberg <tom.rotenberg@gmail.com>
2009-07-28 16:32:26 +01:00
Keir Fraser 7ee1d0108a passthrough: use tasklet to deliver interrupts
This patch enables delivery of interrupts even if the VCPU#0 is
halted.

Note: the changes to softirq.{ch} are needed for ia64 build.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2009-07-28 16:28:21 +01:00
Keir Fraser c88235741e hvm vlapic: Fix vlapic_write() for partial register writes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-07-28 16:24:47 +01:00