Commit Graph
28483 Commits
Author SHA1 Message Date
Olaf Hering 8842e4869e stubdom: remove ia64 from stubdom
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-12 13:37:20 +00:00
Olaf Hering e54ce303aa docs: remove ia64 from tmem-internals.html
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-12 13:37:20 +00:00
Olaf Hering 3c37fe7daf docs: remove ia64 from kexec_and_kdump.txt
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-12 13:34:40 +00:00
Matthew Daley 96a4cfade3 tools: remove duplicate #includes
(From first party code; ie. not including tdb)

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-12 13:26:15 +00:00
Ian Campbell 8d9fa12c46 libxl: fix typo in comment
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-12 13:20:10 +00:00
Mukesh Rathor c30c544b19 pvh: call pit_init for pvh also
During halt of a pvh guest, the guest may do speaker shutdown. This
results in call to handle_speaker_io in xen. It will hang on the vpit
spin lock because it has not been initialized.
Since, pit_init is also called for both pv and hvm, the call is
moved to a more generic place.

Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2014-03-11 13:56:50 +01:00
Jan Beulich 819c084b29 x86/MTRR: optionally print boot time state
... helping diagnosing eventual issues. Taken from Linux, with quite
a bit of cleanup.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-11 13:55:50 +01:00
Jan Beulich 999f631759 x86/MTRR: consolidation
- use a single set of manifest constants (the ones from msr-index.h)
- drop unnecessary MSR index constants
- get hvm_msr_{read,write}_intercept() in line with the rest of the
  MTRR emulation code regarding the number of emulated MTRRs
- remove use of hardcoded numbers where expressions can be used (at
  once serving as documentation)
- centrally check mtrr_state.have_fixed in get_fixed_ranges(), making
  unnecessary the cpu_has_mtrr check in mtrr_save_fixed_ranges

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-11 13:53:38 +01:00
George Dunlap b630217a57 Add a "make rpmball" target
Build a simplistic dummy package, similar to "make debball", for
developers on rpm-based systems.

[ Fixed some trailing whitespace -iwj ]

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
CC: Ian Jackson <ian.jackson@citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Dario Faggioli <dario.faggioli@citrix.com>
CC: Olaf Hering <olaf@aepfle.de>
CC: Don Slutz <dslutz@verizon.com>
CC: M A Young <m.a.young@durham.ac.uk>
Tested-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2014-03-11 11:42:04 +00:00
Olaf Hering dda0b77d2c tools/libxc: pass errno to callers of xc_domain_save
Callers of xc_domain_save use errno to print diagnostics if the call
fails. But xc_domain_save does not preserve the actual errno in case of
a failure.

This change preserves errno in all cases where code jumps to the label
"out". In addition a new label "exit" is added to catch also code which
used to do just "return 1".

Now libxl_save_helper:complete can print the actual error string.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2014-03-11 11:37:10 +00:00
Olaf Hering d1eac8d14e tools/libxc: preserve errno in ERROR and DRINTF macros
This simplifies a changes made in a follow-up patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2014-03-11 11:37:06 +00:00
Andrew Cooper dd2ef9d50d tools/xcutils: Free xtl loggers after use
While not much of a functional change, this prevents irritating warnings from
valgrind when trying to analyse xc_domain_{save,restore}() themselves.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2014-03-10 17:19:11 +00:00
Andrew Cooper 0edbf95987 tools/ocaml: Ingore more OCaml test binaries
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: David Scott <dave.scott@eu.citrix.com>
Acked-by: David Scott <dave.scott@eu.citrix.com>
2014-03-10 17:00:03 +00:00
Olaf Hering 8a389b963f tools/libxc: assign positive values to errno
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2014-03-10 16:50:58 +00:00
Olaf Hering 269324ae07 tools/libxc: remove double inclusion of errno.h
xc_private.h includes errno.h already

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2014-03-10 16:50:17 +00:00
George Dunlap 6b6f6150d2 tools: Use --no-print-directory instead of grep for debball version
Save a fork, and also avoid :) being interpreted as a smiley.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2014-03-10 16:20:50 +00:00
Julien Grall ac2cba2901 xmalloc: handle correctly page allocation when align > size
When align is superior to size, we need to retrieve the order from
align during multiple page allocation. I guess it was the goal of the commit
fb034f42 "xmalloc: make close-to-PAGE_SIZE allocations more efficient".

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 14:40:50 +01:00
Daniel De Graaf 739c5ee78d xenstored: add --master-domid to support domain builder
When a domain builder stub domain is used, the initial xenstore
connection to domain 0 may use a different domain ID as the endpoint;
allow this domain ID to be specified on the command line.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
2014-03-10 12:13:50 +00:00
Ian Jackson 6bd73977e2 libxl: Add LIBXL_HAVE_DEVICE_PCI_SEIZE
This was part of
  [PATCH v2 2/2] xl: Add "seize" option to PCI devices
but I accidentally applied v1.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
2014-03-10 12:09:22 +00:00
George Dunlap e3df28fac3 xl: Add "seize" option to PCI devices
The "seize" option tells the toolstack to attempt to automatically
unbind devices and re-bind them to the pciback driver.  This should
make creating VMs that habitually use pass-through (such as driver domain
VMs and gaming VMs) easier to use and manage.

