Commit Graph
24524 Commits
Author SHA1 Message Date
Andres Lagar-Cavilla cd00a203a5 Correct p2m unlocking during grant table map
We were not putting gfn's consistently.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-19 10:42:42 +00:00
Andres Lagar-Cavilla 9c5f0457b2 x86/mm: Don't ASSERT() for a valid mfn on paged p2m entries in guest_physmap_ad
Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-19 10:42:42 +00:00
Andres Lagar-Cavilla 3643a96119 x86/mm: Improve ring management for memory events. Do not lose guest events
This patch is an amalgamation of the work done by Olaf Hering <olaf@aepfle.de>
and our work.

It combines logic changes to simplify the memory event API, as well as
leveraging wait queues to deal with extreme conditions in which too many
events are generated by a guest vcpu.

In order to generate a new event, a slot in the ring is claimed. If a
guest vcpu is generating the event and there is no space, it is put on a
wait queue. If a foreign vcpu is generating the event and there is no
space, the vcpu is expected to retry its operation. If an error happens
later, the function returns the claimed slot via a cancel operation.

Thus, the API has only four calls: claim slot, cancel claimed slot, put
request in the ring, consume the response.

With all these mechanisms, no guest events are lost.
Our testing includes 1. ballooning down 512 MiBs; 2. using mem access n2rwx, in
which every page access in a four-vCPU guest results in an event, with no vCPU
pausing, and the four vCPUs touching all RAM. No guest events were lost in
either case, and qemu-dm had no mapping problems.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-19 10:38:47 +00:00
Jan Beulich a6ec974704 add NULL checks in code added by 24492:6c104b46ef89
Also a couple of missing is_hvm_domain() checks.

