]> xenbits.xensource.com Git - xen.git/log
xen.git
12 years agoMAINTAINERS: Provide proper URL to the upstream Linux development tree for Xen.
Konrad Rzeszutek Wilk [Tue, 26 Feb 2013 16:18:09 +0000 (16:18 +0000)]
MAINTAINERS: Provide proper URL to the upstream Linux development tree for Xen.

And also put my name behind the maintainership.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agolibxl: Made it possible to use 'timer='delay_for_missed_ticks'
Konrad Rzeszutek Wilk [Mon, 25 Feb 2013 16:30:18 +0000 (11:30 -0500)]
libxl: Made it possible to use 'timer='delay_for_missed_ticks'

The assertion only allows values of 1 (no_delay_for_missed_ticks)
up to 3 (one_missed_tick_pending). It should be possible to
use the value of 0 (delay_for_missed_ticks) for the timer configuration
option.

Acked-by: Ian Campbell <ian.cambell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
12 years agotools: foreign: ensure 64 bit values are properly aligned for arm
Ian Campbell [Tue, 26 Feb 2013 10:12:46 +0000 (10:12 +0000)]
tools: foreign: ensure 64 bit values are properly aligned for arm

When building the foreign headers on x86_32 we use '#pragma pack(4)' and
therefore need to explicitly align types which should be aligned to 8-byte
boundaries.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years agox86: fix CMCI injection
Jan Beulich [Tue, 26 Feb 2013 09:15:56 +0000 (10:15 +0100)]
x86: fix CMCI injection