[Whitespace error fixed by iwj.]

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2014-03-10 12:03:59 +00:00
George Dunlap a8b558624b libxl: Fail domain creation if pci assignment fails
Actually pay attention to the return value of libxl__device_pci_add.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
2014-03-10 12:01:06 +00:00
Tim Deegan e3a379c35e x86/time: always count s_time from Xen boot
Timestamped printks() can call NOW() before init_xen_time().
Set a baseline TSC as soon as we've calibrated the TSC rate,
so that NOW() consistently counts from boot time.

Signed-off-by: Tim Deegan <tim@xen.org>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2014-03-10 11:18:49 +01:00
Andrew Cooper 7fb8e8b4e5 x86/schedule: remove noreturn from schedule_tail() function pointer
XenServer has recently had a support case where this bugframe in
context_switch() was hit, presumably from a corrupt function pointer as the
vcpu pointer was fine.

On balance, it is better to leave the bugframe around for peace of mind in
exceptional circumstances, than to use the optimisations provided by noreturn.

At any meaningful levels of optimisation, the noreturn causes the bugframe to
be optimised out, meaning that any exceptional returns fall into unlikely
branches, which will result in very weird behaviour.

The unreachable() in BUG() does the useful part of noreturn for us, allowing
the compiler not to mess about restoring stack frames etc, but causes a ud2
instruction to be present.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2014-03-10 11:18:05 +01:00
Len Brown bf15e5b64e x86/mwait_idle: support Intel Atom Processor C2000 product family
Support the "Intel(R) Atom(TM) Processor C2000 Product Family",
formerly code-named Avoton.  It is based on the next generation
Intel Atom processor architecture, formerly code-named Silvermont.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
2014-03-10 11:14:25 +01:00
Jan Beulich a9b87b3ccf x86/MCE: mctelem_init() cleanup
The function can be __init with its caller taking care of only calling
it on the BSP. And with that all its static variables can be dropped.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
Reviewed-by: Liu Jinsong <jinsong.liu@intel.com>
2014-03-10 11:12:30 +01:00
Andrew Cooper 4509ada6ba kexec: identify which cpu the kexec image is being executed on
A patch to this effect has been in XenServer for a little while, and has
proved to be a useful debugging point for servers which have different
behaviours depending when crashing on the non-bootstrap processor.

Moving the printk() from kexec_panic() to one_cpu_only() means that it will
only be printed for the cpu which wins the race along the kexec path.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
2014-03-10 11:11:28 +01:00
Jan Beulich a14a2db700 x86/HVM: adjust data definitions in mtrr.c
- use proper section attributes
- use initializers where possible
- clean up pat_type_2_pte_flags()

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 11:06:40 +01:00
Jan Beulich 9963a1aa03 x86/HVM: use manifest constants / enumerators for memory types
... instead of literal numbers, thus making it possible for the reader
to understand the code without having to look up the meaning of these
numbers.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 11:05:51 +01:00
Jan Beulich 3089a6d82b x86/HVM: consolidate passthrough handling in epte_get_entry_emt()
It is inconsistent to depend on iommu_enabled alone: For a guest
without devices passed through to it, it is of no concern whether the
IOMMU is enabled.

There's one rather special case to take care of: VMX code marks the
LAPIC access page as MMIO. The added assertion needs to take this into
consideration, and the subsequent handling of the direct MMIO case was
inconsistent too: That page would have been WB in the absence of an
IOMMU, but UC in the presence of it, while in fact the cachabilty of
this page is entirely unrelated to an IOMMU being in use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: "Xu, Dongxiao" <dongxiao.xu@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 11:04:36 +01:00
Jan Beulich b99113b9d5 x86/HVM: fix memory type merging in epte_get_entry_emt()
Using the minimum numeric value of guest and host specified memory
types is too simplistic - it works only correctly for a subset of
types. It is in particular the WT/WP combination that needs conversion
to UC if the two types conflict.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: "Xu, Dongxiao" <dongxiao.xu@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 11:03:53 +01:00
Dongxiao Xu cadfd7bca9 x86/hvm: refine the judgment on IDENT_PT for EMT
When trying to get the EPT EMT type, the judgment on
HVM_PARAM_IDENT_PT is not correct which always returns WB type if
the parameter is not set. Remove the related code.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>

We can't fully drop the dependency yet, but we should certainly avoid
overriding cases already properly handled. The reason for this is that
the guest setting up its MTRRs happens _after_ the EPT tables got
already constructed, and no code is in place to propagate this to the
EPT code. Without this check we're forcing the guest to run with all of
its memory uncachable until something happens to re-write every single
EPT entry. But of course this has to be just a temporary solution.