Further properly pass the PCI segment in a call to pci_get_pdev().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2012-01-19 10:08:12 +01:00
Paul Durrant 09923b7296 libxl: VM generation ID: Add missing gate for HVM domain.
This will fix localhost migrate failures found by the automatic tests.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-17 12:40:52 +00:00
Hui Lv 64908a0466 sched_credit: Use delay to control scheduling frequency
This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-17 11:18:48 +00:00
Dario Faggioli f7f025a9a6 Move IOMMU faults handling into softirq for VT-d.
Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-01-17 11:11:26 +00:00
Ian Campbell 6031949b0f libxl: drop vfs path -- fsback/front were deleted some time ago
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-16 17:56:07 +00:00
Ian Campbell e00ef46e17 ocaml: Correct ocaml type name for Aggregate types.
No change to the generated code because this path isn't used yet.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson.citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-10 16:19:09 +00:00
Wei Wang eae124c8f3 cleanup get_gfn_from_base_reg() function.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-16 16:36:15 +01:00
Jan Beulich 943da2282a fix compat header generation after 24503:86b8a1e3a419
At once also remove the duplicate forced inclusion of
public/xen-compat.h there (it's already done through cppflags-y) and
convert --include to the canonical -include in said c/s' adjustments
to CFLAGS-y and AFLAGS-y.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2012-01-16 09:55:05 +01:00
Dario Faggioli 3d4a6199ad sedf: remove useless tracing printk and harmonize comments style.
sched_sedf.c used o have its own mechanism for producing tracing-alike
kind of information (domain block, wakeup, etc.). Nowadays, with an
even not so high number of pCPUs/vCPUs, just trying to enable this
makes the serial console completely unusable, produces tons of very
hard to parse and interpreet logging and can easily livelock
Dom0. Moreover, pretty much the same result this is struggling to get
to, is better achieved by enabling the scheduler-related tracing
events, as it is for the other schedulers (say, credit or credit2).

For all these reasons, this removes that machinery completely. While
at it, check in some cosmetics that harmonize the comments withim
themself and with the rest of the code base.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2012-01-15 22:05:12 +00:00
Keir Fraser a2c9c2f9f0 x86: Make asmlinkage explicitly a no-op, and avoid usage in arch/x86
Signed-off-by: Keir Fraser <keir@xen.org>
2012-01-15 22:02:35 +00:00
Ian Jackson a54239be9a libxl: Fix leaks on context init failure
Several of the error exits from libxl_ctx_alloc leaked the context
struct itself and sometimes other resources too.

Fix this by using the standard "rc = ERROR_FOO; goto out" error
handling style throughout.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:27 +00:00
Ian Jackson 2fe29aed9d libxl: Provide more formal libxl__ctx_lock and _unlock
Previously the only official interface for the ctx lock was the
CTX_LOCK and CTX_UNLOCK convenience macros, which assume and use "ctx"
from the surrounding scope.

Instead, provide libxl__ctx_lock and _unlock functions which can be
used by these convenience macros, and other callers who have
nonstandard requirements.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:27 +00:00
Ian Jackson 8fc051a10f libxl: move a lot more includes into libxl_internal.h
Move a lot of
  #include <stdfoo.h>
from individual files into libxl_internal.h.  This helps avoid
portability mistakes where necessary system headers are omitted from
individual files, and is also of course a convenience when developing.

Also add
  #include "libxl_osdeps.h" /* must come before any other headers */
to the top of most libxl*.c files, so that anyone who adds any headers
before libxl_internal.h will put the in the right place.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:19 +00:00
Ian Jackson 3607a75236 xenstore: New function xs_path_is_subpath
This utility function compares two paths, textually and reports
whether one is a subpath (a child path) of the other.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:11 +00:00
Ian Jackson 50c5cd458d libxl: make LIBXL_INIT_GC a statement, not an initialiser
Previously LIBXL_INIT_GC was an initialiser, which you were expected
to use like this:
    libxl__gc gc = LIBXL_INIT_GC(ctx);

But we are going to want to put things in the gc which are to be
initialised using other macros.  That means that LIBXL_INIT_GC has to
become a statement too.  So instead, we make it so that it's used like this:
    libxl_gc gc;
    LIBXL_INIT_GC(gc,ctx);

In fact there are only a couple of callers now,
including GC_INIT which uses this trick:
    libxl_gc gc[1];
    LIBXL_INIT_GC(gc[0],ctx);

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:11 +00:00
Ian Jackson a474119259 .gitignore: ocaml: add xenlight.mli
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2012-01-13 16:54:09 +00:00
Jan Beulich 9f8aebe26c remove inclusion of asm/config.h
This was always bogus (xen/config.h should have been used instead) and
is superfluous now that xen/config.h gets included through the compiler
command line.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-13 08:34:57 +01:00
Jan Beulich 1e583ac49a force inclusion of xen/config.h through compiler option
As we expect all source files to include the header as the first thing
anyway, stop doing this by repeating the inclusion in each and every
source file (and in many headers), but rather enforce this uniformly
through the compiler command line.

As a first cleanup step, remove the explicit inclusion from all common
headers. Further cleanup can be done incrementally.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-13 08:33:31 +01:00
Jan Beulich bf86c81a81 libxl: fix build with make prior to 3.81
Up to 3.80, make only supported simple 'else' constructs, which got
violated by 24432:e0effa7c04f5.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-12 17:51:11 +00:00
Ian Jackson e46056227f .gitignore
Introduce a .gitignore file for the convenience of people who use git.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-12 16:45:21 +00:00
Tim Deegan e4dbfcfe9d x86/mm: Fix operator associativity bug in mm-locks.h
In an order-enforcing wrapper for an "external" recursive lock,
we aim to increment/decrement a recurse count and only update the
lock ordering on zero counts.

Unfortunately we incrementing/decrementing the pointer to the
recurse count, rather than the count itself.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-12 16:39:05 +00:00
Jan Beulich d80c482605 x86-64: globally use -mno-sse
This eliminates pointless prologue code from functions having variable
argument lists (since that way xmm registers can't possibly be passed).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-12 16:46:54 +01:00
Jan Beulich c7bd6f1e68 x86: properly define size_t
Having it defined unilaterally as 'unsigned long' got me surprised
recently when I tried to use the 'z' printk type modifier, as that is
expected by the compiler to be used only on the type it knows size_t
is supposed to have.

Generally the compiler provides a construct to do this, so use it when
available.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
2012-01-12 16:45:39 +01:00
Jan Beulich ac2dc37213 x86: move and fold certain type property definitions
Not only is it less code to have them consolidated, it also permits
their use virtually everywhere (since config.h is required to be
included everywhere. (Shouldn't we, btw, follow Linux and remove the
explicit inclusion in favor of command line enforced one?)

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-12 16:43:55 +01:00
Wei Wang 90ad72ce3e amd iommu: Enable FC bit in iommu host level PTE
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:54:28 +01:00
Wei Wang 5fe760c411 amd iommu: add ppr log processing into iommu interrupt handling
PPR log and event log share the same interrupt source. Interrupt
handler should check both of them.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:53:57 +01:00
Wei Wang 1106b11994 amd iommu: Enable guest level translation
Similar to nested paging for SVM, IOMMUv2 supports two level
translations for DMA. This patch enables this feature.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:53:20 +01:00
Wei Wang 716419c5b4 amd iommu: Enable ppr log
IOMMUv2 writes peripheral page service request (PPR) records into ppr
log to report guest OS pending DMA page requests from ATS devices.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:52:37 +01:00
Wei Wang 4547137c3e amd iommu: Add iommu emulation for hvm guest
ATS device driver that support PASID [1] and PRI [2] capabilites needs
to work with iommu driver in guest OS. We have to expose iommu
functionality to HVM guest, if we want assign ATS device to it. A new
hypervisor mmio handler is added to intercept iommu mmio accesses from
guest.

Signed-off-by: Wei Wang <wei.wang2@amd.com>

[1] http://www.pcisig.com/specifications/pciexpress/specifications/ECN-PASID-ATS-2011-03-31.pdf
[2] http://www.pcisig.com/members/downloads/specifications/iov/ats_r1.1_26Jan09.pdf
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:50:50 +01:00
Wei Wang 262bb227a4 amd iommu: Introduces new helper functions to simplify bitwise operations
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:49:34 +01:00
Wei Wang 7ec332ba83 amd iommu: Refactoring iommu ring buffer definition
Introduce struct ring_buffer to represent iommu cmd buffer, event log and ppr log

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-12 13:48:57 +01:00
Jan Beulich 88236844fc move declarations of some required per-arch functions into common headers
... since it is pointless to have each arch declare them on their own
(and now and the - see ia64 - forget to do so).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-12 13:45:47 +01:00
Jan Beulich 4563b03488 ia64: fix build (once again)
24423:069c08b7de46 failed to add a necessary include, and for a long
time kexec.h suffered from a missing structure forward declaration.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-01-12 13:44:51 +01:00
Andres Lagar-Cavilla 29dc2d984c x86/mm: Code style fixes in mem_sharing.c
No functional changes, only code style issues.

One small diff in mem_sharing_gref_to_gfn() looks like a logic change,
but it's not.  The flow was confusing, so it's been clarified.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-12 11:02:18 +00:00
Andres Lagar-Cavilla b0a5091ac9 x86/mm: Disable paging_prep
The only way to page-in a page is now the safe paging_load domctl.
(Unless the page was never paged out in the first place)

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-12 10:52:30 +00:00
Andres Lagar-Cavilla 6643f18e76 x86/mm: Allow a page in p2m_ram_paged_out state to be loaded
This removes the need for a page to be accessed in order to be pageable
again. A pager can now page-in pages at will with no need to map them
in a separate thread.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-01-12 10:52:30 +00:00
Wei, Gang 8254d9de11 x86: add a new SMP bring up way for tboot case
From: Wei, Gang <gang.wei@intel.com>

tboot may be trying to put APs waiting in MWAIT loops before launching
Xen. Xen could check the new flag field in v6 tboot shared page for the
hint. If TB_FLAG_AP_WAKE_SUPPORT bit in flag field is set, Xen BSP have
to write the monitored memory(g_tboot_shared->ap_wake_trigger) to bring
APs out of MWAIT loops. The sipi vector should be written in
g_tboot_shared->ap_wake_addr before waking up APs.

Signed-off-by: Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Gang Wei <gang.wei@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2012-01-11 10:34:45 +01:00
Olaf Hering e31a66a2b8 xenpaging: convert mem_event_t to struct mem_event
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-09 17:07:32 +01:00
Olaf Hering f08f1c8755 xenpaging: convert xenpaging_t to struct xenpaging
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-09 17:07:26 +01:00
Olaf Hering 98eda193b6 xenpaging: convert xenpaging_victim_t to struct victim
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-09 17:07:21 +01:00
Jan Beulich 0e6f8cfd47 xenpm: assorted adjustments
- use consistent error values (stop mixing of [positive] errno values
  with literal -E... ones)
- properly format output
- don't use leading zeros in decimal output
- move printing of average frequency into P-state conditional (rather
  than a C-state one)
- don't print some C-state related info when CPU idle management is
  disabled in the hypervisor
- use calloc() for array allocations that also got cleared via memset()
  so far

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-10 16:24:50 +00:00
Stefano Stabellini 004d103be6 docs: xl.pod.1: introduction to FLASK
Add a simple introduction to FLASK to the xl man page, at the beginning
of the FLASK chapter. Link to the xsm-flask.txt document.
Currently FLASK, TMEM and PCI PASS-THROUGH are defined as =head2 so they
look like sub-chapters of VIRTUAL DEVICE COMMANDS. Make them =head1.

Based on a text written by Daniel De Graaf.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-10 16:13:06 +00:00
Olaf Hering 17c9cd6d20 libxl: add feature flag to xenstore for XS_RESET_WATCHES
Tell guest about availibilty of xenstoreds XS_RESET_WATCHES function.
Guests can not issue this command unconditionally because some buggy
toolstacks (such as EC2) do not ignore unknown commands properly.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2012-01-05 19:40:40 +01:00
Daniel De Graaf fa1d65c22f flask/policy: add missing manage_domain rules
The updated example policy did not include rules to allow managing the
created domains (pause, unpause, destroy); allow these actions.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-10 16:04:26 +00:00
Daniel De Graaf ed6ec8137c docs: Update xsm-flask documentation
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2012-01-10 16:04:25 +00:00
Roger Pau Monne a69dda2bce blktap2/vhd: add -liconv when linking if using libiconv
If libiconv is detected on the system add -liconv when linking the
libvhd library.

If -liconv is not added when compiling libvhd with libiconv the
following error occours when linking vhd-util and vhd-update:

gcc     -o vhd-util vhd-util.o -Llib -lvhd
lib/libvhd.so: undefined reference to `libiconv_open'
lib/libvhd.so: undefined reference to `libiconv_close'
lib/libvhd.so: undefined reference to `libiconv'

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-12-20 08:31:40 +01:00
Roger Pau Monne 8ade3afcf0 build: detect if libiconv is present
Detect if libiconv is present in the system, since we will have to
link against it when using iconv.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2011-12-20 08:31:40 +01:00