This fixes the wrong use of literal vector 0xF7 with an "int"
instruction (invalidated by 25113:14609be41f36) and the fact that doing
the injection via a software interrupt was never valid anyway (because
cmci_interrupt() acks the LAPIC, which does the wrong thing if the
interrupt didn't get delivered though it).

In order to do latter, the patch introduces send_IPI_self(), at once
removing two opend coded uses of "genapic" in the IRQ handling code.

Reported-by: Yongjie Ren <yongjie.ren@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoIOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround
Suravee Suthikulpanit [Tue, 26 Feb 2013 09:14:53 +0000 (10:14 +0100)]
IOMMU, AMD Family15h Model10-1Fh erratum 746 Workaround

The IOMMU may stop processing page translations due to a perceived lack
of credits for writing upstream peripheral page service request (PPR)
or event logs. If the L2B miscellaneous clock gating feature is enabled
the IOMMU does not properly register credits after the log request has
completed, leading to a potential system hang.

BIOSes are supposed to disable L2B micellaneous clock gating by setting
L2_L2B_CK_GATE_CONTROL[CKGateL2BMiscDisable](D0F2xF4_x90[2]) = 1b. This
patch corrects that for those which do not enable this workaround.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
12 years agoAMD IOMMU: cover all functions of a device even if ACPI only tells us of func 0
Jan Beulich [Tue, 26 Feb 2013 09:12:57 +0000 (10:12 +0100)]
AMD IOMMU: cover all functions of a device even if ACPI only tells us of func 0

This ought to work as all functions of a device have the same place in
the bus topology, i.e. use the same IOMMU.

Also fix the type of ivrs_bdf_entries (when it's 'unsigned short' and
the last device found on a segment is ff:1f.x, it would otherwise end
up being zero).

And drop the bogus 'last_bdf' static variable, which conflicted anyway
with various functions' parameters.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
12 years agoQEMU_TAG update
Ian Jackson [Mon, 25 Feb 2013 16:45:14 +0000 (16:45 +0000)]
QEMU_TAG update

12 years agox86: fix null pointer dereference in intel_get_extended_msrs()
Xi Wang [Mon, 25 Feb 2013 11:44:25 +0000 (12:44 +0100)]
x86: fix null pointer dereference in intel_get_extended_msrs()

`memset(&mc_ext, 0, ...)' leads to a buffer overflow and a subsequent
null pointer dereference.  Replace `&mc_ext' with `mc_ext'.

Signed-off-by: Xi Wang <xi@mit.edu>
12 years agoQEMU_TAG update
Ian Jackson [Fri, 22 Feb 2013 18:16:54 +0000 (18:16 +0000)]
QEMU_TAG update

12 years agotools/flask: add FLASK policy to build
Daniel De Graaf [Wed, 13 Feb 2013 16:06:57 +0000 (16:06 +0000)]
tools/flask: add FLASK policy to build

This patch enables the compilation of the FLASK policy as part of the
tools build if the needed prerequisites are present.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoflask/policy: rework policy build system
Daniel De Graaf [Wed, 13 Feb 2013 16:07:05 +0000 (16:07 +0000)]
flask/policy: rework policy build system

This adds the ability to define security classes and access vectors in
FLASK policy not defined by the hypervisor, for the use of stub domains
or applications without their own security policies.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
12 years agoflask/policy: sort dom0 accesses
Daniel De Graaf [Wed, 13 Feb 2013 16:06:57 +0000 (16:06 +0000)]
flask/policy: sort dom0 accesses

For the example policy shipped with Xen, it makes sense to allow dom0
access to all system calls so that policy does not need to be updated
for each new hypervisor or toolstack feature used.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
12 years agobuild: Fix distclean when repo location changes
Andrei Lifchits [Wed, 20 Feb 2013 16:54:03 +0000 (16:54 +0000)]
build: Fix distclean when repo location changes

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks
inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which
breaks distclean because make attempts to clean inside those first and fails to
find Makefile (which is also a symlink).

Signed-off-by: Andrei Lifchits <andrei.lifchits@citrix.com>
12 years agoxend: Only add cpuid and cpuid_check to sexpr once
Olaf Hering [Thu, 14 Feb 2013 17:18:56 +0000 (17:18 +0000)]
xend: Only add cpuid and cpuid_check to sexpr once

tools/xend: Only add cpuid and cpuid_check to sexpr once

When converting a XendConfig object to sexpr, cpuid and cpuid_check
were being emitted twice in the resulting sexpr.  The first conversion
writes incorrect sexpr, causing parsing of the sexpr to fail when xend
is restarted and domain sexpr files in /var/lib/xend/domains/<dom-uuid>
are read and parsed.

This patch skips the first conversion, and uses only the custom
cpuid{_check} conversion methods called later.  It is not pretty, but
is the least invasive fix in this complex code.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
12 years agodoc: Improve xc_domain_restore inline documentation
Frediano Ziglio [Thu, 14 Feb 2013 14:10:15 +0000 (14:10 +0000)]
doc: Improve xc_domain_restore inline documentation

Was not clear that xc_domain_restore did not resume the machine.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agoxen: arm: implement cpuinfo
Ian Campbell [Fri, 22 Feb 2013 08:58:25 +0000 (08:58 +0000)]
xen: arm: implement cpuinfo

Use to:

 - Only context switch ThumbEE state if the processor implements it. In
   particular the ARMv8 FastModels do not.
 - Detect the generic timer, and therefore call identify_cpu before
   init_xen_time.

Also improve the boot time messages a bit.

I haven't added decoding for all of the CPUID words, it seems like overkill
for the moment.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Cc: stefano.stabellini@citrix.com
12 years agoxen: arm: Fix guest mode for 64-bit
Ian Campbell [Fri, 22 Feb 2013 08:58:24 +0000 (08:58 +0000)]
xen: arm: Fix guest mode for 64-bit

Need to check for the 64-bit EL2 modes, not 32-bit HYP mode.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: print arm64 not arm32 in xen info when appropriate.
Ian Campbell [Fri, 22 Feb 2013 08:58:23 +0000 (08:58 +0000)]
xen: arm: print arm64 not arm32 in xen info when appropriate.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: Explicitly setup VPIDR & VMPIDR at start of day
Ian Campbell [Fri, 22 Feb 2013 08:58:22 +0000 (08:58 +0000)]
xen: arm: Explicitly setup VPIDR & VMPIDR at start of day

These are supposed to reset to the value of the underlying hardware
but appears not to be on at least some v8 models. There's no harm in
setting them explicitly.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: Use generic mem{cpy, move, set, zero} on 64-bit
Ian Campbell [Fri, 22 Feb 2013 08:58:21 +0000 (08:58 +0000)]
xen: arm: Use generic mem{cpy, move, set, zero} on 64-bit

No optimised versions are available in Linux yet (meaning I couldn't
copy them).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: Enable VFP is a nop on 64-bit.
Ian Campbell [Fri, 22 Feb 2013 08:58:20 +0000 (08:58 +0000)]
xen: arm: Enable VFP is a nop on 64-bit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: implement do_multicall_call for both 32 and 64-bit
Ian Campbell [Fri, 22 Feb 2013 08:58:19 +0000 (08:58 +0000)]
xen: arm: implement do_multicall_call for both 32 and 64-bit

Obviously nothing is actually making multicalls even on 32-bit so
this isn't tested.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: guest stage 1 walks on 64-bit hypervisor
Ian Campbell [Fri, 22 Feb 2013 08:58:18 +0000 (08:58 +0000)]
xen: arm: guest stage 1 walks on 64-bit hypervisor

Still only supports non-LPAE 32-bit guests.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: handle 32-bit guest CP register traps on 64-bit hypervisor
Ian Campbell [Fri, 22 Feb 2013 08:58:17 +0000 (08:58 +0000)]
xen: arm: handle 32-bit guest CP register traps on 64-bit hypervisor

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: select_user_reg support for 64-bit hypervisor
Ian Campbell [Fri, 22 Feb 2013 08:58:16 +0000 (08:58 +0000)]
xen: arm: select_user_reg support for 64-bit hypervisor

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: Use 64-bit compatible registers in vtimer.
Ian Campbell [Fri, 22 Feb 2013 08:58:15 +0000 (08:58 +0000)]
xen: arm: Use 64-bit compatible registers in vtimer.

Also, don't crash the host if we fail to emulate a vtimer access,
just kill the guest.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: p2m: use 64-bit compatible registers.
Ian Campbell [Fri, 22 Feb 2013 08:58:14 +0000 (08:58 +0000)]
xen: arm: p2m: use 64-bit compatible registers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: time: use 64-bit compatible registers
Ian Campbell [Fri, 22 Feb 2013 08:58:13 +0000 (08:58 +0000)]
xen: arm: time: use 64-bit compatible registers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: gic: use 64-bit compatible registers
Ian Campbell [Fri, 22 Feb 2013 08:58:12 +0000 (08:58 +0000)]
xen: arm: gic: use 64-bit compatible registers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: make dom0 builder work on 64-bit hypervisor
Ian Campbell [Fri, 22 Feb 2013 08:58:11 +0000 (08:58 +0000)]
xen: arm: make dom0 builder work on 64-bit hypervisor

This still only builds a 32-bit dom0, although it lays a bit of
simple ground work for 64-bit dom0.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: show_registers() support for 64-bit.
Ian Campbell [Fri, 22 Feb 2013 08:58:10 +0000 (08:58 +0000)]
xen: arm: show_registers() support for 64-bit.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: guest context switching.
Ian Campbell [Fri, 22 Feb 2013 08:58:09 +0000 (08:58 +0000)]
xen: arm: guest context switching.

One side effect of this is that we now save the full 64-bit
TTBR[0,1] even on a 32-bit hypervisor. This is needed anyway to
support LPAE guests (although this patch doesn't implement anything
other than the context switch).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: percpu variable support.
Ian Campbell [Fri, 22 Feb 2013 08:58:08 +0000 (08:58 +0000)]
xen: arm64: percpu variable support.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: pcpu context switch
Ian Campbell [Fri, 22 Feb 2013 08:58:07 +0000 (08:58 +0000)]
xen: arm: pcpu context switch

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: arm64 trap handling.
Ian Campbell [Fri, 22 Feb 2013 08:58:06 +0000 (08:58 +0000)]
xen: arm: arm64 trap handling.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: move arm32 specific trap handlers to xen/arch/arm/arm32
Ian Campbell [Fri, 22 Feb 2013 08:58:05 +0000 (08:58 +0000)]
xen: arm: move arm32 specific trap handlers to xen/arch/arm/arm32

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: add guest type to domain field.
Ian Campbell [Fri, 22 Feb 2013 08:58:04 +0000 (08:58 +0000)]
xen: arm64: add guest type to domain field.

Currently 32 bit PV is the only option.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: separate guest user regs from internal guest state.
Ian Campbell [Fri, 22 Feb 2013 08:58:03 +0000 (08:58 +0000)]
xen: arm: separate guest user regs from internal guest state.

struct cpu_user_regs is currently used as both internal state
(specifically at the base of the stack) and a guest/toolstack
visible API (via struct vcpu_guest_context used by
XEN_DOMCTL_{g,s}etvcpucontext and VCPUOP_initialise).

This causes problems when we want to make the API 64-bit clean since
we don't really want to change the size of the on-stack struct.

So split into vcpu_guest_core_regs which is the API facing struct
and keep cpu_user_regs purely internal, translate between the two.

In the user API arrange for both 64- and 32-bit registers to be
included in a layout which does not differ depending on toolstack
architecture. Also switch to using the more formal banked register
names (e.g. with the _usr suffix) for clarity.

This is an ABI change. Note that the kernel doesn't currently use
this data structure so it affects the tools interface only.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: add register_t type, native register size for the hypervisor
Ian Campbell [Fri, 22 Feb 2013 08:58:02 +0000 (08:58 +0000)]
xen: arm: add register_t type, native register size for the hypervisor

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen: arm: use vaddr_t more widely.
Ian Campbell [Fri, 22 Feb 2013 08:58:01 +0000 (08:58 +0000)]
xen: arm: use vaddr_t more widely.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: extend HSR struct definitions to 64-bit
Ian Campbell [Fri, 22 Feb 2013 08:58:00 +0000 (08:58 +0000)]
xen: arm: extend HSR struct definitions to 64-bit

The main change is that the 4-bit register specifiers are extended
to 5 bits by taking in an adjacent SBZP bit.

Also 64-bit has two other properties indicting whether or not the
target register was 64-bit (x<n>) or 32-bit (w<n>) and whether the
instruction has acquire/release semantics.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: add to foreign struct checks
Ian Campbell [Fri, 22 Feb 2013 08:57:59 +0000 (08:57 +0000)]
xen: arm64: add to foreign struct checks

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen: arm64: changes to setup_pagetables and mm.c
Ian Campbell [Fri, 22 Feb 2013 08:57:58 +0000 (08:57 +0000)]
xen: arm64: changes to setup_pagetables and mm.c

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: start of day changes to setup.c
Ian Campbell [Fri, 22 Feb 2013 08:57:57 +0000 (08:57 +0000)]
xen: arm64: start of day changes to setup.c

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: div64
Ian Campbell [Fri, 22 Feb 2013 08:57:56 +0000 (08:57 +0000)]
xen: arm64: div64

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: interrupt/abort mask/unmask
Ian Campbell [Fri, 22 Feb 2013 08:57:55 +0000 (08:57 +0000)]
xen: arm64: interrupt/abort mask/unmask

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: xchg and cmpxchg
Ian Campbell [Fri, 22 Feb 2013 08:57:54 +0000 (08:57 +0000)]
xen: arm64: xchg and cmpxchg

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: barriers and wait for interrupts/events
Ian Campbell [Fri, 22 Feb 2013 08:57:53 +0000 (08:57 +0000)]
xen: arm64: barriers and wait for interrupts/events

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: address translation
Ian Campbell [Fri, 22 Feb 2013 08:57:52 +0000 (08:57 +0000)]
xen: arm64: address translation

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: dcache flush
Ian Campbell [Fri, 22 Feb 2013 08:57:51 +0000 (08:57 +0000)]
xen: arm64: dcache flush

Use "dsb sy" instead of bare "dsb", they mean the same on 32-bit but only the
former is valid on 64-bit.

Abstract the actual flush operation into a macro.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: PTE handling
Ian Campbell [Fri, 22 Feb 2013 08:57:50 +0000 (08:57 +0000)]
xen: arm64: PTE handling

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: TLB flushes
Ian Campbell [Fri, 22 Feb 2013 08:57:49 +0000 (08:57 +0000)]
xen: arm64: TLB flushes

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm: refactor co-pro and sysreg reg handling.
Ian Campbell [Fri, 22 Feb 2013 08:57:48 +0000 (08:57 +0000)]
xen: arm: refactor co-pro and sysreg reg handling.

AArch64 has removed the concept of co-processors replacing them with a
combination of specific instructions (cache and tlb flushes etc) and
system registers (which are understood by name in the assembler).

However most system registers are equivalent to a particular AArch32
co-pro register and can be used by generic code in the same way. Note
that the names of the registers differ (often only slightly)

For consistency it would be better to use only set of names in the
common code. Therefore move the {READ,WRITE}_CP{32,64} accessors into
arm32/processor.h and provide {READ,WRITE}_SYSREG. Where the names
differ #defines will be provided on 32-bit.

HSR_CPREG and friends are required even on 64-bit in order to decode
traps from 32 bit guests.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: atomics
Ian Campbell [Fri, 22 Feb 2013 08:57:47 +0000 (08:57 +0000)]
xen: arm64: atomics

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: spinlocks
Ian Campbell [Fri, 22 Feb 2013 08:57:46 +0000 (08:57 +0000)]
xen: arm64: spinlocks

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: basic config and types headers
Ian Campbell [Fri, 22 Feb 2013 08:57:45 +0000 (08:57 +0000)]
xen: arm64: basic config and types headers

The 64-bit bitops are taken from the Linux asm-generic implementations. They
should be replaced with optimised versions from the Linux arm64 port when they
become available.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: arm64: initial build + config changes, start of day code
Ian Campbell [Fri, 22 Feb 2013 08:57:44 +0000 (08:57 +0000)]
xen: arm64: initial build + config changes, start of day code

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: consolidate implementations of LOG() macro
Ian Campbell [Fri, 22 Feb 2013 08:57:43 +0000 (08:57 +0000)]
xen: consolidate implementations of LOG() macro

arm64 is going to add another one shortly, so take control now.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoarm: avoid inline asm for dsb, isb, wfi and sev.
Ian Campbell [Fri, 22 Feb 2013 08:57:42 +0000 (08:57 +0000)]
arm: avoid inline asm for dsb, isb, wfi and sev.

"dsb" must be written "dsb sy" on arm64. "dsb sy" is also valid (and
synonymous) on arm32 but we have a macro so lets use it.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agoxen: event channel arrays are xen_ulong_t and not unsigned long
Ian Campbell [Fri, 22 Feb 2013 08:57:41 +0000 (08:57 +0000)]
xen: event channel arrays are xen_ulong_t and not unsigned long

On ARM we want these to be the same size on 32- and 64-bit.

This is an ABI change on ARM. X86 does not change.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agotools: s/arm/arm32/ in foreign header checks.
Ian Campbell [Fri, 22 Feb 2013 08:57:40 +0000 (08:57 +0000)]
tools: s/arm/arm32/ in foreign header checks.

Also define __arm__ARM32 as required.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agotools: disable docs for QEMU build
Wei Liu [Fri, 22 Feb 2013 11:31:44 +0000 (11:31 +0000)]
tools: disable docs for QEMU build

Texinfo 5 breaks QEMU builds. As we do not need documents from QEMU, just
disable it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: jacek burghardt <jaceksburghardt@gmail.com>
12 years agohonor ACPI v4 FADT flags
Jan Beulich [Fri, 22 Feb 2013 10:56:54 +0000 (11:56 +0100)]
honor ACPI v4 FADT flags

- force use of physical APIC mode if indicated so (as we don't support
  xAPIC cluster mode, the respective flag is taken to force physical
  mode too)
- don't use MSI if indicated so (implies no IOMMU)

Both can be overridden on the command line, for the MSI case this at
once adds a new command line option allowing to turn off PCI MSI (IOMMU
and HPET are unaffected by this).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agox86: honor ACPI indicating absence of CMOS RTC
Jan Beulich [Fri, 22 Feb 2013 10:51:06 +0000 (11:51 +0100)]
x86: honor ACPI indicating absence of CMOS RTC

On such systems we can boot through EFI only.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoACPI: support v5 (reduced HW) sleep interface
Jan Beulich [Fri, 22 Feb 2013 10:48:57 +0000 (11:48 +0100)]
ACPI: support v5 (reduced HW) sleep interface

Note that this also fixes a broken input check in acpi_enter_sleep()
(previously validating the sleep->pm1[ab]_cnt_val relationship based
on acpi_sinfo.pm1b_cnt_val, which however gets set only subsequently).

Also adjust a few minor issues with the pre-v5 handling in
acpi_fadt_parse_sleep_info().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoACPICA: Update for larger ACPI 5 FADT size
Bob Moore [Fri, 22 Feb 2013 10:47:25 +0000 (11:47 +0100)]
ACPICA: Update for larger ACPI 5 FADT size

FADT is now larger than 256 bytes, so all FADT offsets must be
changed from 8 bits to 16 bits.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoACPI 5.0: Implement hardware-reduced option
Bob Moore [Fri, 22 Feb 2013 10:46:32 +0000 (11:46 +0100)]
ACPI 5.0: Implement hardware-reduced option

If HW-reduced flag is set in the FADT, do not attempt to access
or initialize any ACPI hardware, including SCI and global lock.
No FACS will be present.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Also adjust acpi_fadt_parse_sleep_info().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoACPI 5.0: Basic support for FADT version 5
Bob Moore [Fri, 22 Feb 2013 10:43:59 +0000 (11:43 +0100)]
ACPI 5.0: Basic support for FADT version 5

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agox86/nhvm: properly clean up after failure to set up all vCPU-s
Jan Beulich [Fri, 22 Feb 2013 10:21:38 +0000 (11:21 +0100)]
x86/nhvm: properly clean up after failure to set up all vCPU-s

Otherwise we may leak memory when setting up nHVM fails half way.

This implies that the individual destroy functions will have to remain
capable (in the VMX case they first need to be made so, following
26486:7648ef657fe7 and 26489:83a3fa9c8434) of being called for a vCPU
that the corresponding init function was never run on.

Once at it, also remove a redundant check from the corresponding
parameter validation code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
Tested-by: Olaf Hering <olaf@aepfle.de>
12 years agox86/mm: avoid locked lookups in shadow emulation.
Tim Deegan [Thu, 21 Feb 2013 17:41:26 +0000 (17:41 +0000)]
x86/mm: avoid locked lookups in shadow emulation.

Use get_page_from_gfn() instead of get_gfn(), avoiding taking the p2m
lock in the common case.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
12 years agogenid: Introduce again Windows generation ID device
Frediano Ziglio [Tue, 19 Feb 2013 08:54:34 +0000 (08:54 +0000)]
genid: Introduce again Windows generation ID device

This device was removed due to change in specifications.
Original patch written by Paul Durrant

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agogenid: Update Windows generation ID
Frediano Ziglio [Tue, 19 Feb 2013 08:54:33 +0000 (08:54 +0000)]
genid: Update Windows generation ID

First draft specification document it as a 64bit counter, now are a 128bit
value handled as a couple of 64bit values.

Allow to disable the device is values are all zeroes.

Add documentation for platform/generation-id key.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agogcov: Add documentation for coverage
Frediano Ziglio [Thu, 14 Feb 2013 12:37:17 +0000 (12:37 +0000)]
gcov: Add documentation for coverage

12 years agogcov: Add small utility to deal with test coverage information from Xen
Frediano Ziglio [Thu, 14 Feb 2013 12:37:16 +0000 (12:37 +0000)]
gcov: Add small utility to deal with test coverage information from Xen

Currently the utility can read and reset coverage informations.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agogcov: Implement code to read coverage informations
Frediano Ziglio [Thu, 14 Feb 2013 12:37:15 +0000 (12:37 +0000)]
gcov: Implement code to read coverage informations

Operations are handled by a sysctl specific operation.

Implement 4 operations
- check if coverage is compiled in
- read size of coverage information
- read coverage information
- reset coverage counters

Information are stored in a single blob in a format specific to Xen designed
to make code that generate coverage as small as possible.

This patch add a public header with the structure of blob exported by Xen.
This avoid problems distributing header which is GPL2.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agogcov: Adding support for coverage information
Frediano Ziglio [Thu, 14 Feb 2013 12:37:14 +0000 (12:37 +0000)]
gcov: Adding support for coverage information

This patch introduce coverage support to Xen.
Currently it allows to compile Xen with coverage support but there is no
way to extract them.

The declarations came from Linux source files (as you can see from file
headers).

The idea is to have some operations mainly
- get coverage information size
- read coverage information
- reset coverage counters

Linux use a file system to export these information. The information will
be a blob to handle with some tools (as usually tools require a bunch of
files but Xen does not handle files at all). I'll pack them to make things
simpler as possible.

These information cannot be put in a specific section (allowing a safe
mapping) as gcc use .rodata, .data, .text and .ctors sections.

I added code to handle constructors used in this case to initialize a
linked list of files.

I excluded %.init.o files as they are used before Xen start and should
not have section like .text or .data.

I used a "coverage" configuration option to mimic the "debug" one.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
12 years agogcov: Call constructors during initialization
Frediano Ziglio [Thu, 14 Feb 2013 12:37:13 +0000 (12:37 +0000)]
gcov: Call constructors during initialization

This allow modules to set initializer functions.
This is used by Gcc instrumentation code for profiling arcs and test
coverage.

12 years agoFix emacs local variable block to use correct C style variable.
David Vrabel [Thu, 21 Feb 2013 16:12:46 +0000 (16:12 +0000)]
Fix emacs local variable block to use correct C style variable.

The emacs variable to set the C style from a local variable block is
c-file-style, not c-set-style.

Signed-off-by: David Vrabel <david.vrabel@citrix.com
12 years agox86/mm: Take the p2m lock even in shadow mode.
Tim Deegan [Thu, 21 Feb 2013 14:07:19 +0000 (14:07 +0000)]
x86/mm: Take the p2m lock even in shadow mode.

The reworking of p2m lookups to use get_gfn()/put_gfn() left the
shadow code not taking the p2m lock, even in cases where the p2m would
be updated (i.e. PoD).

In many cases, shadow code doesn't need the exclusion that
get_gfn()/put_gfn() provides, as it has its own interlocks against p2m
updates, but this is taking things too far, and can lead to crashes in
the PoD code.

Now that most shadow-code p2m lookups are done with explicitly
unlocked accessors, or with the get_page_from_gfn() accessor, which is
often lock-free, we can just turn this locking on.

The remaining locked lookups are in sh_page_fault() (in a path that's
almost always already serializing on the paging lock), and in
emulate_map_dest() (which can probably be updated to use
get_page_from_gfn()).  They're not addressed here but may be in a
follow-up patch.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
12 years agolibxl: fix build on 32-bit
Ian Campbell [Thu, 21 Feb 2013 10:59:51 +0000 (10:59 +0000)]
libxl: fix build on 32-bit

aab4d1b266ce "libxl: Add qxl vga interface support for upstream qemu"
introduced:
libxl_dm.c: In function ‘libxl__build_device_model_args_new’:
libxl_dm.c:449: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’
libxl_dm.c:451: error: format ‘%lu’ expects type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’

on arm32 and x86_32.

Use the inttypes.h PRId64 macro.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
12 years ago.gitignore: Do not ignore dsdl.asl file
Frediano Ziglio [Wed, 20 Feb 2013 16:59:43 +0000 (16:59 +0000)]
.gitignore: Do not ignore dsdl.asl file

dsdl.asl file is not autogenerated while all other dsdl_*.asl files are.
.hgignore is correct.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agolibxl: Add qxl vga interface support for upstream qemu
Fabio Fantoni [Wed, 20 Feb 2013 15:46:06 +0000 (15:46 +0000)]
libxl: Add qxl vga interface support for upstream qemu

Usage:
  vga="qxl"

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Signed-off-by: Zhou Peng <zpengxen@gmail.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoQEMU_TAG update
Ian Jackson [Wed, 20 Feb 2013 15:43:03 +0000 (15:43 +0000)]
QEMU_TAG update

12 years agoxmalloc: make close-to-PAGE_SIZE allocations more efficient
Jan Beulich [Tue, 19 Feb 2013 09:49:53 +0000 (10:49 +0100)]
xmalloc: make close-to-PAGE_SIZE allocations more efficient

Rather than bumping their sizes to slightly above (a multiple of)
PAGE_SIZE (in order to store tracking information), thus requiring
a non-order-0 allocation even when no more than a page is being
requested, return the result of alloc_xenheap_pages() directly, and use
the struct page_info field underlying PFN_ORDER() to store the actual
size (needed for freeing the memory).

This leverages the fact that sub-allocation of memory obtained from the
page allocator can only ever result in non-page-aligned memory chunks
(with the exception of zero size allocations with sufficiently high
alignment being requested, which is why zero-size allocations now get
special cased).

Use the new property to simplify allocation of the trap info array for
PV guests on x86.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoAMD IOMMU: use __ioapic_read_entry() instead of open coding it
Jan Beulich [Mon, 18 Feb 2013 08:38:25 +0000 (09:38 +0100)]
AMD IOMMU: use __ioapic_read_entry() instead of open coding it

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
12 years agoAMD IOMMU: don't BUG() when we don't have to
Jan Beulich [Mon, 18 Feb 2013 08:37:35 +0000 (09:37 +0100)]
AMD IOMMU: don't BUG() when we don't have to

find_iommu_for_device() can easily return NULL instead, as all of its
callers are prepared for that.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
12 years agox86/VMX: fix VMCS setting for x2APIC mode guest while enabling APICV
Jiongxi Li [Mon, 18 Feb 2013 08:34:18 +0000 (09:34 +0100)]
x86/VMX: fix VMCS setting for x2APIC mode guest while enabling APICV

The "APIC-register virtualization" and "virtual-interrupt deliver"
VM-execution control has no effect on the behavior of RDMSR/WRMSR if
the "virtualize x2APIC mode" VM-execution control is 0.
When guest uses x2APIC mode, we should enable "virtualize x2APIC mode"
for APICV first.

Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
12 years agox86/VMX: fix live migration while enabling APICV
Jiongxi Li [Mon, 18 Feb 2013 08:27:58 +0000 (09:27 +0100)]
x86/VMX: fix live migration while enabling APICV

SVI should be restored in case guest is processing virtual interrupt
while saveing a domain state. Otherwise SVI would be missed when
virtual interrupt delivery is enabled.

Signed-off-by: Jiongxi Li <jiongxi.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Acked-by: Jun Nakajima <jun.nakajima@intel.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
12 years agoMerge
Ian Campbell [Sat, 16 Feb 2013 13:17:22 +0000 (13:17 +0000)]
Merge

12 years agoxm: fix description of xm vcpu-set command
Lalith Suresh [Fri, 15 Feb 2013 14:57:40 +0000 (14:57 +0000)]
xm: fix description of xm vcpu-set command

Minor language correction in the description of the xm vcpu-set command.

Signed-off-by: Lalith Suresh <suresh.lalith@gmail.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agotools/libxl: Disable useless empty floppy drive with qemu-xen
Fabio Fantoni [Fri, 15 Feb 2013 14:30:06 +0000 (14:30 +0000)]
tools/libxl: Disable useless empty floppy drive with qemu-xen

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: introduce a driver for the ARM HDLCD controller
Stefano Stabellini [Fri, 15 Feb 2013 14:30:06 +0000 (14:30 +0000)]
xen/arm: introduce a driver for the ARM HDLCD controller

Read the screen resolution setting from device tree, find the
corresponding modeline in a small table of standard video modes, set the
hardware accordingly.

Use vexpress_syscfg to configure the pixel clock.

Use the generic framebuffer functions to print on the screen.

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>
12 years agoxen: introduce a generic framebuffer driver
Stefano Stabellini [Fri, 15 Feb 2013 14:30:05 +0000 (14:30 +0000)]
xen: introduce a generic framebuffer driver

Abstract away from vesa.c the funcions to handle a linear framebuffer
and print characters to it.
Make use of the new functions in vesa.c.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
[ ijc -- s/fbp/lfbp/ in two places to fix the build ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
12 years agotools/libxl: Improve videoram setting
Fabio Fantoni [Fri, 15 Feb 2013 13:32:27 +0000 (13:32 +0000)]
tools/libxl: Improve videoram setting

- If videoram setting is less than 8 mb shows error and exit.
- Added videoram setting for qemu upstream with cirrus (added in qemu 1.3).
- Updated xl.cfg man.
- Default and minimal videoram changed to 16 mb if stdvga is set and upstream
  qemu is being used. This is required by qemu 1.4 to avoid a xen memory error
  (qemu 1.3 doesn't complain about it, probably buggy).

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
12 years agotools/libxl: Added vga parameter for hvm domUs
Fabio Fantoni [Fri, 15 Feb 2013 13:32:26 +0000 (13:32 +0000)]
tools/libxl: Added vga parameter for hvm domUs

Usage:
  vga="stdvga"|"cirrus"

- Default option is cirrus.
- Prints error and exit if unknown value is passed.
- stdvga parameter is now deprecated.
- Updated xl.cfg man.

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/vtimer: fixes and improvements
Stefano Stabellini [Fri, 15 Feb 2013 13:32:26 +0000 (13:32 +0000)]
xen/vtimer: fixes and improvements

Do not try to save and restore the vtimer for the idle domain.

Inject the vtimer interrupt from the Xen timer handler, taking care of
setting the timer as masked in the ctl field, so that at restore time it
is not going to fire the interrupt again.

No need to disable the vtimer before writing the new offset on restore:
the vtimer is already disabled.

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>
12 years agoxen/arm: drain all the outstanding interrupts before returning from gic_interrupt
Stefano Stabellini [Fri, 15 Feb 2013 13:32:25 +0000 (13:32 +0000)]
xen/arm: drain all the outstanding interrupts before returning from gic_interrupt

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>
12 years agoxen/arm: make lr_mask per_cpu
Stefano Stabellini [Fri, 15 Feb 2013 13:32:24 +0000 (13:32 +0000)]
xen/arm: make lr_mask per_cpu

lr_mask, keeping track of the LR registers in use, should be a per_cpu
variable.

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>
12 years agoxen/arm: just return 0 on XENMEM_get_sharing_shared/freed_pages
Stefano Stabellini [Fri, 15 Feb 2013 13:32:24 +0000 (13:32 +0000)]
xen/arm: just return 0 on XENMEM_get_sharing_shared/freed_pages

memory sharing is not implemented on ARM yet, so just return 0 for now

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>
12 years agoxen/arm: /spin_lock_irq/spin_lock_irqsave in gic_set_guest_irq
Stefano Stabellini [Fri, 15 Feb 2013 13:32:23 +0000 (13:32 +0000)]
xen/arm: /spin_lock_irq/spin_lock_irqsave in gic_set_guest_irq

gic_set_guest_irq can be called with irq disabled

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>