In the same spirit we should defer the "very early" (when the guest is
still being constructed and has no vCPU yet) override to the last
possible point.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: "Xu, Dongxiao" <dongxiao.xu@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-10 11:02:25 +01:00
Jan Beulich 4888ac5891 x86/shadow: add a clarifying assertion
... documenting that we don't have to worry about merging guest
provided flags with the ones we want to enforce ourselves.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
2014-03-06 13:10:14 +00:00
Jan Beulich db8d09f563 Revert "credit: change default timeslice to 5ms"
This reverts commit 348dee3b8a
(retracted by author/maintainer).
2014-03-06 13:44:42 +01:00
Konrad Rzeszutek Wilk 3f5c613287 tmem: drop a gross goto usage
No need to do it that way.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2014-03-06 12:23:25 +01:00
George Dunlap 348dee3b8a credit: change default timeslice to 5ms
The 30ms timeslice was chosen nearly a decade ago now, with cpu
"burning" workloads in mind.  In the mean time, processors have gotten
faster and VMEXITs have gotten faster.  A timeslice of 30ms has a
major cost when running latency-sensitive workloads like network or
audio streaming: getting caught behind just one or two other VMs can
introduce a processing delay of up to 60ms, and the "round-robin"
nature of the credit scheduler means this delay may be introduced
every time the VM yields for periods of time.

The XenServer performance team at Citrix have done extensive testing
with various timeslices, including 30ms, 10ms, 5ms, and 2ms.  None of
the workloads exhibited any performance degradation with a 5ms
timeslice.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
2014-03-06 12:19:39 +01:00
Tim Deegan 891219a9d3 x86/hvm: assert that we we saved a sane number of MSRs.
Just as a backstop measure against later changes that add MSRs to the
save function without updating the count in the init function.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2014-03-06 10:13:30 +00:00
Tim Deegan bd1913d873 bitmaps/bitops: Clarify tests for small constant size.
No semantic changes, just makes the control flow a bit clearer.

I was looking at this bcause the (-!__builtin_constant_p(x) | x__)
formula is too clever for Coverity, but in fact it always takes me a
minute or two to understand it too. :)

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
2014-03-06 10:13:12 +00:00
Tim Deegan c66713c93c x86/mem_sharing: drop unused variable.
Coverity CID 1087198

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
2014-03-06 10:13:07 +00:00
Tim Deegan 985cd75eea x86/shadow: Drop shadow_mode_trap_reads()
This was never actually implemented, and is confusing coverity.

Coverity CID 1090354

Signed-off-by: Tim Deegan <tim@xen.org>
2014-03-06 10:12:57 +00:00
Tim Deegan 034a5199c6 common/vsprintf: Explicitly treat negative lengths as 'unlimited'
The old code relied on implictly casting negative numbers to size_t
making a very large limit, which was correct but non-obvious.

Coverity CID 1128575

Signed-off-by: Tim Deegan <tim@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-06 10:12:38 +00:00
Andrew Cooper ceff76a5be x86: identify reset_stack_and_jump() as noreturn
reset_stack_and_jump() is actually a macro, but can effectivly become noreturn
by giving it an unreachable() declaration.

Propagate the 'noreturn-ness' up through the direct and indirect callers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:19:20 +01:00
Andrew Cooper f600b324bc misc cleanup as a result of the previous patches
This includes:
 * A stale comment in sh_skip_sync()
 * A dead for ever loop in __bug()
 * A prototype for machine_power_off() which unimplemented in any architecture
 * Replacing a for(;;); loop with unreachable()

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:18:28 +01:00
Andrew Cooper 4b2ae19ef1 identify panic and reboot/halt functions as noreturn
On an x86 build (GCC Debian 4.7.2-5), this substantially reduces the size of
.text and .init.text sections.

Experimentally, even in a non-debug build, GCC uses `call` rather than `jmp`
so there should be no impact on any stack trace generation.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:17:03 +01:00
Andrew Cooper 0a1082e8fd compiler: replace opencoded __attribute__((noreturn))
Make a formal define for noreturn in compiler.h, and fix up opencoded uses of
__attribute__((noreturn)).  This includes removing redundant uses with
function definitions which have a public declaration.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:15:47 +01:00
Andrew Cooper 8179247eae x86/crash: fix up declaration of do_nmi_crash()
... so it can correctly be annotated as noreturn.  Move the declaration of
nmi_crash() to be effectively private in crash.c

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:14:53 +01:00
Jan Beulich 7e90098916 include: parallelize compat/xlat.h generation
Splitting this up into pieces signficantly speeds up building on multi-
CPU systems when making use of make's -j option.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:03:13 +01:00
Jan Beulich 3cdb47bcf2 correctly use gcc's -x option
In Linux the improper use was found to cause problems with certain
distributed build environments. Even if not directly affecting us, be
on the safe side.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:01:57 +01:00
Jan Beulich 7acf827b95 x86/ACPI: also print address space for PM1x fields
At least one vendor is in the process of making systems available where
these live in MMIO, not in I/O port space.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 11:00:26 +01:00
Jan Beulich 658a736299 x86/AMD: re-use function wide variables in init_amd()
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2014-03-04 10:59:44 +01:00
Jan Beulich 8db22866db x86: don't propagate acpi_skip_timer_override do Dom0
It's unclear why c/s 4850:923dd9975981 added this - Dom0 isn't
controlling the timer interrupt, and hence has no need to know.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2014-03-04 10:58:19 +01:00