Commit Graph
20061 Commits
Author SHA1 Message Date
Keir Fraser bb78251301 x86 mce: make debug messages less noisy
On guest MCE read only print debug code when
a non-zero value has been read. Xen is too
noisy, otherwise.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-08-14 10:59:13 +01:00
Keir Fraser a569ec6147 VMX: issue an NMI rather than just calling the NMI handler
when the VMEXIT code indicates that an NMI has been raised.
Otherwise we might hit a real NMI while in the handler.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
2009-08-14 10:58:32 +01:00
Keir Fraser 3ad8ef6026 hvm: handle access to MSR_AMD64_NB_CFG
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-08-14 10:57:24 +01:00
Keir Fraser e49d3624a1 x86: Remove EF_* duplicate defs for X86_EFLAGS_*.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-14 08:36:12 +01:00
Keir Fraser f2bb9f1b6e x86: Do not clear EF.TF in crash-debug mode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-14 08:22:34 +01:00
Keir Fraser dfa275f7d9 gdbstub: Fix the build and make a few cleanups.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-13 08:40:39 +01:00
Keir Fraser 91c2518a67 gdbstub: Small fixes.
* Correctly handly EFLAGS.TF in the hypervisor
 * Register value sent with 'P' command is in native byte order.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-12 14:27:52 +01:00
Keir Fraser 2606d3eec6 x86 numa: fix nodes' memory parsing when SRAT table includes future-hotplug memory range
A node's future-hotplug memory range starts from very high end
normally, e.g. 1TB, and is not continuous with its current existing
memory range. It should not be covered by the global variable 'nodes'
as it assumes the node's memory is continuous. Otherwise it can make
nodes' memory ranges become very big and overlapped, and
populate_memnodemap() fails.

We can ignore future-hotplug memory range for now. Physical memory
hotplug support in future will handle it.

Signed-off-by: Yang Xiaowei <xiaowei.yang@intel.com>
2009-08-12 14:16:09 +01:00
Keir Fraser 6ebb9d5ec8 x86 svm: Fix PAT MSR handling when using Nested Paging.
Accesses to the MSR should not be intercepted.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-12 14:13:54 +01:00
Keir Fraser c68a76632a x86 svm: Fix the build: vlapic_get_reg() takes two arguments.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-12 14:13:00 +01:00
Keir Fraser 99e7db68f3 tmem: one-liner correcting stat parsing ordering
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-12 14:06:30 +01:00
Keir Fraser ed53f19568 x86 svm: Fix checked builds of Windows running on AMD SVM
Checked builds of Windows will, after every modification of the TPR,
read it back again and assert that the value read back matches with
the value written, including the priority sub-class.  Make sure that
we correctly preserve it on vmexit.

As far as I can tell from reading the documentation, the sub-class
doesn't actually do anything, so this should be pretty harmless.

Signed-off-by: Steven Smith <steven.smith@eu.citrix.com>
2009-08-12 14:06:01 +01:00
Keir Fraser 87b8f65a96 xentrace: fix "%016x" format
xentrace_format cannot use "0x016x" format as we expect.
It show only %(N) as "0x016x" format, not as "%(N+1)08x%(N)08x".
So I fixed tools/xentrace/formats by using "%(N+1)08x%(N)08x" format.
Also I added some TRC_PV entries.

Signed-off-by: Akio Takebe <takebe_akio@jp.fujitsu.com>
2009-08-11 07:36:26 +01:00
Keir Fraser 7784c384a0 libxc: Include private Xen headers in stubdom libxc build
The headers libelf.h and elfstructs.h were removed from
xen/include/public in 19011:7df072566b8c.  But this broke the stubdom
build because parts of libxc depend on them.  This patch adds
$(XEN_ROOT)/xen/include/xen to the stubdom -I path.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
2009-08-11 07:34:55 +01:00
Keir Fraser 8adf4754dd Update QEMU_TAG to a83d119cfcc20bc7edb427992d6e31b3e99430be 2009-08-10 18:15:19 +01:00
Keir Fraser c89a659a35 Revert alloc_idle_vcpu() to support multiple idle domains where max
vcpus is less than max pcpus (e.g., can happen on i386).

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-10 13:51:28 +01:00
Keir Fraser 4d60f70295 x86: make mce debug output more verbose
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-08-10 13:33:01 +01:00
Keir Fraser 6865a2d6b6 x86: Remove cpumask.h inclusion from mm.h
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-10 13:32:02 +01:00
Keir Fraser f78a13d5e9 pygrub: Remove bogus log.debug line.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-10 13:30:50 +01:00
Keir Fraser 81d70f1a53 tmem: expose freeable memory
Expose tmem "freeable" memory for use by management tools.

Management tools looking for a machine with available
memory often look at free_memory to determine if there
is enough physical memory to house a new or migrating
guest.  Since tmem absorbs much or all free memory,
and since "ephemeral" tmem memory can be synchronously
freed, management tools need more data -- not only how
much memory is "free" but also how much memory is
"freeable" by tmem if tmem is told (via an already
existing tmem hypercall) to relinquish freeable memory.
This patch provides that extra piece of data (in MB).

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
2009-08-10 13:27:54 +01:00
Keir Fraser 37541c4165 tools: Fix iptables failure test in vif-common.sh
In changset 19540 a bug was introduced in the fib_iptable function in
vif-common.sh that incorrectly checks the exit status of iptables --
it always believes iptables has failed even when it hasn't.

The attached patch fixes that.  It's also bug 1490.

Signed-off-by: John Haxby <john.haxby@oracle.com>
2009-08-07 17:31:27 +01:00
Keir Fraser bd53bc404f x86: replace PAT initialisation magic value with a #define
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2009-08-07 17:30:33 +01:00
Keir Fraser b37f409100 x86: Increase default max CPUs to 64.
Also remove compile-time limit of 32 for i386. It is no longer
required, since a cpumask was moved out of struct page_info.

Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2009-08-07 17:29:50 +01:00
Keir Fraser c805aed275 x86 p2m: use common p2m ops in common p2m code path
We found recently there was an assertion failure when EPT mode is
enabled on 32PAE host when debug=y is used. The patch attached fixes
that. It uses the common p2m ops in the
common p2m code path p2m_remove_page rather than calling
p2m_gfn_to_mfn() for only shadow mode.

Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com>
2009-08-07 17:23:11 +01:00
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