]> xenbits.xensource.com Git - people/iwj/xen.git/log
people/iwj/xen.git
11 years agox86/MCE: disable if MCE banks are not present master
Aravindh Puthiyaparambil [Mon, 3 Jun 2013 13:42:46 +0000 (15:42 +0200)]
x86/MCE: disable if MCE banks are not present

When booting Xen on VMware ESX 5.1 and Workstation 9, you hit a GPF
during MCE initialization. The culprit is line 631 in
set_poll_bankmask():
                bitmap_copy(mb->bank_map, mca_allbanks->bank_map, nr_mce_banks);

What is happening is that in mca_cap_init(), nr_mce_banks is being set
to 0. This causes the allocation of bank_map to be set to
ZERO_BLOCK_PTR which is the return value for zero-size allocation by
xzalloc_array()/_xmalloc(). This results in the bitmap_copy() to fail
disastrously. The following patch fixes this issue.

Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christoph Egger <chegger@amazon.de>
11 years agotools/libxl: fix array subscript has type 'char'
Christoph Egger [Thu, 30 May 2013 12:24:57 +0000 (14:24 +0200)]
tools/libxl: fix array subscript has type 'char'

Signed-off-by: Christoph Egger <chegger@amazon.de>
11 years agoblkif.h: Document the physical-sector-size extension
Stefan Bader [Fri, 31 May 2013 11:43:30 +0000 (13:43 +0200)]
blkif.h: Document the physical-sector-size extension

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
11 years agoCurrently only a few Intel models have VPMU workaround turned on. It
Boris Ostrovsky [Fri, 31 May 2013 08:06:11 +0000 (10:06 +0200)]
Currently only a few Intel models have VPMU workaround turned on. It
appears, however, that this issue exists on more models than what is
covered by check_pmc_quirk(). Since we don't know exactly which cpus
are affected we should turn this workaround on for all family 6
processors.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Sort-of-Acked-by: "Auld, Will" <will.auld@intel.com>
11 years agoRevert "x86: debugging code for platform timer wrap problem"
Jan Beulich [Fri, 31 May 2013 06:40:03 +0000 (08:40 +0200)]
Revert "x86: debugging code for platform timer wrap problem"

This reverts commit bd9be94eb2280e8e662e75f1e5fea7c12eb2589c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
11 years agox86: fix ordering of operations in destroy_irq()
Jan Beulich [Fri, 31 May 2013 06:35:22 +0000 (08:35 +0200)]
x86: fix ordering of operations in destroy_irq()

The fix for XSA-36, switching the default of vector map management to
be per-device, exposed more readily a problem with the cleanup of these
vector maps: dynamic_irq_cleanup() clearing desc->arch.used_vectors
keeps the subsequently invoked clear_irq_vector() from clearing the
bits for both the in-use and a possibly still outstanding old vector.

Fix this by folding dynamic_irq_cleanup() into destroy_irq(), which was
its only caller, deferring the clearing of the vector map pointer until
after clear_irq_vector().

Once at it, also defer resetting of desc->handler until after the loop
around smp_mb() checking for IRQ_INPROGRESS to be clear, fixing a
(mostly theoretical) issue with the intercation with do_IRQ(): If we
don't defer the pointer reset, do_IRQ() could, for non-guest IRQs, call
->ack() and ->end() with different ->handler pointers, potentially
leading to an IRQ remaining un-acked. The issue is mostly theoretical
because non-guest IRQs are subject to destroy_irq() only on (boot time)
error paths.

As to the changed locking: Invoking clear_irq_vector() with desc->lock
held is okay because vector_lock already nests inside desc->lock (proven
by set_desc_affinity(), which takes vector_lock and gets called from
various desc->handler->ack implementations, getting invoked with
desc->lock held).

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
11 years agoarm: Fix after 54353cae096c "xen/arm: check string format for early_printk"
Julien Grall [Thu, 30 May 2013 20:50:35 +0000 (21:50 +0100)]
arm: Fix after 54353cae096c "xen/arm: check string format for early_printk"

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenballoond: remove as it is now obsolete + unsupported code
Ian Campbell [Mon, 22 Apr 2013 12:14:16 +0000 (13:14 +0100)]
xenballoond: remove as it is now obsolete + unsupported code

Dan, the author, states:
> this code is five years old, is distro dependent, and is now
> completely unsupported.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11 years agolibxl: Remove qxl support for the 4.3 release
George Dunlap [Fri, 24 May 2013 15:20:59 +0000 (16:20 +0100)]
libxl: Remove qxl support for the 4.3 release

The qxl drivers for Windows and Linux end up calling instructions
that cannot be used for MMIO at the moment.  Just for the 4.3 release,
remove qxl support.

This patch should be reverted as soon as the 4.4 development window opens.

The issue in question:

(XEN) emulate.c:88:d18 bad mmio size 16
(XEN) io.c:201:d18 MMIO emulation failed @ 0033:7fd2de390430: f3 0f 6f
19 41 83 e8 403

The instruction in question is "movdqu (%rcx),%xmm3".  Xen knows how
to emulate it, but unfortunately %xmm3 is 16 bytes long, and the interface
between Xen and qemu at the moment would appear to only allow MMIO accesses
of 8 bytes.

It's too late in the release cycle to find a fix or a workaround.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: Fix qemu-xen command line for vcpus numbers.
Anthony PERARD [Wed, 29 May 2013 18:11:15 +0000 (19:11 +0100)]
libxl: Fix qemu-xen command line for vcpus numbers.

