]> xenbits.xensource.com Git - people/iwj/xen.git/log
people/iwj/xen.git
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>
12 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>
12 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 ]

12 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>
12 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>
12 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>
12 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>
12 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>
12 years agoxen/arm: Bump early printk internal buffer to 512
Julien Grall [Fri, 10 May 2013 02:17:50 +0000 (03:17 +0100)]
xen/arm: Bump early printk internal buffer to 512

When debug is enabled in device tree code, some lines
are bigger than 80 characters.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: Remove duplicated GICD_ICPIDR2 definition
Julien Grall [Fri, 10 May 2013 02:17:49 +0000 (03:17 +0100)]
xen/arm: Remove duplicated GICD_ICPIDR2 definition

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: Don't allow dom0 to access to vpl011 UART0 memory range
Julien Grall [Fri, 10 May 2013 02:17:48 +0000 (03:17 +0100)]
xen/arm: Don't allow dom0 to access to vpl011 UART0 memory range

As vpl011 UART is not initialized for dom 0, when the domain tries to access to
this range, a segfault will occur in Xen. The right behaviour should be a data
abort for the guest.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: lr must be included in range [0-nr_lr(
Julien Grall [Fri, 10 May 2013 02:17:47 +0000 (03:17 +0100)]
xen/arm: lr must be included in range [0-nr_lr(

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoarm: cast int<->pointer via uintptr_t
Ian Campbell [Fri, 10 May 2013 13:13:52 +0000 (14:13 +0100)]
arm: cast int<->pointer via uintptr_t

Fixes build on arm64:

gic.c: In function ‘gic_irq_eoi’:
        gic.c:726:16: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
        gic.c: In function ‘maintenance_interrupt’:
        gic.c:776:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        gic.c:778:64: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
        cc1: all warnings being treated as errors
        make[3]: *** [gic.o] Error 1

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 ago.gitignore: Add vim swap files
Julien Grall [Thu, 9 May 2013 16:17:03 +0000 (17:17 +0100)]
.gitignore: Add vim swap files

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- corrected .hgignore regex syntax ]

12 years agoMAINTAINERS: Change tmem maintainer
Konrad Rzeszutek Wilk [Fri, 10 May 2013 08:44:17 +0000 (10:44 +0200)]
MAINTAINERS: Change tmem maintainer

Konrad has graduated to becoming an maintainer in the Xen hypervisor.

Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agox86/mm/shadow: remove dead code for avoiding Xen entries on 32-bit tables.
Tim Deegan [Thu, 2 May 2013 10:37:56 +0000 (11:37 +0100)]
x86/mm/shadow: remove dead code for avoiding Xen entries on 32-bit tables.

All non-external-mode (==PV) guests have 4-level pagetables now that
the PAE build of Xen is gone.

This patch should have no effect, since the condition it removes could
never be true anyway: the l2 offset of HYPERVISOR_VIRT_START on 64-bit
Xen is much higher than any l2 offset we could have seen in the
tables (and indeed bigger than the 'int' type, which clang was
complaining about).  Actual compat PV guest xen entries are handled by
the equivalent test in the 64-bit SHADOW_FOREACH_L2E() below.

Reported-by: Julien Grall <julien.grall@linaro.org>
Signed-off-by: Tim Deegan <tim@xen.org>
12 years agoxen/arm: handle the runstate_memory_area
Stefano Stabellini [Wed, 1 May 2013 19:32:28 +0000 (20:32 +0100)]
xen/arm: handle the runstate_memory_area

Support VCPUOP_register_runstate_memory_area on ARM.
Update_runstate_area on context switch.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen: move VCPUOP_register_runstate_memory_area to common code
Stefano Stabellini [Wed, 1 May 2013 19:32:27 +0000 (20:32 +0100)]
xen: move VCPUOP_register_runstate_memory_area to common code

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoxen/arm: initialize vtimer offset to CNTPCT
Stefano Stabellini [Wed, 8 May 2013 11:41:15 +0000 (12:41 +0100)]
xen/arm: initialize vtimer offset to CNTPCT

Currently we initialize the vtimer offset to

CNTVCT + CNTVOFF = CNTPCT - CNTVOFF + CNTVOFF = CNTPCT

Simply initialize vtimer offset to CNTPCT.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: clear pending irq queues on do_psci_cpu_on
Stefano Stabellini [Wed, 8 May 2013 11:41:14 +0000 (12:41 +0100)]
xen/arm: clear pending irq queues on do_psci_cpu_on

Don't inject irqs to vcpus that are down.

Also when (re)activating a vcpu, clear the vgic and gic irq queues: we
don't want to inject any irqs that couldn't be handled by the vcpu right
before going offline.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: initialize virt_timer and phys_timer with the same values on all vcpus
Stefano Stabellini [Wed, 8 May 2013 11:41:13 +0000 (12:41 +0100)]
xen/arm: initialize virt_timer and phys_timer with the same values on all vcpus

Introduce a domain wide vtimer initialization function to initialize
the phys_timer and the virt_timer offsets.

Use the domain phys_timer and virt_timer offsets throughout the vtimer
code instead of the per-vcpu offsets.

Remove the per-vcpu offsets from struct vtimer altogether.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: run the vtimer Xen timers on the pcpu the vcpu is running on
Stefano Stabellini [Wed, 8 May 2013 11:41:12 +0000 (12:41 +0100)]
xen/arm: run the vtimer Xen timers on the pcpu the vcpu is running on

The Xen physical timer emulator and virtual timer driver use two
internal Xen timers: initialize them on the pcpu the vcpu is running on,
rather than the processor that it's creating the vcpu.

On vcpu restore migrate the phys_timer and the virt_timer to the
pcpu the vcpu is running on.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus
Stefano Stabellini [Wed, 8 May 2013 11:41:11 +0000 (12:41 +0100)]
xen/arm: send IPIs to inject irqs into guest vcpus running on different pcpus

If we need to inject an irq into a VCPU that is running on a different
processor, we shouldn't just enqueue the irq into the lr_pending and
inflight lists and wait for something to interrupt the guest execution.
Send an IPI to the target pcpu so that Xen can inject the new interrupt
returning to guest.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: support VCPUOP_register_vcpu_info.
Stefano Stabellini [Wed, 8 May 2013 11:41:10 +0000 (12:41 +0100)]
xen/arm: support VCPUOP_register_vcpu_info.

We don't want to support the full vcpu_op hypercall interface, just
VCPUOP_register_vcpu_info: introduce an internal ARM-only
do_arm_vcpu_op function to filter out the vcpu_op hypercalls that
we don't want to support.
Call do_arm_vcpu_op instead of do_vcpu_op from traps.c.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen: move VCPUOP_register_vcpu_info to common code
Stefano Stabellini [Wed, 8 May 2013 11:41:09 +0000 (12:41 +0100)]
xen: move VCPUOP_register_vcpu_info to common code

Move the implementation of VCPUOP_register_vcpu_info from x86 specific
to commmon code.

Move vcpu_info_mfn from an arch specific vcpu sub-field to the common
vcpu struct.
Move the initialization of vcpu_info_mfn to common code.

Move unmap_vcpu_info and the call to unmap_vcpu_info at domain
destruction time to common code.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoRemove traces of IA-64 architecture support
Daniel Kiper [Tue, 7 May 2013 11:51:48 +0000 (13:51 +0200)]
Remove traces of IA-64 architecture support

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoRemove tools/libaio/src/syscall-ia64.h file
Daniel Kiper [Tue, 7 May 2013 11:51:47 +0000 (13:51 +0200)]
Remove tools/libaio/src/syscall-ia64.h file

There is no support for IA-64 architecture in Xen.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoSilently ignore rm and include errors during make distclean
Daniel Kiper [Tue, 7 May 2013 11:51:46 +0000 (13:51 +0200)]
Silently ignore rm and include errors during make distclean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agodocs: Remove tmp files during make clean
Daniel Kiper [Tue, 7 May 2013 11:51:45 +0000 (13:51 +0200)]
docs: Remove tmp files during make clean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agostubdom/vtpm: Silently ignore rm errors during make clean
Daniel Kiper [Tue, 7 May 2013 11:51:44 +0000 (13:51 +0200)]
stubdom/vtpm: Silently ignore rm errors during make clean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
12 years agostubdom: Do not create dangling links
Daniel Kiper [Tue, 7 May 2013 11:51:43 +0000 (13:51 +0200)]
stubdom: Do not create dangling links

There is not architecture dependent files in libxc
hence do not create dangling links.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
12 years agostubdom: Remove xenstore directory during make crossclean
Daniel Kiper [Tue, 7 May 2013 11:51:42 +0000 (13:51 +0200)]
stubdom: Remove xenstore directory during make crossclean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
12 years agostubdom: Clean extras/mini-os directory during make clean
Daniel Kiper [Tue, 7 May 2013 11:51:41 +0000 (13:51 +0200)]
stubdom: Clean extras/mini-os directory during make clean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
12 years agotools/xenstat/libxenstat: Remove src/libxenstat.a file during make clean
Daniel Kiper [Tue, 7 May 2013 11:51:40 +0000 (13:51 +0200)]
tools/xenstat/libxenstat: Remove src/libxenstat.a file during make clean

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agotools/xenmon: Fix typo in Makefile
Daniel Kiper [Tue, 7 May 2013 11:51:39 +0000 (13:51 +0200)]
tools/xenmon: Fix typo in Makefile

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agotools/debugger/kdd: Remove dependencies files during make clean
Daniel Kiper [Tue, 7 May 2013 11:51:38 +0000 (13:51 +0200)]
tools/debugger/kdd: Remove dependencies files during make clean

Remove dependencies files during make clean.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agolibxl: don't write physical-device node for driver domain disks
Roger Pau Monne [Fri, 3 May 2013 11:23:03 +0000 (13:23 +0200)]
libxl: don't write physical-device node for driver domain disks

This will be handled by the driver domain itself, since the toolstack
does not have access to the physical device because it is in a
different domain.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agolibxl: don't execute hotplug scripts if device is on a driver domain
Roger Pau Monne [Fri, 3 May 2013 11:23:02 +0000 (13:23 +0200)]
libxl: don't execute hotplug scripts if device is on a driver domain

Prevent hotplug script execution from libxl if device is on a
different domain.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agolibxl: correctly parse storage devices on driver domains
Roger Pau Monne [Fri, 3 May 2013 11:23:01 +0000 (13:23 +0200)]
libxl: correctly parse storage devices on driver domains

Don't try to check physical devices if they belong to a domain
different than the one where the toolstack is running. This prevents
the following error when trying to use storage driver domains:

libxl: debug: libxl_create.c:1246:do_domain_create: ao 0x1819240: create: how=(nil) callback=(nil) poller=0x1818fa0
libxl: debug: libxl_device.c:235:libxl__device_disk_set_backend: Disk vdev=xvda spec.backend=phy
libxl: debug: libxl_device.c:175:disk_try_backend: Disk vdev=xvda, backend phy unsuitable as phys path not a block device
libxl: error: libxl_device.c:278:libxl__device_disk_set_backend: no suitable backend for disk xvda

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agodocs: canonicalize representation of boolean type in xl.cfg
Wei Liu [Tue, 7 May 2013 11:28:54 +0000 (12:28 +0100)]
docs: canonicalize representation of boolean type in xl.cfg

The representations of boolean type in xl docs are inconsistent. This patch
replaces occurences of "1", "0", "[Tt]rue" and "[Ff]alse" with "[Tt]rue (1)"
and "[Ff]alse (0)".

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agohotplug/Linux: add iscsi block hotplug script
Roger Pau Monne [Thu, 2 May 2013 11:38:55 +0000 (13:38 +0200)]
hotplug/Linux: add iscsi block hotplug script

This hotplug script has been tested with IET and NetBSD iSCSI targets,
without authentication.

This hotplug script will only work with PV guests not using pygrub.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoxen/gic: EOI irqs on the right pcpu
Stefano Stabellini [Tue, 7 May 2013 13:33:08 +0000 (14:33 +0100)]
xen/gic: EOI irqs on the right pcpu

We need to write the irq number to GICC_DIR on the physical cpu that
previously received the interrupt, but currently we are doing it on the
pcpu that received the maintenance interrupt. As a consequence if a
vcpu is migrated to a different pcpu, the irq is going to be EOI'ed on
the wrong pcpu.

This covers the case where dom0 vcpu0 is running on pcpu1 for example
(you can test this scenario by using xl vcpu-pin).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: implement smp_call_function
Julien Grall [Tue, 7 May 2013 11:05:06 +0000 (12:05 +0100)]
xen/arm: implement smp_call_function

Move smp_call_function and on_selected_cpus to common code.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoxen/arm: implement map_domain_page_global and unmap_domain_page_global
Stefano Stabellini [Tue, 7 May 2013 14:12:44 +0000 (15:12 +0100)]
xen/arm: implement map_domain_page_global and unmap_domain_page_global

The implementation uses vmap and vunmap.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: compile and initialize vmap
Stefano Stabellini [Tue, 7 May 2013 14:12:43 +0000 (15:12 +0100)]
xen/arm: compile and initialize vmap

Rename EARLY_VMAP_VIRT_END and EARLY_VMAP_VIRT_START to
VMAP_VIRT_END and VMAP_VIRT_START.

Defining VMAP_VIRT_START triggers the compilation of common/vmap.c.

Define PAGE_HYPERVISOR and MAP_SMALL_PAGES (unused on ARM, because we
only support 4K pages so as a matter of fact it is always set).

Implement map_pages_to_xen and destroy_xen_mappings.

Call vm_init from start_xen.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: implement arch_vmap_virt_end
Stefano Stabellini [Tue, 7 May 2013 14:12:42 +0000 (15:12 +0100)]
xen/arm: implement arch_vmap_virt_end

Move virt_start out of ioremap and rename it to early_vmap_start.
Implement arch_vmap_virt_end by returning early_vmap_start.

Allocate virtual addresses in early_ioremap from top to bottom so that
later on when we initialize vmap, we can return the end of the vmap
address space (the last address allocated by early_ioremap).

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: support for guest SGI
Stefano Stabellini [Tue, 7 May 2013 14:12:41 +0000 (15:12 +0100)]
xen/arm: support for guest SGI

Trap writes to GICD_SGIR, parse the requests, inject SGIs into the right
guest vcpu.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen: move for_each_set_bit to xen/bitops.h
Stefano Stabellini [Tue, 7 May 2013 14:12:40 +0000 (15:12 +0100)]
xen: move for_each_set_bit to xen/bitops.h

Move for_each_set_bit from asm-x86/bitops.h to xen/bitops.h.
Replace #include <asm/bitops.h> with #include <xen/bitops.h> everywhere.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoxen/arm: allocate secondaries dom0 vcpus
Stefano Stabellini [Tue, 7 May 2013 14:12:39 +0000 (15:12 +0100)]
xen/arm: allocate secondaries dom0 vcpus

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: basic PSCI support, implement cpu_on and cpu_off
Stefano Stabellini [Tue, 7 May 2013 14:12:38 +0000 (15:12 +0100)]
xen/arm: basic PSCI support, implement cpu_on and cpu_off

Implement support for ARM Power State Coordination Interface, PSCI in
short. Support only HVC calls.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoxen/arm: trap SMC instructions and inject an UND exception
Ian Campbell [Tue, 7 May 2013 14:12:37 +0000 (15:12 +0100)]
xen/arm: trap SMC instructions and inject an UND exception

Currently only handles 32 bit guests. The 64-bit exception model is
considerably different.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
12 years agoxen/arm: trap guest WFI
Stefano Stabellini [Wed, 1 May 2013 10:32:59 +0000 (11:32 +0100)]
xen/arm: trap guest WFI

Trap guest WFI, block the guest VCPU unless it has pending interrupts
(WFI should return if any interrupts arrive even if interrupts are
disabled).

Awake the guest vcpu when a new interrupt for it arrives.

Introduce gic_events_need_delivery: it checks whether the current vcpu
has any interrupts that need to be delivered either on the lrs or in
lr_pending.

Properly implement local_events_need_delivery: check if the guest
disabled interrupts, if they aren't disabled, return positive if
gic_events_need_delivery returns positive. Otherwise we still need to
check whether evtchn_upcall_pending is set but no
VGIC_IRQ_EVTCHN_CALLBACK irqs are in flight: it could be the race
described by commit db453468d92369e7182663fb13e14d83ec4ce456 "arm: vgic:
fix race between evtchn upcall and evtchnop_send". If that is the case
it means that an event needs to be injected.
If all these tests are negative then no events need to be delivered.

Implement local_event_delivery_enable by clearing PSR_IRQ_MASK.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agox86: Fix efi directory cleanup
Daniel Kiper [Tue, 7 May 2013 15:02:00 +0000 (17:02 +0200)]
x86: Fix efi directory cleanup

clean target is never called from xen/arch/x86/efi/Makefile.
Move all needed stuff to xen/arch/x86/Makefile
and additionally remove efi.lds.

Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
12 years agonetif: define XEN_NETIF_NR_SLOTS_MIN in public header
Wei Liu [Tue, 7 May 2013 14:54:56 +0000 (16:54 +0200)]
netif: define XEN_NETIF_NR_SLOTS_MIN in public header

Xen network protocol has implicit dependency on MAX_SKB_FRAGS. In order to
remove dependency on MAX_SKB_FRAGS, we derive a constant from historical
MAX_SKB_FRAGS for future reference.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agonetif: define XEN_NETIF_MAX_TX_SIZE in public header
Wei Liu [Tue, 7 May 2013 14:54:44 +0000 (16:54 +0200)]
netif: define XEN_NETIF_MAX_TX_SIZE in public header

This is the maximum supported size of a packet. It comes from the size of
netif_tx_request.size.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
12 years agorename IS_PRIV to is_hardware_domain
Daniel De Graaf [Tue, 7 May 2013 14:51:19 +0000 (16:51 +0200)]
rename IS_PRIV to is_hardware_domain

Since the remaining uses of IS_PRIV are actually concerned with the
domain having control of the hardware (i.e. being the initial domain),
clarify this by renaming IS_PRIV to is_hardware_domain.  This also
removes IS_PRIV_FOR since the only remaining user was xsm/dummy.h.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
Acked-by: Keir Fraser <keir@xen.org>
12 years agocommon: remove rcu_lock_target_domain_by_id
Daniel De Graaf [Tue, 7 May 2013 14:50:28 +0000 (16:50 +0200)]
common: remove rcu_lock_target_domain_by_id

This function (and rcu_lock_remote_target_domain_by_id) has no remaining
users, having been replaced with XSM hooks and the other rcu_lock_*
functions. Remove it.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
Acked-by: Keir Fraser <keir@xen.org>
12 years agoarm: remove rcu_lock_target_domain_by_id users
Daniel De Graaf [Tue, 7 May 2013 14:49:53 +0000 (16:49 +0200)]
arm: remove rcu_lock_target_domain_by_id users

This function has been replaced with rcu_lock_domain_by_any_id and an
XSM check.  Two callers already had an XSM check; add a check to the
third.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
Acked-by: Ian Campbell <ian.campbell@citrix.com> (for thae ARM bits)
12 years agoxsm: add hooks for claim
Daniel De Graaf [Tue, 7 May 2013 14:49:18 +0000 (16:49 +0200)]
xsm: add hooks for claim

Adds XSM hooks for the recently introduced XENMEM_claim_pages and
XENMEM_get_outstanding_pages operations, and adds FLASK access vectors
for them. This makes the access control decisions for these operations
match those in the rest of the hypervisor.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com> (for 4.3 release)
Acked-by: Keir Fraser <keir@xen.org>
12 years agox86: handle paged gfn in wrmsr_hypervisor_regs
Olaf Hering [Tue, 7 May 2013 14:41:24 +0000 (16:41 +0200)]
x86: handle paged gfn in wrmsr_hypervisor_regs

If xenpaging is started very early for a guest the gfn for the hypercall
page may be paged-out already. This leads to a guest crash:

...
(XEN) HVM10: Allocated Xen hypercall page at 169ff000
(XEN) traps.c:654:d10 Bad GMFN 169ff (MFN 3e900000000) to MSR 40000000
(XEN) HVM10: Detected Xen v4.3
(XEN) io.c:201:d10 MMIO emulation failed @ 0008:c2c2c2c2: 18 7c 55 6d 03 83 ff ff 10 7c
(XEN) hvm.c:1253:d10 Triple fault on VCPU0 - invoking HVM shutdown action 1.
(XEN) HVM11: HVM Loader
...

Update return codes of wrmsr_hypervisor_regs, update callers to deal
with the new return codes:
 0: not handled
 1: handled
 -EAGAIN: retry

Currently wrmsr_hypervisor_regs will not return the following error, it
will be added in a separate patch:
 -EINVAL: error during handling

Also update the gdprintk to handle a page value of NULL to avoid
printing a bogus MFN value. Update also computing of MSR value in
gdprintk, the idx was always zero.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Keir Fraser <keir@xen.org>
12 years agoAMD IOMMU: fill msi_desc fields required by commit fe017c59
Jan Beulich [Tue, 7 May 2013 14:23:31 +0000 (16:23 +0200)]
AMD IOMMU: fill msi_desc fields required by commit fe017c59

Since the AMD IOMMU code relies on the x86 generic MSI code, it also
needs to be updated to match "x86/MSI: cleanup to prepare for multi-
vector MSI".

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Suravee Suthikulanit <suravee.suthikulpanit@amd.com>
12 years agoConfig.mk: update QEMU_TAG and QEMU_UPSTREAM_REVISION for 4.3.0-rc1 4.3.0-rc1
Ian Jackson [Tue, 7 May 2013 13:01:11 +0000 (14:01 +0100)]
Config.mk: update QEMU_TAG and QEMU_UPSTREAM_REVISION for 4.3.0-rc1

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
12 years agoREADME: update version number
Ian Jackson [Tue, 7 May 2013 12:41:15 +0000 (13:41 +0100)]
README: update version number

Updated the figlet version number to "Xen 4.3-rc".  Also remove the
paragraph touting the benefits of Xen 4.2.  At some point we should
replace it with a paragraph touting the benefits of Xen 4.3.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agotools: Bump some library sonames
Ian Jackson [Tue, 7 May 2013 10:39:10 +0000 (11:39 +0100)]
tools: Bump some library sonames

libxc (libxenctrl, libxenguest):
   New claim_enabled field in struct xc_dom_image;
   New nr_outstanding_pages field in struct xc_dominfo;
   New fields in struct xc_hvm_build_args (xenguest.h).

libxl:
   new fields in dominfo domain_build_info device_vfb device_vkb
     device_disk etc. etc. etc.
   libxlu #includes libxl headers so needs to inherit its new soname
   Use Xen version for new sonames since we don't in fact guarantee
   ABI (as opposed to API) stability across releases.

xenstore (libxenstore):
   New flag XS_UNWATCH_FILTER, so bump minor version only.

This was the result of reviewing the output from:
  git-checkout staging
  cd tools
  git-diff RELEASE-4.2.2 `find -name \*.h`

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
12 years agoapic/iommu: Correct grammar in error message and clarify its meaning
Andrew Cooper [Fri, 3 May 2013 07:33:49 +0000 (09:33 +0200)]
apic/iommu: Correct grammar in error message and clarify its meaning

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
12 years agox86: Fix __prepare_to_wait() asm test for stack size
Keir Fraser [Thu, 2 May 2013 20:04:08 +0000 (21:04 +0100)]
x86: Fix __prepare_to_wait() asm test for stack size

Signed-off-by: Keir Fraser <keir@xen.org>
12 years agolibxl: Don't use tapdisk for cd-roms
George Dunlap [Thu, 2 May 2013 11:03:09 +0000 (12:03 +0100)]
libxl: Don't use tapdisk for cd-roms

blktap does not support the insert / eject commands, and so is not
suitable for cd-roms.

This fixes the bug where libxl uses tapdisk as a cdrom back-end, causing
subsequent eject / insert commands to fail.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
CC: Fabio Fantoni <fabio.fantoni@heliman.it>
CC: Stefano Stabellini <stefano.stabellini@citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
12 years agoVT-d: don't permit SVT_NO_VERIFY entries for known device types
Jan Beulich [Thu, 2 May 2013 15:08:58 +0000 (17:08 +0200)]
VT-d: don't permit SVT_NO_VERIFY entries for known device types

Only in cases where we don't know what to do we should leave the IRTE
blank (suppressing all validation), but we should always log a warning
in those cases (as being insecure).

This is CVE-2013-1952 / XSA-49.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Zhang, Xiantao" <xiantao.zhang@intel.com>
12 years agox86: miscellaneous mm.c cleanup
Jan Beulich [Thu, 2 May 2013 15:05:05 +0000 (17:05 +0200)]
x86: miscellaneous mm.c cleanup

This simply streamlines code in a few places, where room for
improvement was noticed during the earlier here and the patches in
the XSA-45 series.

This also drops the bogus use of the domain lock in the CR3 write
emulation (which protected against nothing).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agox86: cleanup after making various page table manipulation operations preemptible
Jan Beulich [Thu, 2 May 2013 15:04:14 +0000 (17:04 +0200)]
x86: cleanup after making various page table manipulation operations preemptible

This drops the "preemptible" parameters from various functions where
now they can't (or shouldn't, validated by assertions) be run in non-
preemptible mode anymore, to prove that manipulations of at least L3
and L4 page tables and page table entries are now always preemptible,
i.e. the earlier patches actually fulfill their purpose of fixing the
resulting security issue.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
12 years agox86/HVM: fix legacy PIC check in pt_update_irq()
Jan Beulich [Thu, 2 May 2013 14:48:22 +0000 (16:48 +0200)]
x86/HVM: fix legacy PIC check in pt_update_irq()

Depending on the IRQ we need to
- not look at the PIC at all is this is the LAPIC timer (in that case
  we're dealing with a vector number rather than an IRQ one),
- not look at the PIC for any non-legacy interrupt,
- look at the correct PIC for the IRQ (which will always be PIC 2 for
  the RTC, and possibly also for HPET).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
Reviewed-by: Tim Deegan <tim@xen.org>
12 years agox86/HVM: fix processing of RTC REG_B writes
Jan Beulich [Thu, 2 May 2013 14:47:32 +0000 (16:47 +0200)]
x86/HVM: fix processing of RTC REG_B writes

We must store the new values before calling rtc_update_irq(), and we
need to call rtc_timer_update() when PIE transitions from 0 to 1 (as we
may have previously turned off the periodic timer due to the guest not
reading REG_C, and hence may have to re-enable it in order to start
IRQs getting delivered to the guest).

Note that the timer is being kept running if PIE transitions from 1 to
0, to match the behavior of keeping it running for a brief period of
time if the guest doesn't clear PF in time (in order to avoid
permanently destroying and re-creating the periodic timer).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Roger Pau Monné <roger.pau@citrix.com> (FreeBSD guest)
Reviewed-by: Tim Deegan <tim@xen.org>