Commit Graph
26223 Commits
Author SHA1 Message Date
Ian Campbell 3b62c033e1 arm: handle xenheap which isn't at the start of RAM.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-30 12:20:22 +00:00
Ian Campbell c7bfd04da6 arm: create a raw binary target.
This is suitable for direct loading by a bootloader.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-30 12:20:22 +00:00
Ian Campbell 635283fdf7 arm: Enable build without CONFIG_DTB_FILE
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-30 12:20:21 +00:00
Jan Beulich c759fee45b AMD IOMMU: add locking missing from c/s 26198:ba90ecb0231f
An oversight of mine; I'm sorry.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-30 11:42:55 +01:00
Wei Liu c1df7c6ab6 Add gtags and tags rune in gitignore.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:43:29 +00:00
Andrew Cooper 6736a35717 minios/console: console_input() weak reference
In exactly the same style as app_main() in kernel.c, create a weak
reference console_input() function for applications to override to
quickly gain access to the console.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:37:13 +00:00
Samuel Thibault 5088edf797 [minios] Add xenbus shutdown control support
Add a thread watching the xenbus shutdown control path and notifies a
wait queue.

Add HYPERVISOR_shutdown convenient inline for minios shutdown.

Add proper shutdown to the minios test application.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:32:27 +00:00
Samuel Thibault e71632467f [minios] Fix test application link when pcifront is not enabled
When pcifront is not enabled, the test application needs to disable
the PCI test.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:31:58 +00:00
Dongxiao Xu 4e4a50e01d nested vmx: enable load IA32_PERF_GLOBAL_CTRL feature for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:26:30 +00:00
Dongxiao Xu dbfe3d92be nested vmx: enable load and save IA32_EFER feature for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:26:01 +00:00
Dongxiao Xu ddabf83d68 nested vmx: enable load and save IA32_PAT feature for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:25:34 +00:00
Dongxiao Xu 38cc1a6f2f nested vmx: enable save VMX-preemption timer feature for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:25:09 +00:00
Dongxiao Xu 3e0789e55a nested vmx: enable VMX-preemption timer for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:24:17 +00:00
Dongxiao Xu d2bddeb9d5 nested vmx: enable Descriptor-table exiting for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:23:57 +00:00
Dongxiao Xu 6034456b6f nested vmx: enable secondary processor-based VM-Execution controls
Enable secondary processor-based control in VMCS