On the qemu-xen command line, the number of vcpus initially online and
the number of maximum available vcpus are inverted.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxl: Update example xl.conf with correct name for default script option
George Dunlap [Wed, 29 May 2013 11:53:59 +0000 (12:53 +0100)]
xl: Update example xl.conf with correct name for default script option

We've changed the config option from "vifscript" to "vif.default.script".  This
was changed in the manpage but not in the example xl.conf.

Also move the option down to be with the other vif options.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agogcov: update documentation on coverage.
Frediano Ziglio [Thu, 23 May 2013 13:55:15 +0000 (13:55 +0000)]
gcov: update documentation on coverage.

Fix some spelling.
Add documentation for new xencov_split utility.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agogcov: Add script to split coverage informations.
Frediano Ziglio [Thu, 23 May 2013 13:55:18 +0000 (13:55 +0000)]
gcov: Add script to split coverage informations.

Split coverage informations extracted from xencov utility.
This script accept coverage blob either as file or from input and extract
into files compatible with gcc format (gcda).

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: use Linux-compatible names for sse4 cpuid features
George Dunlap [Fri, 24 May 2013 14:33:27 +0000 (15:33 +0100)]
libxl: use Linux-compatible names for sse4 cpuid features

Linux uses sse4_1 and sse4_2, but at the moment libxl uses '.' instead
of '_'.  This makes it confusing for people looking in Linux's /proc/cpuinfo
to disable features.

Add the Linux feature names, keeping the old ones for compatability.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.camppbell@citrix.com>
11 years agoarm/early-printk: add Calxeda Midway UART support
Andre Przywara [Fri, 24 May 2013 13:47:30 +0000 (15:47 +0200)]
arm/early-printk: add Calxeda Midway UART support

With the help of the previous patches add a stanza to
xen/arch/arm/Rules.mk to specify the UART configuration of the
Calxeda Midway machine.
The information has been taken from the Linux kernel's .dts file.
This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to
Config.mk.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoarm/early-printk: add support for ARM Fastmodel
Andre Przywara [Fri, 24 May 2013 13:47:29 +0000 (15:47 +0200)]
arm/early-printk: add support for ARM Fastmodel

Though the ARM Fastmodel software emulator mimics a Versatile Express
board, the boot process is different compared to the real hardware,
so the early printk differs slightly. Create a new early-printk
target to model this correctly.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoarm/early-printk: move UART base address to Rules.mk
Andre Przywara [Fri, 24 May 2013 13:47:28 +0000 (15:47 +0200)]
arm/early-printk: move UART base address to Rules.mk

The UART memory mapped base address is currently hardcoded in the
early-printk UART driver, which denies the driver to be used by
two machines with a different mapping.
Move this definition out to xen/arch/arm/Rules.mk, allowing easier
user access and later sharing of the driver.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoarm/early-printk: allow skipping of UART init
Andre Przywara [Fri, 24 May 2013 13:47:27 +0000 (15:47 +0200)]
arm/early-printk: allow skipping of UART init

While it seems obvious to initialize the UART before using it, chances
are that some firmware code or the bootloader already did this.
So it may actually be a good idea to skip the initialization, in fact
this fixes early printk on my TC2 Versatile Express.
So provide an option in xen/arch/arm/Rules.mk to only initialize the
UART when needed.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoarm/early-printk: calculate baud rate divisor from user provided value
Andre Przywara [Fri, 24 May 2013 13:47:26 +0000 (15:47 +0200)]
arm/early-printk: calculate baud rate divisor from user provided value

For early-printk the used baud rate was hardcoded in the code, using
precalculated divisor values.
Let the calculation of these values be done by the preprocessor and
use a human readable value in xen/arch/arm/Rules.mk to drive this.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: check string format for early_printk
Julien Grall [Thu, 23 May 2013 15:05:18 +0000 (16:05 +0100)]
xen/arm: check string format for early_printk

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: avoid lost characters with early_printk
Julien Grall [Thu, 23 May 2013 14:50:11 +0000 (15:50 +0100)]
xen/arm: avoid lost characters with early_printk

Introduce the function early_flush to wait until the UART has finished to
transfer the character.
When early printk is enabled, it's possible to loose the last characters if:
    - the UART is initialized by the UART driver
    - Xen hang

This is result to a truncated message. To be sure that the message is fully
transfered by early_printk, add a call to early_flush. This will avoid lost
characters.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxl: Return an error if an empty file is passed to cd-insert
George Dunlap [Tue, 14 May 2013 10:07:14 +0000 (11:07 +0100)]
xl: Return an error if an empty file is passed to cd-insert

Two changes:
* Stat the file before calling libxl_cdrom_insert()
* Return an error if anything fails (including libxl_cdrom_insert)

This is in part to work around the fact that the RAW disk type
is used for things that aren't actually files; so we can't call
stat in libxl_device.c:libxl__device_disk_set_backend() because
it may be going over a remote protocol.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agostubdom: Make stubdom buildsystem consistent with tools buildsystem
Christoph Egger [Mon, 13 May 2013 08:24:31 +0000 (10:24 +0200)]
stubdom: Make stubdom buildsystem consistent with tools buildsystem

Use FETCHER for stubdom, too. This makes stubdom buildsystem
more consistent with tools buildsystem.
Fixes toplevel configure failure if wget is not found
independent if we are going to build stubdom or not.

Signed-off-by: Christoph Egger <chegger@amazon.de>
Reviewed-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem
Konrad Rzeszutek Wilk [Fri, 24 May 2013 13:36:16 +0000 (09:36 -0400)]
xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem

The code had an obvious bug where it would assume that the balloon
amount would always be _something_ and add an E820_RAM entry at the
end of the E820 array. The added E820_RAM would contain the balloon amount
plus the delta of memory that had to be subtracted b/c of the various
E820 entries. That assumption is certainly true when maxmem != mem,
but if guest config has maxmem = memory that is incorrect (as balloon
value is zero). The end result is that the E820 that is constructed
is missing a swath of "delta" memory and in most cases ends up with
only one E820_RAM entry that is of 512MB size on many Intel systems.

Reported-by: Christian Holpert <christian@holpert.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxc: limit cpu values when setting vcpu affinity 4.3.0-rc3
Ian Jackson [Wed, 29 May 2013 14:48:11 +0000 (15:48 +0100)]
libxc: limit cpu values when setting vcpu affinity

When support for pinning more than 64 cpus was added, check for cpu
out-of-range values was removed. This can lead to subsequent
out-of-bounds cpumap array accesses in case the cpu number is higher
than the actual count.

This patch returns the check.

This is CVE-2013-2072 / XSA-56

Signed-off-by: Petr Matousek <pmatouse@redhat.com>
11 years agox86: re-enable VCPUOP_register_vcpu_time_memory_area
Jan Beulich [Mon, 27 May 2013 06:59:38 +0000 (08:59 +0200)]
x86: re-enable VCPUOP_register_vcpu_time_memory_area

By moving the call to update_vcpu_system_time() out of schedule() into
arch-specific context switch code, the original problem of the function
accessing the wrong domain's address space goes away (obvious even from
patch context, as update_runstate_area() does similar copying).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoMerge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging
Ian Campbell [Thu, 23 May 2013 13:23:32 +0000 (14:23 +0100)]
Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

11 years agodrivers/exynos4210: Return -ENOMEM when ioremap has failed
Julien Grall [Wed, 22 May 2013 11:43:12 +0000 (12:43 +0100)]
drivers/exynos4210: Return -ENOMEM when ioremap has failed

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Disable interrupts for the entire duration of the context switch
Jaeyong Yoo [Wed, 22 May 2013 02:34:18 +0000 (02:34 +0000)]
xen/arm: Disable interrupts for the entire duration of the context switch

Not just while saving state. Otherwise there is a race between interrupts
arriving and updating the LR state and gic_restore_state overwriting them with
the saved state.

With this change we no longer need to disable interrupts in gic_restore_state.

Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ ijc -- rewrote commit message ]

11 years agox86/EFI: fix boot for pre-UEFI systems
Eric Shelton [Thu, 23 May 2013 11:08:51 +0000 (13:08 +0200)]
x86/EFI: fix boot for pre-UEFI systems

efi/boot.c makes a call to QueryVariableInfo on all systems.  However,
as it is only promised for UEFI 2.0+ systems, pre-UEFI systems can
hang or crash on this call.  The below patch adds a version check, a
technique used in other parts of the Xen EFI codebase.

Signed-off-by: Eric Shelton <eshelton@pobox.com>
Check runtime services version instead of EFI version (while generally
they would be in sync, nothing requires them to be).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
11 years agox86: fix boot time APIC mode detection
Jan Beulich [Thu, 23 May 2013 11:08:32 +0000 (13:08 +0200)]
x86: fix boot time APIC mode detection

current_cpu_data becomes valid only relatively late in the boot
process, so looking there for a particular feature early in the game
would generally give the appearance of the feature being unavailable.

Getting this wrong means that at kexec time the system would get
returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
the APIC page, which on systems with x2APIC pre-enabled will never get
set up.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
11 years agohotplug/Linux: xendomains compatibility with xl
Ian Murray [Thu, 23 May 2013 10:33:34 +0000 (11:33 +0100)]
hotplug/Linux: xendomains compatibility with xl

The xl save file uses a different header string to the xm one. Teach the
xendomains script about it.

Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- rewrote commit message ]

11 years agoxen/arm: Remove leading +1 when hypervisor compat property is created
Julien Grall [Thu, 16 May 2013 22:34:11 +0000 (23:34 +0100)]
xen/arm: Remove leading +1 when hypervisor compat property is created

When a static array with string is created, the size of this array contains
the \0.

This error was raised with gcc 4.7 because, the local variables are not always
initialized to 0.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
11 years agonetif: document feature-split-event-channel
Wei Liu [Wed, 22 May 2013 14:44:45 +0000 (16:44 +0200)]
netif: document feature-split-event-channel

This is a new feature to separate TX and RX notification. Document it in
canonical header for future reference.

For reference implementation, please see Xen network driver in Linux kernel.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
11 years agoAMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
Andrew Cooper [Wed, 22 May 2013 13:26:52 +0000 (15:26 +0200)]
AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers

Reference at time of patch:
http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf

Erratum 64 states that the head and tail pointers for the Command buffer and
Event log are only reset on a cold boot, not a warm boot.

While the erratum is limited to systems using SR56xx chipsets (such as Family
10h CPUs), resetting the pointers is a sensible action in all cases, including
the PPR log for consistency.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
11 years agox86: Use explicit widths for MMIO read/write, and add 64bit variants
Andrew Cooper [Wed, 22 May 2013 13:25:37 +0000 (15:25 +0200)]
x86: Use explicit widths for MMIO read/write, and add 64bit variants

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoQEMU_TAG update
Ian Jackson [Tue, 21 May 2013 14:00:01 +0000 (15:00 +0100)]
QEMU_TAG update