Besides that, add a helper function to get the certain control bit
in secondary processor-based control MSR.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:23:22 +00:00
Dongxiao Xu e360bf74be nested vmx: enable NMI-window exiting for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:22:51 +00:00
Dongxiao Xu 578c0a2b7c nested vmx: enable Monitor Trap Flag for L1 VMM
Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
2012-11-30 09:22:08 +00:00
Roger Pau Monne 8e37959473 docs: fix persistent grants doc typo
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- fix additional typo s/this grants/these grants/g ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-29 11:28:18 +00:00
Stefano Stabellini 8b7dd43d82 xen/arm: build as zImage
The zImage format is extremely simple: it only consists of a magic
number and 2 addresses in a specific position (see
http://www.simtec.co.uk/products/SWLINUX/files/booting_article.html#d0e309).

Some bootloaders expect a zImage; considering that it doesn't cost us
much to build Xen compatible with the format, make it so.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- switch from 7*nop + nop to just 8*nop ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-29 11:28:17 +00:00
Tim Deegan 6c4f04c033 x86/hap: Fix memory leak of domain->arch.hvm_domain.dirty_vram
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-11-29 11:01:00 +00:00
Tim Deegan 9f1cbc3346 x86/mm: Comment the definitions of _mfn(), _gfn() &c.
It's not very easy to find them if you don't know to look for the
TYPE_SAFE() macro.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2012-11-29 10:49:53 +00:00
Jan Beulich 239168fe98 VT-d: make scope parsing code type safe
Rather than requiring the scopes to be the first members of their
respective structures (so that casts can be used to switch between the
different views), properly use types and container_of().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by Xiantao Zhang <xiantao.zhang@intel.com>
2012-11-29 09:14:55 +01:00
Jan Beulich 253d59d0fe IOMMU: imply "verbose" from "debug"
I think that generally enabling debugging code without also enabling
verbose output is rather pointless; if someone really wants this, they
can always pass e.g. "iommu=debug,no-verbose".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 17:00:56 +01:00
Jan Beulich d9d2cfd5ae VT-d: adjust IOMMU interrupt affinities when all CPUs are online
Since these interrupts get setup before APs get brought online, their
affinities naturally could only ever point to CPU 0 alone so far.
Adjust this to include potentially multiple CPUs in the target mask
(when running in one of the cluster modes), and take into account NUMA
information (to handle the interrupts on a CPU on the node where the
respective IOMMU is).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:08:24 +01:00
Jan Beulich 899110e3f6 AMD IOMMU: include IOMMU interrupt information in 'M' debug key output
Note that this also adds a few pieces missing from c/s
25903:5e4a00b4114c (relevant only when the PCI MSI mask bit is
supported by an IOMMU, which apparently isn't the case for existing
implementations).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:07:11 +01:00
Jan Beulich 13d6f7b55a VT-d: include IOMMU interrupt information in 'M' debug key output
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:05:52 +01:00
Jan Beulich 9a61ad6750 ACPI: fix return value of XEN_PM_PDC platform op
Should return -EFAULT when copying to guest memory fails.

Once touching this code, also switch to using the more relaxed copy
function (copying from the same guest memory already validated the
virtual address range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:03:51 +01:00
Jan Beulich 79ea67d7a7 x86: fix hypercall continuation cancellation in XENMAPSPACE_gmfn_range compat wrapper
When no continuation was established, there must also not be an attempt
to cancel it - hypercall_cancel_continuation(), in the non-HVM, non-
multicall case, adjusts the guest mode return address in a way assuming
that an earlier call hypercall_create_continuation() took place.

Once touching this code, also restructure it slightly to improve
readability and switch to using the more relaxed copy function (copying
from the same guest memory already validated the virtual address
range).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:02:26 +01:00
Jan Beulich 03f22f0070 README: adjust gcc version requirement
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-28 10:01:33 +01:00
George Dunlap c3556e2a1a libxl: Fix bug in libxl_cdrom_insert, make more robust against bad xenstore data
libxl_cdrom_insert was failing to initialize the backend type,
resulting in the wrong default backend.  The result was not only that
the CD was not inserted properly, but also that some improper xenstore
entries were created, causing further block commands to fail.

This patch fixes the bug by setting the disk backend type based on the
type of the existing device.

It also makes the system more robust by checking to see that it has
got a valid path before proceeding to write a partial xenstore entry.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-27 14:13:41 +00:00
Ian Campbell 833ea62ccb xl: xl.conf(5): correct advice re autoballooning vs. dom0_mem.
The advice was backwards, you should really disable autoballoon if you
use dom0_mem. Also add a reference to the command-line docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-27 14:13:40 +00:00
Stefano Stabellini 5ff9a4aff2 README: add Pixman as build dependency
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-27 14:13:39 +00:00
Ronny Hegewald b98cd5c1b5 libxl: fix a variable underflow in libxl_wait_for_free_memory
When xl is called to create a domU and there is not enough memory available,
then the autoballooning is called to extract memory from dom0. During the
ballooning a loop in libxl_wait_for_free_memory() waits unless enough memory
is available to create the domU.

But because of a variable-underflow the loop can finish too soon and xl
finally aborts with the message:

xc: error: panic: xc_dom_boot.c:161: xc_dom_boot_mem_init: can't allocate low memory for domain: Out of memory
libxl: error: libxl_dom.c:430:libxl__build_pv: xc_dom_boot_mem_init failed: Device or resource busy
libxl: error: libxl_create.c:901:domcreate_rebuild_done: cannot (re-)build domain: -3

The variable-underflow happens when freemem_slack is larger then
info.free_pages*4, because the solution of this operation is converted
implicit to a unsigned int to match the type of memory_kb.

Add a extra check for this condition to solve the problem.

Signed-off-by: Ronny Hegewald <Ronny.Hegewald@online.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-27 14:13:39 +00:00
Chunyan Liu 3ffb163212 xenstore-chmod: handle arbitrary number of perms rather than MAX_PERMS constant
Constant MAX_PERMS 16 is too small to use in some occasions, e.g. if
there are more than 16 domU(s) on one hypervisor (it's easy to
achieve) and one wants to do xenstore-chmod PATH to all domU(s). So,
remove MAX_PERMS limitation and make it as arbitrary number of perms.

Signed-off-by: Chunyan Liu <cyliu@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-27 14:13:38 +00:00
Jan Beulich 84628ee52a x86/time: fix scale_delta() inline assembly
The way it was coded, it clobbered %rdx without telling the compiler.
This generally didn't cause any problems except when there are two back
to back invocations (as in plt_overflow()), as in that case the
compiler may validly assume that it can re-use for the second instance
the value loaded into %rdx before the first one.

Once at it, also properly relax the second operand of "mul" (there's no
need for it to be in %rdx, or a register at all), and switch away from
using explicit register names in the instruction operands.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-26 17:20:39 +01:00
Olaf Hering 4369b2cd6f xend: enable environment passing in xPopen3
In changeset 19990:38dd208e1d95 a new parameter 'env' was added to
xPopen3, but no code was added to actually pass the environment down to
execvpe. Also, the new code was unreachable.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-23 11:06:15 +00:00
Tim Deegan b1f2c77ffd arm: Tidy up flush_xen_dcache().
- Use a compile-time-constant check for whether we can safely flush
   just one cacheline.  This reduces the common case from 28
   instructions to three.
 - Pass an object to the macro, not a pointer, so we can detect
   attempts to flush arrays.
 - Decode CCSIDR correctly to get cacheline size.
 - Remove some redundant DSBs at the call sites.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-23 11:06:14 +00:00
George Dunlap 18cd92eed4 xl: Suppress spurious warning message for cpupool-list
libxl_cpupool_list() enumerates the cpupools by "probing": calling
cpupool_info, starting at 0 and stopping when it gets an error. However,
cpupool_info will print an error when the call to xc_cpupool_getinfo() fails,
resulting in every xl command that uses libxl_list_cpupool (such as
cpupool-list) printing that error message spuriously.

Since at the moment the times we want to print the message correspond
with the use of the existing "exact" parameter, use it to decide
whether to print the message or not.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-23 11:06:14 +00:00
Jan Beulich d0d4635d03 implement vmap()
... and use it as basis for a proper ioremap() on x86.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-22 10:47:58 +01:00
Jan Beulich 7bdfb850ae x86/HPET: fix FSB interrupt masking
HPET_TN_FSB is not really suitable for masking interrupts - it merely
switches between the two delivery methods. The right way of masking is
through the HPET_TN_ENABLE bit (which really is an interrupt enable,
not a counter enable or some such). This is even more so with certain
chip sets not even allowing HPET_TN_FSB to be cleared on some of the
channels.

Further, all the setup of the channel should happen before actually
enabling the interrupt, which requires splitting legacy and FSB logic.

Finally this also fixes an S3 resume problem (HPET_TN_FSB did not get
set in hpet_broadcast_resume(), and hpet_msi_unmask() doesn't get
called from the general resume code either afaict).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-22 10:03:23 +01:00
Jan Beulich c7675f1e2b x86/HPET: include FSB interrupt information in 'M' debug key output
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2012-11-22 10:02:18 +01:00
Jan Beulich e9efd5b82e VT-d: clean up map/unmap log messages
- printing file name and line number here is pointless
- they are guest related, so should get their log level filter
  accordingly
- include segment numbers and canonicalize number widths

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2012-11-22 09:59:50 +01:00
Ian Campbell 7e34a52d1b xend: reinstate XendOptionsFile.get_external_migration_tool
This was removed by 26167:31dcc0e08754 "xend: Remove old vtpm support
from xm" but at least one caller was left. Reinstate with
s/TPM/device/ since it appears that this functionality could apply
elsewhere.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-20 17:17:40 +00:00
Jan Beulich 2cb5154f08 passthrough/PCI: replace improper uses of pci_find_next_cap()
Using pci_find_next_cap() without prior pci_find_cap_offset() is bogus
(and possibly wrong, given that the latter doesn't check the
PCI_STATUS_CAP_LIST flag, which so far was checked in an open-coded way
only for the non-bridge case).

Once at it, fold the two calls into one, as we need its result in any
case.

Question is whether, without any caller left, pci_find_next_cap()
should be purged as well.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
2012-11-20 08:58:31 +01:00
Ian Campbell 11ab183655 xen: fix build failure due to extra closing comment
Added by 26173:26facad2f1a1

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 19:56:56 +00:00
Ian Campbell 807980f78b docs: Include prototype for HYPERVISOR_multicall
Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 14:25:35 +00:00
Ian Campbell 562b79b018 docs: Document HYPERVISOR_update_descriptor
Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 14:25:34 +00:00
Ian Campbell 72d50aa0e5 docs: Add ToC entry for start of day memory layout.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 14:25:33 +00:00
Ian Campbell e1c71e883a docs: Document HYPERVISOR_mmuext_op
Mark-up for inclusion of generated docs.

Remove some trailing whitespace.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 14:25:33 +00:00
Ian Campbell 8fbd7a7958 docs: document HYPERVISOR_update_va_mapping(_other_domain)
Mark-up for inclusion of generated docs.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
2012-11-19 14:25:32 +00:00