11 years agoQEMU_TAG update
Ian Jackson [Tue, 21 May 2013 10:50:57 +0000 (11:50 +0100)]
QEMU_TAG update

11 years agofix XSA-46 regression with xend/xm
Jan Beulich [Tue, 21 May 2013 09:32:34 +0000 (11:32 +0200)]
fix XSA-46 regression with xend/xm

The hypervisor side changes for XSA-46 require the tool stack to now
always map the guest pIRQ before granting access permission to the
underlying host IRQ (GSI). This in particular requires that pciif.py
no longer can skip this step (assuming qemu would do it) for HVM
guests.

This in turn exposes, however, an inconsistency between xend and qemu:
The former wants to always establish 1:1 mappings between pIRQ and host
IRQ (for non-MSI only of course), while the latter always wants to
allocate an arbitrary mapping. Since the whole tool stack obviously
should always agree on the mapping model, make libxc enforce the 1:1
mapping as the more natural one (as well as being the one that allows
for easier debugging, since there no need to find out the extra
mapping). Users of libxc that want to establish a particular (rather
than an allocated) mapping are still free to do so, as well as tool
stacks not based on libxc wanting to implement an allocation based
model (which is why it's not the hypervisor that's being changed to
enforce either model).

Since libxl, like xend, already uses a 1:1 model, it's unaffected by
the libxc change (and it being unaffected by the original hypervisor
side changes is - afaict - simply due to qemu getting spawned at a
later point in time compared to the xend event flow).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
11 years agotools: fix dependency file generation
Jan Beulich [Tue, 21 May 2013 08:16:30 +0000 (10:16 +0200)]
tools: fix dependency file generation

There is a small set of places where files in subdirectories get
compiled from the parent directory. Dependency file wise this is no
problem as long as the files use names distinct without regard to the
directories they sit in, and tools/console/ violates this (in having
two main.c files). Hence we need to avoid losing the directory name,
both to ensure the two compiler instances don't simultaneously write
to the same file (happening of which is what triggered me looking
into this) and to guarantee dependencies for all files will be seen
by make on an incremental rebuild.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agox86/HVM: RTC code must be in line with WAET flags passed by hvmloader
Jan Beulich [Tue, 21 May 2013 08:15:13 +0000 (10:15 +0200)]
x86/HVM: RTC code must be in line with WAET flags passed by hvmloader

With hvmloader telling the guest that it may skip REG_C reads during
the processing of RTC interrupts, the emulation code must not depend
upon these reads to occur. Introduce two modes of operation for the
emulation code, and short of a HVM parameter (too late to be
introduced for 4.3) hard code the mode determination to always assume
that Windows-conforming one for the time being.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
11 years agox86/HVM: properly handle RTC periodic timer even when !RTC_PIE
Jan Beulich [Tue, 21 May 2013 08:14:21 +0000 (10:14 +0200)]
x86/HVM: properly handle RTC periodic timer even when !RTC_PIE

Since in that case the processing it pt_intr_post() won't occur, we
need to do some additional work in pt_update_irq(). Additionally we
must not pay attention to the respective IRQ being masked.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
11 years agox86/HVM: adjust IRQ (de-)assertion
Jan Beulich [Tue, 21 May 2013 08:12:50 +0000 (10:12 +0200)]
x86/HVM: adjust IRQ (de-)assertion

De-assertion should only happen when RTC_IRQF gets cleared, i.e. upon
REG_C reads. Assertion should be done only when the flag transitions
from 0 to 1.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
11 years agox86/hvm: avoid p2m lookups for vlapic accesses. 4.3.0-rc2 xen-4.3.0-rc2
Tim Deegan [Thu, 9 May 2013 12:06:53 +0000 (13:06 +0100)]
x86/hvm: avoid p2m lookups for vlapic accesses.

The LAPIC base address is a known GFN, so we can skip looking up the
p2m: we know it should be handled as emulated MMIO.  That helps
performance in older Windows OSes, which make a _lot_ of TPR accesses.

This will change the behaviour of any OS that maps other
memory/devices at its LAPIC address; the new behaviour (the LAPIC
mapping always wins) is closer to actual hardware behaviour.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
11 years agox86/vMCE: remove is_vmce_ready check
Liu Jinsong [Thu, 16 May 2013 08:34:42 +0000 (10:34 +0200)]
x86/vMCE: remove is_vmce_ready check

Remove is_vmce_ready() check since
1. it's problematic and overkilled: it checks if virq bind to dom0 mcelog
driver. That's not correct, since mcelog is just a dom0 driver used to log
error info, irrelated to dom0 vmce injection. It's also overkilled, defaulty
dom0 disabled mcelog driver, under such case this checking would resulting
in system crash:
(XEN) MCE: This error page is ownded by DOM 0
(XEN) DOM0 not ready for vMCE
(XEN) domain_crash called from mcaction.c:133
(XEN) Domain 0 reported crashed by domain 32767 on cpu#31:
(XEN) Domain 0 crashed: rebooting machine in 5 seconds.
(XEN) Resetting with ACPI MEMORY or I/O RESET_REG.

2. it's redundant: hypervisor in fact has checked
1). whether dom0 vmce ready or not (at inject_vmce()), via checking
    vmce trap callback, to make sure vmce injection OK;
2). whether dom0 mcelog driver ready or not (at mce_softirq()), via
    virq binding, to make sure error log works;

3. it's deprecated: for hvm, it checks whether guest vcpu has different
virtual family/model with that of host pcpu --> that's deprecated, since
vMCE has changed a lot, not bound to host MCE any more.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: Christoph Egger <chegger@amazon.de>
11 years agox86/shadow: fix off-by-one in MMIO permission check
Jan Beulich [Wed, 15 May 2013 12:34:05 +0000 (14:34 +0200)]
x86/shadow: fix off-by-one in MMIO permission check

iomem_access_permitted() wants an inclusive range as input.

Also use pfn_to_paddr() in nearby code instead of open coding it.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
11 years agox86/IO-APIC: fix guest RTE write corner cases
Jan Beulich [Wed, 15 May 2013 08:52:02 +0000 (10:52 +0200)]
x86/IO-APIC: fix guest RTE write corner cases

This fixes two regressions from c/s 20143:a7de5bd776ca ("x86: Make the
hypercall PHYSDEVOP_alloc_irq_vector hypercall dummy"):

For one, IRQs that had their vector set up by Xen internally without a
handler ever having got set (e.g. via "com<n>=..." without a matching
consumer option like "console=com<n>") would wrongly call
add_pin_to_irq() here, triggering the BUG_ON() in that function.

Second, when assign_irq_vector() fails this addition to irq_2_pin[]
needs to be undone.

In the context of this I'm also surprised that the irq_2_pin[]
manipulations here occur without any lock, i.e. rely on Dom0 to do
some sort of serialization.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoXen Power Management Maintainer
Liu Jinsong [Wed, 15 May 2013 08:51:20 +0000 (10:51 +0200)]
Xen Power Management Maintainer

Separate Xen ACPI and Xen Power Management, co-maintain Xen Power Management.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: "Wang, Winston L" <winston.l.wang@intel.com>
Acked-by: "Wei, Gang" <gang.wei@intel.com>
Make the affected file lists a little more precise.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
11 years agoXen Machine Check (MCA) & RAS Maintainer
Liu Jinsong [Wed, 15 May 2013 08:48:26 +0000 (10:48 +0200)]
Xen Machine Check (MCA) & RAS Maintainer

Co-maintain Xen Machine Check (MCA) & RAS

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Acked-by: Christoph Egger <chegger@amazon.de>
Acked-by: Yunhong Jiang <yunhong.jiang@intel.com>
11 years agoxen/arm: support "arm, armv8-timer" DTS compatibility.
Ian Campbell [Mon, 13 May 2013 16:23:01 +0000 (17:23 +0100)]
xen/arm: support "arm, armv8-timer" DTS compatibility.

On v8 the compatibility name differs but the node is otherwise specified the
same. See linux/Documentation/devicetree/bindings/arm/arch_timer.txt

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
11 years agoxen/arm64: do not clobber callee saved register in early_putch
Ian Campbell [Mon, 13 May 2013 16:23:00 +0000 (17:23 +0100)]
xen/arm64: do not clobber callee saved register in early_putch

x23 is callee saved in the ARM 64 bit calling convention. Use x15 instead
which is a temporary register which need not be preserved.

Fixes a random crash during boot.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
11 years agoxen/arm: Add emacs magic blocks to asm files
Ian Campbell [Mon, 13 May 2013 16:22:59 +0000 (17:22 +0100)]
xen/arm: Add emacs magic blocks to asm files

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
11 years agolibxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.
Konrad Rzeszutek Wilk [Mon, 13 May 2013 19:29:14 +0000 (15:29 -0400)]
libxl: Make 'xl vcpu-set' work properly on overcommited hosts with an override.

The libxl_cpu_bitmap_alloc(..) function, if provided with a zero
value for max CPUs will call xc_get_max_cpus() which will retrieve
the number of physical CPUs the host has. This is usually
OK if the guest's maxvcpus <= host pcpus. But if the value
is different, then the bitmap for VCPUs is limited by the
number of CPUs the host has.

This is incorrect as what we want is to hotplug in the guest
the amount of CPUs that the user specified on the command line
and not be limited by the amount of physical CPUs.

This means that a guest config like this:

vcpus=8
maxvcpus=32

and on a 4 PCPU machine doing

xl vcpu-set <guest name> 16

won't work. This is b/c the the size of the bitmap is one byte
so it can only hold up to 8 VCPUs. Hence anything above that
is going to be ignored.

Note that this patch also fixes the bitmap setting - as it
would set all of the bits allowed. Meaning if the user had a 4PCPU
host we would still allow the user to set 8VCPUs. This second
iteration of the patch fixes this.

Note that all of the libxl_cpu_bitmap_[test|set] silently ignore
any test or sets above its size:

     if (bit >= bitmap->size * 8)
         return 0;

so we were never notified off this bug.

This patch warns the user if they are trying to do this. If the
user really wants to do this they have to provide the --ignore-host
parameter to bypass this check.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
11 years agolibxl: claim: Print the values in 'xl info' unconditionally
Konrad Rzeszutek Wilk [Mon, 13 May 2013 19:29:13 +0000 (15:29 -0400)]
libxl: claim: Print the values in 'xl info' unconditionally

During the review of "libxl: Change claim_mode from bool to int."
Ian Campbell suggested that the xl info should print the
claim information irregardless of the global claim_mode value.

Suggested-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
11 years agolibxl: Change claim_mode from bool to int.
Konrad Rzeszutek Wilk [Mon, 13 May 2013 19:29:12 +0000 (15:29 -0400)]
libxl: Change claim_mode from bool to int.

During the review it was noticed that it would be better if internally
the claim_mode was held as an 'int' instead of a 'bool'. The reason
is that during the startup of xl, one has call the libxl_defbool_setdefault.
otherwise any usage of claim_mode would result in assert break.

The assert is due to the fact that using defbool without any set
values (either true of false) will cause it hit an assertion.

If we use an 'int' we don't have to worry about it and by default
the value of zero will suffice for checks whether the claim is
enabled or disabled.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
11 years agohypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data...
Konrad Rzeszutek Wilk [Mon, 13 May 2013 19:29:11 +0000 (15:29 -0400)]
hypervisor/xen/tools: Remove the XENMEM_get_oustanding_pages and provide the data via xc_phys_info

During the review of the patches it was noticed that there exists
a race wherein the 'free_memory' value consists of information from
two hypercalls. That is the XEN_SYSCTL_physinfo and XENMEM_get_outstanding_pages.

The free memory the host has available for guest is the difference between
the 'free_pages' (from XEN_SYSCTL_physinfo) and 'outstanding_pages'. As they
are two hypercalls many things can happen in between the execution of them.

This patch resolves this by eliminating the XENMEM_get_outstanding_pages
hypercall and providing the free_pages and outstanding_pages information
via the xc_phys_info structure.

It also removes the XSM hooks and adds locking as needed.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir.xen@gmail.com>
11 years agoUpdate SEABIOS_UPSTREAM_TAG
Ian Campbell [Fri, 10 May 2013 11:09:24 +0000 (12:09 +0100)]
Update SEABIOS_UPSTREAM_TAG

Pull in two fixes for newer IASL compilers.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
11 years agoUse {git, hg, svn} commit id if available for xen_changeset
Marek Marczykowski [Wed, 8 May 2013 23:07:05 +0000 (01:07 +0200)]
Use {git, hg, svn} commit id if available for xen_changeset

As Xen uses git as primary repository, get git commit id for
xen_changeset info.

Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoalso move compat mode VCPUOP_register_vcpu_info into common code
Jan Beulich [Mon, 13 May 2013 12:36:06 +0000 (14:36 +0200)]
also move compat mode VCPUOP_register_vcpu_info into common code

Otherwise, with arch_compat_vcpu_op() calling arch_do_vcpu_op() to
handle it, it results in -ENOSYS after 6ff9e4f7 ("xen: move
VCPUOP_register_vcpu_info to common code") for 32-bit x86 domains.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoxen/arm64: Remove hardcoded value for gic in assembly code
Julien Grall [Sun, 28 Apr 2013 20:14:21 +0000 (21:14 +0100)]
xen/arm64: Remove hardcoded value for gic in assembly code

- arm64: use V2M_GIC_BASE_ADDRESS
- only expose GIC_*_ADDRESS to assembly. The C code uses base addresses
provide by the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: WORKAROUND Support kick cpus and switch to hypervisor for the exynos5
Julien Grall [Sun, 28 Apr 2013 20:07:20 +0000 (21:07 +0100)]
xen/arm: WORKAROUND Support kick cpus and switch to hypervisor for the exynos5

Use machine ID to know what is the current board. This value is only given
to the first CPU by the bootloader.

When the exynos 5 starts, there is only one CPU up. Xen needs to start the
secondary cpu. The latter boots in secure mode.

Theses modifications aim to be removed as soon as possible. It should
be moved either in a platform specific boot-wrapper (which will be start
before Xen), or in the bootloader (assuming U-Boot/Grub will support SMP).

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add platform specific code for the exynos5
Julien Grall [Sun, 28 Apr 2013 19:57:44 +0000 (20:57 +0100)]
xen/arm: Add platform specific code for the exynos5

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add Exynos 4210 UART support for early printk
Anthony PERARD [Sun, 28 Apr 2013 19:56:40 +0000 (20:56 +0100)]
xen/arm: Add Exynos 4210 UART support for early printk

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add Exynos 4210 UART support
Anthony PERARD [Sun, 28 Apr 2013 19:47:52 +0000 (20:47 +0100)]
xen/arm: Add Exynos 4210 UART support

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Don't use pl011 UART by default for early printk
Julien Grall [Sun, 28 Apr 2013 19:14:12 +0000 (20:14 +0100)]
xen/arm: Don't use pl011 UART by default for early printk

Add CONFIG_EARLY_PRINTK options in configs/arm{32,64}.mk to let the user
to choose if he wants to have early output, ie before the console is initialized.

This code is specific for each UART. When CONFIG_EARLY_PRINTK is enabled,
Xen will only be able to run on a board with this UART.

If a developper wants to add support for a new UART, he must implement the
following assembly macro/define:
   - EALY_UART_BASE_ADDRESS: variable which contains the physical base address
   for the UART
   - early_uart_init: initialize the UART
   - early_uart_ready: check and wait until the UART can transmit a new
   character
   - early_uart_transmit: transmit a character

For more details about the parameters of each function,
see arm{32,64}/debug-pl011.inc comments.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Remove setup_irq
Julien Grall [Tue, 7 May 2013 23:20:38 +0000 (00:20 +0100)]
xen/arm: Remove setup_irq

All calls to this function in ARM code have been removed. This function SHOULD
not be used. If someone calls this function, a linking error will occur.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Remove request_irq
Julien Grall [Tue, 7 May 2013 23:18:29 +0000 (00:18 +0100)]
xen/arm: Remove request_irq

All calls to this function in ARM code have been removed. This function SHOULD
not be used. If someone calls this function, a linking error will occur.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add versatile express platform
Julien Grall [Sun, 28 Apr 2013 18:48:29 +0000 (19:48 +0100)]
xen/arm: Add versatile express platform

This platform contains nearly nothing specific except the reset function.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: WORKAROUND 1:1 memory mapping for dom0
Julien Grall [Sat, 27 Apr 2013 21:52:44 +0000 (22:52 +0100)]
xen/arm: WORKAROUND 1:1 memory mapping for dom0

Currently xen doesn't implement SYS MMU. When a device will talk with dom0
with DMA request the domain will use GFN instead of MFN.
For instance on the arndale board, without this patch the network doesn't
work.

The 1:1 mapping is a workaround and MUST be remove as soon as a SYS MMU is
implemented in XEN.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Allow Xen to run on multiple platform without recompilation
Julien Grall [Sat, 27 Apr 2013 22:03:25 +0000 (23:03 +0100)]
xen/arm: Allow Xen to run on multiple platform without recompilation

Xen can include various platform support (ie: exynos5, versatile express...)
and choose during boot time a set of callbacks for the current board.
These callbacks will be called in places where each board can have specific
code. For the moment the callbacks are:
    - platform_init: additional initialization for the platform
    - platform_init_time: some platform (ie: Exynos 5) needs to initialize
    the timer with an uncommon way
    - platform_specific_mapping: add mapping to dom0 which are not specified
    in the device tree
    - platform_reset: reset the platform
    - platform_poweroff: poweroff the platform
    - platform_quirks: list of quirks for a specific board.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Use the device tree to map the address range and IRQ to dom0
Julien Grall [Sat, 27 Apr 2013 21:43:35 +0000 (22:43 +0100)]
xen/arm: Use the device tree to map the address range and IRQ to dom0

- gic_route_irq_to_guest takes a dt_irq instead of an IRQ number
- remove hardcoded address/IRQ

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Use device tree API in pl011 UART driver
Julien Grall [Sat, 27 Apr 2013 20:52:07 +0000 (21:52 +0100)]
xen/arm: Use device tree API in pl011 UART driver

Allow UART driver to retrieve all its information in the device tree.
It's possible to choose the pl011 driver via the Xen command line.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add generic UART to get the device in the device tree
Julien Grall [Sat, 27 Apr 2013 20:02:04 +0000 (21:02 +0100)]
xen/arm: Add generic UART to get the device in the device tree

This generic UART will find the right UART via xen command line
with dtuart=myserial.

"myserial" is the alias of the UART in the device tree. Xen will retrieve
the information via the device tree and call the initialization function for
this specific UART thanks to the device API.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoxen/arm: New callback in uart_driver to get device tree interrupt structure
Julien Grall [Fri, 26 Apr 2013 19:36:35 +0000 (20:36 +0100)]
xen/arm: New callback in uart_driver to get device tree interrupt structure

The existing function serial_irq doesn't allow to retrieve if the interrupt
is edge or level trigger.

Use this function to routes IRQs for all serial ports which Xen is using
to Xen.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce a generic way to use a device from the device tree
Julien Grall [Fri, 26 Apr 2013 19:14:50 +0000 (20:14 +0100)]
xen/arm: Introduce a generic way to use a device from the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Don't hardcode virtual timer IRQs
Julien Grall [Thu, 9 May 2013 17:11:02 +0000 (18:11 +0100)]
xen/arm: Don't hardcode virtual timer IRQs

Define virtual timer IRQs per VCPU

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Don't hardcode VGIC informations
Julien Grall [Fri, 26 Apr 2013 18:53:17 +0000 (19:53 +0100)]
xen/arm: Don't hardcode VGIC informations

- Define VGIC base address per domain. For the moment the base addresses
to dom0 base addresses.
- The number of interrupt lines (ie number of SPIs) is equal to:
    * 0 for guests
    * number of host SPIs for dom0

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Retrieve timer interrupts from the device tree
Julien Grall [Fri, 26 Apr 2013 18:45:26 +0000 (19:45 +0100)]
xen/arm: Retrieve timer interrupts from the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Use hierarchical device tree to retrieve GIC information
Julien Grall [Fri, 26 Apr 2013 18:14:10 +0000 (19:14 +0100)]
xen/arm: Use hierarchical device tree to retrieve GIC information

- Remove early parsing for GIC addresses
- Remove hard coded maintenance IRQ number

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce request_dt_irq
Julien Grall [Tue, 7 May 2013 23:04:07 +0000 (00:04 +0100)]
xen/arm: Introduce request_dt_irq

This function will replace request_irq in a later patch. It takes a dt_irq
as first argument instead of an unsigned int.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce setup_dt_irq
Julien Grall [Tue, 7 May 2013 23:03:07 +0000 (00:03 +0100)]
xen/arm: Introduce setup_dt_irq

This function will replace setup_irq in later patch. It takes a dt_irq
as first argument instead of an unsigned int.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce gic_irq_xlate
Julien Grall [Fri, 26 Apr 2013 16:58:18 +0000 (17:58 +0100)]
xen/arm: Introduce gic_irq_xlate

This function translates an interrupt specifier to an IRQ number and IRQ
type (ie: level trigger, edge trigger,...). It's GIC specific.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce gic_route_dt_irq
Julien Grall [Fri, 26 Apr 2013 16:51:26 +0000 (17:51 +0100)]
xen/arm: Introduce gic_route_dt_irq

This function routes an IRQ to a specific cpu. The IRQ is retrieved via
the device tree.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add helpers to retrieve an interrupt description from the device tree
Julien Grall [Fri, 26 Apr 2013 16:33:01 +0000 (17:33 +0100)]
xen/arm: Add helpers to retrieve an interrupt description from the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add helpers to retrieve an address from the device tree
Julien Grall [Fri, 26 Apr 2013 16:28:21 +0000 (17:28 +0100)]
xen/arm: Add helpers to retrieve an address from the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add helpers to use the device tree
Julien Grall [Fri, 26 Apr 2013 16:09:25 +0000 (17:09 +0100)]
xen/arm: Add helpers to use the device tree

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Create a hierarchical device tree
Julien Grall [Fri, 26 Apr 2013 14:57:22 +0000 (15:57 +0100)]
xen/arm: Create a hierarchical device tree

Add function to parse the device tree and create a hierarchical tree.

This code is based on drivers/of/base.c in linux source.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Add helpers ioreadl/iowritel
Julien Grall [Fri, 10 May 2013 16:24:33 +0000 (17:24 +0100)]
xen/arm: Add helpers ioreadl/iowritel

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Introduce ioremap_attr, ioremap_cache, ioremap_nocache, ioremap_wc
Julien Grall [Wed, 8 May 2013 22:33:23 +0000 (23:33 +0100)]
xen/arm: Introduce ioremap_attr, ioremap_cache, ioremap_nocache, ioremap_wc

Map physical range in virtual memory with a specific mapping attribute.
Also add new mapping attributes for ARM: PAGE_HYPERVISOR_NOCACHE
and PAGE_HYPERVISOR_WC.

This function replaces early_ioremap which is only able to deal with 2Mb
aligned mapping. Therefore, vmap initialization has been moved earlier.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/mm: Align virtual address on PAGE_SIZE in iounmap
Julien Grall [Fri, 10 May 2013 16:22:16 +0000 (17:22 +0100)]
xen/mm: Align virtual address on PAGE_SIZE in iounmap

ioremap function can unlikely return an unaligned virtual address if
the physical address itself is unaligned on a page size.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
[ ijc -- include asm/page.h to fix build error on x86 ]

11 years agoxen/arm: Extend create_xen_entries prototype to take mapping attribute
Julien Grall [Wed, 8 May 2013 22:59:58 +0000 (23:59 +0100)]
xen/arm: Extend create_xen_entries prototype to take mapping attribute

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoMerge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging
Ian Campbell [Mon, 13 May 2013 10:44:02 +0000 (11:44 +0100)]
Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

11 years agox86/EFI: fix build
Jan Beulich [Mon, 13 May 2013 10:07:40 +0000 (12:07 +0200)]
x86/EFI: fix build

... after f6254405 ("xen/arm: compile and initialize vmap") moving the
map_pages_to_xen() declaration.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
11 years agotools/libfsimage: Fix clean and distclean make targets
Daniel Kiper [Fri, 10 May 2013 15:33:54 +0000 (17:33 +0200)]
tools/libfsimage: Fix clean and distclean make targets

If there is a single colon for a given target and the target
is redefined in another place (e.g. in included file) then
make executes only new target and displays following warning:

Makefile:35: warning: overriding commands for target `clean'
tools/libfsimage/common/../../../tools/libfsimage/Rules.mk:25:
warning: ignoring old commands for target `clean'

To cope with that issue define all required targets as double-colon
rules. Additionally, remove some redundant stuff.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agodocs: make 'gmake dist-docs' work
Christoph Egger [Fri, 10 May 2013 14:07:44 +0000 (16:07 +0200)]
docs: make 'gmake dist-docs' work

doc: buildsystem fixes

- use correct pathes (make gmake dist-docs from toplevel directory work)
- configure detects perl as tools/configure does

Signed-off-by: Christoph Egger <chegger@amazon.de>
Reviewed-by: Matthew Wilson <msw@amazon.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- reran autogen.sh ]

11 years agoxen/arm: gic_disable_cpu must be called with interrupts disabled
Julien Grall [Tue, 16 Apr 2013 13:38:27 +0000 (14:38 +0100)]
xen/arm: gic_disable_cpu must be called with interrupts disabled

gic_disable_cpu is only called with interrupt disabled.
Use spin_lock instead of spin_lock_irq and check the function is
called with interrupts disabled.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agodocs: Change cd-insert docs to match behavior
George Dunlap [Fri, 10 May 2013 11:26:14 +0000 (12:26 +0100)]
docs: Change cd-insert docs to match behavior

xl cd-insert takes a plain file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Switch to SYS_STATE_boot right after console setup
Julien Grall [Fri, 10 May 2013 02:17:53 +0000 (03:17 +0100)]
xen/arm: Switch to SYS_STATE_boot right after console setup

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Load dtb after dom0 kernel
Julien Grall [Fri, 10 May 2013 02:17:52 +0000 (03:17 +0100)]
xen/arm: Load dtb after dom0 kernel

On some setup, the first linux page table is at 0x40004000. Xen will load
dom0 device tree at 0x4000100. In case of the device tree is big, linux will
corrupt the device tree.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Fix early_panic when EARLY_PRINTK is disabled
Julien Grall [Fri, 10 May 2013 02:17:51 +0000 (03:17 +0100)]
xen/arm: Fix early_panic when EARLY_PRINTK is disabled

Even if EARLY_PRINTK is not enabled, early_panic must never return.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>