]> xenbits.xensource.com Git - people/vhanquez/xen.git/log
people/vhanquez/xen.git
13 years agox86/mm: Revert changeset 24582:f6c33cfe7333
Andres Lagar-Cavilla [Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)]
x86/mm: Revert changeset 24582:f6c33cfe7333

With synchronized p2m lookups this is no longer needed, and we can lock the p2m
up-front.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tjd-xen@phlegethon.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoRe-order calls to put_gfn() around wait queue invocations
Andres Lagar-Cavilla [Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)]
Re-order calls to put_gfn() around wait queue invocations

Since we use wait queues to handle potential ring congestion cases,
code paths that try to generate a mem event while holding a gfn lock
would go to sleep in non-preemptible mode.

Most such code paths can be fixed by simply postponing event generation until
locks are released.

Signed-off-by: Adin Scannell <adin@scannell.ca>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agox86/mm: Rework locking in the PoD layer
Andres Lagar-Cavilla [Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)]
x86/mm: Rework locking in the PoD layer

The PoD layer has a complex locking discipline. It relies on the
p2m being globally locked, and it also relies on the page alloc
lock to protect some of its data structures. Replace this all by an
explicit pod lock: per p2m, order enforced.

Three consequences:
    - Critical sections in the pod code protected by the page alloc
      lock are now reduced to modifications of the domain page list.
    - When the p2m lock becomes fine-grained, there are no
      assumptions broken in the PoD layer.
    - The locking is easier to understand.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
13 years agox86/mm: Clean up locking now that p2m lockups are fully synchronized
Andres Lagar-Cavilla [Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)]
x86/mm: Clean up locking now that p2m lockups are fully synchronized

With p2m lookups fully synchronized, many routines need not
call p2m_lock any longer. Also, many routines can logically
assert holding the p2m for a specific gfn.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agox86/mm: Make p2m lookups fully synchronized wrt modifications
Andres Lagar-Cavilla [Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)]
x86/mm: Make p2m lookups fully synchronized wrt modifications

We achieve this by locking/unlocking the global p2m_lock in get/put_gfn.

The lock is always taken recursively, as there are many paths that
call get_gfn, and later, make another attempt at grabbing the p2m_lock.

The lock is not taken for shadow lookups. We believe there are no problems
remaining for synchronized p2m+shadow paging, but we are not enabling this
combination due to lack of testing. Unlocked shadow p2m access are tolerable as
long as shadows do not gain support for paging or sharing.

HAP (EPT) lookups and all modifications do take the lock.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoxenpaging: deal with MEM_EVENT_FLAG_EVICT_FAIL request in tools/xenpaging
Olaf Hering [Thu, 9 Feb 2012 18:47:53 +0000 (18:47 +0000)]
xenpaging: deal with MEM_EVENT_FLAG_EVICT_FAIL request in tools/xenpaging

If a page is nominated but not evicted,then dom0 accesses the page,it
will change the page's p2mt to be p2m_ram_paging_in,and the req.flags
is MEM_EVENT_FLAG_EVICT_FAIL;so it will fail in p2m_mem_paging_evict()
because of the p2mt;and paging->num_paged_out will not increase in
this case;After the paging process is terminated, the p2mt
p2m_ram_paging_in still remains in p2m table.Once domU accesses the
nominated page,it will result in BSOD or vm'stuck.

The patch adds the dealing of this request to resume the page before
xenpaging is ended.

[ This can happen if p2m_mem_paging_populate() was called by a foreign
domain. In this case MEM_EVENT_FLAG_VCPU_PAUSED is not set and xenpaging
will not sent a response. And in this case the ring is in an
inconsistent state anyway, new requests cant be added, I think. - Olaf ]

Signed-off-by: hongkaixing <hongkaixing@huawei.com>
Signed-off-by: shizhen <bicky.shi@huawei.com>
Acked-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: fix bootloader args setting
Zhigang Wang [Thu, 9 Feb 2012 18:41:03 +0000 (18:41 +0000)]
libxl: fix bootloader args setting

When bootloader_args = ['foo', 'bar'], then info->u.pv.bootloader_args =

    foo\0
    bar\0
    \0

Before this patch, 'p++' points to the next character of 'foo\0' and never
comes to 'bar\0' (because of the '\0' in 'foo\0'), so the args will be:

    args[0] = 'oo\0'
    args[1] = 'o\0'

After this patch, 'p++' points to the next string of pv.bootloader_args, so we
get the correct args:

    args[0] = 'foo\0'
    args[1] = 'bar\0'

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxenstored: Add stub domain builder
Daniel De Graaf [Thu, 9 Feb 2012 18:33:36 +0000 (18:33 +0000)]
xenstored: Add stub domain builder

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: add --priv-domid parameter
Daniel De Graaf [Thu, 9 Feb 2012 18:33:36 +0000 (18:33 +0000)]
xenstored: add --priv-domid parameter

This parameter identifies an alternative service domain which has
superuser access to the xenstore database, which is currently required
to set up a new domain's xenstore entries.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: use domain_is_unprivileged instead of checking conn->id
Daniel De Graaf [Thu, 9 Feb 2012 18:33:35 +0000 (18:33 +0000)]
xenstored: use domain_is_unprivileged instead of checking conn->id

This centralizes all the permission checking for privileged domains in
preparation for allowing domains other than dom0 to be privileged.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agostubdom: enable xenstored build
Daniel De Graaf [Thu, 9 Feb 2012 18:33:35 +0000 (18:33 +0000)]
stubdom: enable xenstored build

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: add --event parameter for bootstrapping
Daniel De Graaf [Thu, 9 Feb 2012 18:33:35 +0000 (18:33 +0000)]
xenstored: add --event parameter for bootstrapping

When xenstored is run in a minios domain, it needs a bootstrap
connection to dom0 so that additional domain introduce messages can be
sent to it.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: support running in minios stubdom
Daniel De Graaf [Thu, 9 Feb 2012 18:33:34 +0000 (18:33 +0000)]
xenstored: support running in minios stubdom

A previous versions of this patch has been sent to xen-devel. See
http://lists.xensource.com/archives/html/xen-devel/2009-03/msg01655.html

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: add --internal-db flag
Daniel De Graaf [Thu, 9 Feb 2012 18:33:34 +0000 (18:33 +0000)]
xenstored: add --internal-db flag

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: support for tdb_copy with TDB_INTERNAL
Alex Zeffertt [Thu, 9 Feb 2012 18:33:33 +0000 (18:33 +0000)]
xenstored: support for tdb_copy with TDB_INTERNAL

The tdb_copy function should honor the TDB_INTERNAL flag for in-memory
databases; this is required to run in mini-os which does not use a
filesystem.

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: add NO_SOCKETS compilation option
Alex Zeffertt [Thu, 9 Feb 2012 18:33:33 +0000 (18:33 +0000)]
xenstored: add NO_SOCKETS compilation option

Add option for compiling xenstored without unix sockets to support
running on mini-OS

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: refactor socket setup code
Daniel De Graaf [Thu, 9 Feb 2012 18:33:33 +0000 (18:33 +0000)]
xenstored: refactor socket setup code

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoxenstored: use grant references instead of map_foreign_range
Alex Zeffertt [Thu, 9 Feb 2012 18:33:32 +0000 (18:33 +0000)]
xenstored: use grant references instead of map_foreign_range

make xenstored use grantref rather than map_foreign_range (which can
only be used by privileged domains)

This patch modifies the xenstore daemon to use xc_gnttab_map_grant_ref
instead of xc_map_foreign_range where available.

Previous versions of this patch have been sent to xen-devel. See
http://lists.xensource.com/archives/html/xen-devel/2008-07/msg00610.html
http://lists.xensource.com/archives/html/xen-devel/2009-03/msg01492.html

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agomini-os: make frontends and xenbus optional
Daniel De Graaf [Thu, 9 Feb 2012 18:33:32 +0000 (18:33 +0000)]
mini-os: make frontends and xenbus optional

This adds compile-time logic to disable certain frontends in mini-os:
 - pcifront is disabled by default, enabled for ioemu
 - blkfront, netfront, fbfront, kbdfront, consfront are enabled by default
 - xenbus is required for any frontend, and is enabled by default

If all frontends and xenbus are disabled, mini-os will run without
needing to communicate with xenstore, making it suitable to run the
xenstore daemon. The console frontend is not required for the initial
console, only consoles opened via openpt or ptmx.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agomini-os: Move test functions into test.c
Daniel De Graaf [Thu, 9 Feb 2012 18:33:31 +0000 (18:33 +0000)]
mini-os: Move test functions into test.c

While useful, these test functions should not be compiled into every
mini-os instance that we compile.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agomini-os: create app-specific configuration
Daniel De Graaf [Thu, 9 Feb 2012 18:33:31 +0000 (18:33 +0000)]
mini-os: create app-specific configuration

Instead of using CONFIG_QEMU and CONFIG_GRUB to enable or disable minios
code, create CONFIG_ items for features and use application-specific
configuration files to enable or disable the features.

The configuration flags are currently added to the compiler command
line; as the number of flags grows this may need to move to a header.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agomini-os: remove per-fd evtchn limit
Alex Zeffertt [Thu, 9 Feb 2012 18:33:30 +0000 (18:33 +0000)]
mini-os: remove per-fd evtchn limit

This changes the minios evtchn implementation to use a list instead of
an array which ahis allows it to grow as necessary to support any number
of ports, only limited by Xen (NR_EVS is 1024, should be enough for now).

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agomini-os: avoid crash if no console is provided
Daniel De Graaf [Thu, 9 Feb 2012 18:33:30 +0000 (18:33 +0000)]
mini-os: avoid crash if no console is provided

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agolib{xc,xl}: Seed grant tables with xenstore and console grants
Alex Zeffertt [Thu, 9 Feb 2012 18:33:30 +0000 (18:33 +0000)]
lib{xc,xl}: Seed grant tables with xenstore and console grants

This patch claims one reserved grant entry for the console and another
for the xenstore. It modifies the builder to fill in the grant table
entries for the console and the xenstore.

Previous versions of this patch have been sent to xen-devel. See
http://lists.xensource.com/archives/html/xen-devel/2008-07/msg00610.html
http://lists.xensource.com/archives/html/xen-devel/2009-03/msg01491.html

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agotools/libxl: pull xenstore/console domids from xenstore
Daniel De Graaf [Thu, 9 Feb 2012 18:33:29 +0000 (18:33 +0000)]
tools/libxl: pull xenstore/console domids from xenstore

Instead of assuming that xenstored and xenconsoled are running in dom0,
pull the domain IDs from xenstore.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
13 years agoflask/policy: add device model types to example policy
Daniel De Graaf [Thu, 9 Feb 2012 18:25:49 +0000 (18:25 +0000)]
flask/policy: add device model types to example policy

This adds an example user for device_model_stubdomain_seclabel.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: Add device_model_stubdomain_seclabel
Daniel De Graaf [Thu, 9 Feb 2012 18:25:15 +0000 (18:25 +0000)]
libxl: Add device_model_stubdomain_seclabel

This allows the security label of stub domains to be specified.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: helper function to send commands to traditional qemu
Shriram Rajagopalan [Thu, 9 Feb 2012 18:07:48 +0000 (18:07 +0000)]
libxl: helper function to send commands to traditional qemu

Introduce a helper function to send commands to traditional
qemu. qemu_pci_add_xenstore, qemu_pci_remove_xenstore,
libxl__domain_save_device_model and libxl_domain_unpause have
been refactored to use this function.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: bugfix: create_domain() return to caller if !daemonize
Shriram Rajagopalan [Thu, 9 Feb 2012 18:06:24 +0000 (18:06 +0000)]
libxl: bugfix: create_domain() return to caller if !daemonize

Currently the create_domain function does not honor
the daemonize flag properly. It exits irrespective of
the value of the flag. This patch fixes the issue.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: add reference for vcpu-set command.
Wei Liu [Thu, 9 Feb 2012 18:03:07 +0000 (18:03 +0000)]
xl: add reference for vcpu-set command.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agostubdom: update README to reference xl configuration syntax
Ian Campbell [Thu, 9 Feb 2012 16:45:26 +0000 (16:45 +0000)]
stubdom: update README to reference xl configuration syntax

Remove reference to fsback -- it was removed some time ago.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agomini-os: stop compiler complaint about unused variables
John McDermott [Thu, 9 Feb 2012 16:03:05 +0000 (16:03 +0000)]
mini-os: stop compiler complaint about unused variables

gcc (GCC) 4.6.2 20111027 (Red Hat 4.6.2-1) complains about unused variables
in mini-os drivers

Signed-off-by: John McDermott <john.mcdermott@nrl.navy.mil>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agognttab: miscellaneous fixes
Jan Beulich [Thu, 9 Feb 2012 15:39:16 +0000 (16:39 +0100)]
gnttab: miscellaneous fixes

- _GTF_* constants name bit positions, so binary arithmetic on them is
  wrong
- gnttab_clear_flag() cannot (on x86 and ia64 at least) simply use
  clear_bit(), as that may access more than the two bytes that are
  intended to be accessed

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agoarm: copy DTB appended to zImage
David Vrabel [Thu, 9 Feb 2012 15:32:50 +0000 (15:32 +0000)]
arm: copy DTB appended to zImage

When copying a zImage from flash, also copy any appended device tree
blob.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: support zImage format kernels for dom0
David Vrabel [Thu, 9 Feb 2012 15:32:50 +0000 (15:32 +0000)]
arm: support zImage format kernels for dom0

Allow a zImage format kernel to be used for dom0.  zImages are (by
default) hardcoded with the RAM location so adjust the RAM in the
memory map to match the physical memory map (0x80000000).

Vmlinux ELF images are loaded using a hack to locate the RAM so the
IPA is the same as the kernel's VA so the elf loader does the right
thing.  If an ELF image is loaded the RAM will be located at
0xC0000000 (as before).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: makefiles
Stefano Stabellini [Thu, 9 Feb 2012 15:32:50 +0000 (15:32 +0000)]
arm: makefiles

Makefile and config options for the ARM architecture.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: define stub arch_dump_shared_mem_info
Ian Campbell [Thu, 9 Feb 2012 15:32:50 +0000 (15:32 +0000)]
arm: define stub arch_dump_shared_mem_info

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: define domain_pirq_to_irq
Ian Campbell [Thu, 9 Feb 2012 15:32:50 +0000 (15:32 +0000)]
arm: define domain_pirq_to_irq

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoTools: Make xen-access test compile in 32 bits mode
Andres Lagar-Cavilla [Thu, 9 Feb 2012 14:28:53 +0000 (06:28 -0800)]
Tools: Make xen-access test compile in 32 bits mode

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoCONFIG: remove #ifdef __ia64__ from the x86 arch tree
Andrew Cooper [Thu, 9 Feb 2012 14:20:49 +0000 (06:20 -0800)]
CONFIG: remove #ifdef __ia64__ from the x86 arch tree

__ia64__ really really should not be defined in the x86 arch subtree,
so remove it from xen/include/public/arch-x86/hvm/save.h

This in turn allows the removal of VIOAPIC_IS_IOSAPIC, as x86 does not
use streamlined {IO,L}APICs, allowing for the removal of more code
from the x86 tree.

Changes since v2:
 *  Leave the EOI register write protected by VIOAPIC_VERSION_ID >=
    0x20.  Currently, only version 0x11 is emulated, but leave this
    correct code in place in case a decision is make to emulate the
    newer version.

Changes since v1:
 *  Refresh patch following the decision not to try emulating a
    version 0x20 IOAPIC

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoCONFIG: remove CONFIG_SMP #ifdefs
Andrew Cooper [Thu, 9 Feb 2012 14:14:20 +0000 (06:14 -0800)]
CONFIG: remove CONFIG_SMP #ifdefs

CONFIG_SMP is always enabled and !CONFIG_SMP is not supported.  So
simplify the code a little by removing all #ifdefs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agotools/python: remove references to removed libflask from setup.py
Olaf Hering [Thu, 9 Feb 2012 14:12:30 +0000 (06:12 -0800)]
tools/python: remove references to removed libflask from setup.py

Build in SLES11 SP1/2 fails after libflask removal.

> building 'flask' extension
> error: ../../tools/flask/libflask/libflask.so: No such file or
> directory
> make[3]: *** [install] Error 1
> make[3]: Leaving directory
> `/usr/src/packages/BUILD/xen-4.2.24701/non-dbg/tools/python'
> make[2]: *** [subdir-install-python] Error 2

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
13 years agovpmu: Rename PASSIVE_DOMAIN_ALLOCATED
Dietmar Hahn [Thu, 9 Feb 2012 14:09:17 +0000 (06:09 -0800)]
vpmu: Rename PASSIVE_DOMAIN_ALLOCATED

This patch renames the define PASSIVE_DOMAIN_ALLOCATED to follow the
same scheme of the other defines.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agovpmu: Remove unnecessary spaces at the end of lines
Dietmar Hahn [Thu, 9 Feb 2012 14:08:41 +0000 (06:08 -0800)]
vpmu: Remove unnecessary spaces at the end of lines

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agovpmu: Use macros to access struct vpmu_struct.flags
Dietmar Hahn [Thu, 9 Feb 2012 14:08:02 +0000 (06:08 -0800)]
vpmu: Use macros to access struct vpmu_struct.flags

This patch introduces some macros realising the access to the item
'flags' in the struct vpmu_struct (see
xen/include/asm-x86/hvm/vpmu.h).  Only bits within 'flags' are
set/reset/checked.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoamd iommu: Remove redundant checks from iommu emulation code path
Wei Wang [Thu, 9 Feb 2012 14:06:26 +0000 (06:06 -0800)]
amd iommu: Remove redundant checks from iommu emulation code path

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoarm: vtimer
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: vtimer

Emulation of the generic timer kernel registers.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: vgic emulation
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: vgic emulation

- emulation of the GICD interface for the guest;

- interrupt injection into the guest;

- keep track of inflight irqs using a list, ordered by priority.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: trap handlers
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: trap handlers

Functions executed exiting from the guest and returning to the guest:
trap and hypercall handlers and leave_hypervisor_tail.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: driver for the generic timer for ARMv7
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: driver for the generic timer for ARMv7

Driver for the generic timer for ARMv7 with virtualization extensions.
Currently it is based on the kernel timer rather than the hypervisor timer
because the latter does not work correctly on our test environment.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: shutdown, smp and smpboot
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: shutdown, smp and smpboot

Dummy implementation of machine_* and smp_*

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: early setup code
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: early setup code

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: pl011 UART driver
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: pl011 UART driver

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: mm and p2m
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: mm and p2m

Functions to setup pagetables, handle the p2m, map and unmap domain
pages, copy data to/from guest addresses.
The implementation is based on the LPAE extension for ARMv7 and makes
use of the two level transtion mechanism.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: irq
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: irq

A simple do_IRQ and request_irq implementation for ARM.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: mmio handlers
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: mmio handlers

Basic infrastructure to emulate mmio reads and writes.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: driver for CoreLink GIC-400 Generic Interrupt Controller
Stefano Stabellini [Thu, 9 Feb 2012 11:33:30 +0000 (11:33 +0000)]
arm: driver for CoreLink GIC-400 Generic Interrupt Controller

- GICC, GICD and GICH initialization;

- interrupts routing, acking and EOI;

- interrupt injection into guests;

- maintenance interrupt handler, that takes care of EOI physical
  interrupts on behalf of the guest;

- a function to remap the virtual cpu interface into the guest address
  space, where the guest expect the GICC to be.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: domain_build
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: domain_build

Functions to build dom0: memory allocation, p2m construction, mappings
of the MMIO regions, ATAG setup.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: domain
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: domain

Domain creation and destruction, vcpu initialization and destruction,
arch specific scheduling functions called by common code.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: entry.S and head.S
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: entry.S and head.S

Low level assembly routines, including entry.S and head.S.
Also the linker script and a collection of dummy functions that we plan
to reduce to zero as soon as possible.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: bit manipulation, copy and division libraries
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: bit manipulation, copy and division libraries

Bit manipulation, division and memcpy & friends implementations for the
ARM architecture, shamelessly taken from Linux.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: header files
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: header files

A simple implementation of everything under asm-arm and arch-arm.h; some
of these files are shamelessly taken from Linux.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoarm: compile tmem
Stefano Stabellini [Thu, 9 Feb 2012 11:33:29 +0000 (11:33 +0000)]
arm: compile tmem

Include few missing header files; introduce defined(CONFIG_ARM) where
required.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
13 years agoxen/common/Makefile: introduce HAS_{CPUFREQ,PCI,PASSTHROUGH,NS16550,KEXEC}
Stefano Stabellini [Thu, 9 Feb 2012 11:33:28 +0000 (11:33 +0000)]
xen/common/Makefile: introduce HAS_{CPUFREQ,PCI,PASSTHROUGH,NS16550,KEXEC}

- make the compilation of ns16550.c depend upon HAS_NS16550;

- make the compilation of cpufreq depend upon HAS_CPUFREQ;

- make the compilation of pci depend upon HAS_PCI;

- make the compilation of passthrough depend upon HAS_PASSTHROUGH;

- make the compilation of kexec depend upon HAS_KEXEC.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/ia64/Rules.mk        |    5 +++++
 xen/arch/x86/Rules.mk         |    5 +++++
 xen/common/Makefile           |    2 +-
 xen/common/shutdown.c         |    4 ++++
 xen/drivers/Makefile          |    6 +++---
 xen/drivers/char/Makefile     |    2 +-
 xen/drivers/char/console.c    |    4 ++++
 xen/include/asm-ia64/config.h |    1 +
 xen/include/asm-x86/config.h  |    1 +
 9 files changed, 25 insertions(+), 5 deletions(-)

13 years agox86: add Ivy Bridge model numbers to model specific MSR handling
Jan Beulich [Thu, 9 Feb 2012 11:07:39 +0000 (12:07 +0100)]
x86: add Ivy Bridge model numbers to model specific MSR handling

This is model 0x3a (decimal 58) as per the most recent SDM.

In vPMU code, also add a forgotten earlier model.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Xiantao Zhang<xiantao.zhang@intel.com>
13 years agolibxc: Replace malloc with alloca in hot path
Santosh Jodh [Tue, 7 Feb 2012 18:46:50 +0000 (18:46 +0000)]
libxc: Replace malloc with alloca in hot path

Replace malloc with alloc in hot paths for improved performance.

Signed-off-by: Santosh Jodh <santosh.jodh@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoQEMU_TAG update
Ian Jackson [Tue, 7 Feb 2012 18:45:00 +0000 (18:45 +0000)]
QEMU_TAG update

13 years agoirq: Add extra debugging to help track down why an assertion is failing
Andrew Cooper [Tue, 7 Feb 2012 18:44:12 +0000 (18:44 +0000)]
irq: Add extra debugging to help track down why an assertion is failing

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agopygrub: extlinux parsing correctness
Roger Pau Monne [Tue, 7 Feb 2012 17:21:27 +0000 (17:21 +0000)]
pygrub: extlinux parsing correctness

The "in" operator should be used instead of the find method, since
we are only interested in knowing whether the line contains "initrd=",
but we don't care about it's position. Also fixes an error that
happens when initrd= it's at the start of the line, since find returns
0 and is evaluated as False.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: remove shebang from bash_completion helper
Olaf Hering [Tue, 7 Feb 2012 17:18:10 +0000 (17:18 +0000)]
libxl: remove shebang from bash_completion helper

Fix rpmlint warning:

xen-tools.x86_64: W: sourced-script-with-shebang
/etc/bash_completion.d/xl.sh /bin/bash
This text file contains a shebang, but is meant to be sourced, not executed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: use json output by default
Ian Campbell [Tue, 7 Feb 2012 17:01:57 +0000 (17:01 +0000)]
xl: use json output by default

Move the sxp producing code off into a separate file. It is supported
for legacy reasons and needn't be updated other than the improve
compatibility with xm.

libxl_domain_config is not currently generated by the IDL (adding the
necessary support for Array types is on my to do list) so hand code
the json generation function for now.

Since this rather directly exposes a libxl data structure it's not
clear what sort of forward compatibility guarantees we can
make. However it seems like it should be as stable as libxl's own API
(which we are looking to stabilise)

(Gratuitous string.h include needed for memset in libxl_util.h)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: Drop -l option to xl cpupool-list
Ian Campbell [Tue, 7 Feb 2012 16:50:17 +0000 (16:50 +0000)]
xl: Drop -l option to xl cpupool-list

The implementation (which was a nop) was removed back in 22838:aab67c1c6b87 but
this now causes "set but not used" warnings from some compilers. Might as well
just nuke the option entirely.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agox86/AMD: Add support for AMD's OSVW feature in guests.
Boris Ostrovsky [Tue, 7 Feb 2012 14:05:19 +0000 (15:05 +0100)]
x86/AMD: Add support for AMD's OSVW feature in guests.

In some cases guests should not provide workarounds for errata even when the
physical processor is affected. For example, because of erratum 400 on family
10h processors a Linux guest will read an MSR (resulting in VMEXIT) before
going to idle in order to avoid getting stuck in a non-C0 state. This is not
necessary: HLT and IO instructions are intercepted and therefore there is no
reason for erratum 400 workaround in the guest.

This patch allows us to present a guest with certain errata as fixed,
regardless of the state of actual hardware.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
13 years agoFix error recovery path in __gnttab_map_grant_ref
Haoyu Zhang [Mon, 6 Feb 2012 21:23:41 +0000 (13:23 -0800)]
Fix error recovery path in __gnttab_map_grant_ref

In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status  previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.

Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com>
Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoIO-APIC: Reformat IO-APIC RTE debug info (v2)
Andrew Cooper [Mon, 6 Feb 2012 21:17:46 +0000 (13:17 -0800)]
IO-APIC: Reformat IO-APIC RTE debug info (v2)

Having the columns aligned makes for much easier reading.  Also remove
the commas which only add to visual clutter in combination with
spaces.

Furthermore, printing fewer characters makes it less likely that the
serial buffer will overflow resulting in loss of critical debugging
information.

Changes since v1:
 *  Format vector as hex rather than dec
 *  Contract some names
 *  destination mode uses 'L' or 'P' instead of full words
 *  trigger mode uses 'L' or 'E' instead of full words
 *  delivery mode uses short string instead of a number

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoIOMMU: Update the maintainer list of VT-d
Xiantao Zhang [Mon, 6 Feb 2012 21:16:19 +0000 (13:16 -0800)]
IOMMU: Update the maintainer list of VT-d

Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years ago.hgignore/.gitignore: Add some tools/tests binaries
Keir Fraser [Mon, 6 Feb 2012 21:15:03 +0000 (13:15 -0800)]
.hgignore/.gitignore: Add some tools/tests binaries

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoTools: build tests
Andres Lagar-Cavilla [Mon, 6 Feb 2012 21:12:58 +0000 (13:12 -0800)]
Tools: build tests

Build tests as part of the tools build.

It is enabled with CONFIG_TESTS in Config.mk

Currently disabled build of tests/regressions and tests/xen-access (in
32-bit mode) as they fail.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxen: Remove unused vsscanf/sscanf functions
Daniel De Graaf [Mon, 6 Feb 2012 13:08:03 +0000 (05:08 -0800)]
xen: Remove unused vsscanf/sscanf functions

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask: Update flask_op hypercall structure
Daniel De Graaf [Mon, 6 Feb 2012 13:07:20 +0000 (05:07 -0800)]
flask: Update flask_op hypercall structure

Instead of placing string parsing inside the hypervisor, use binary
structures like other Xen hypercalls do.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years ago.gitignore/.hgignore: add missing output files
Daniel De Graaf [Mon, 6 Feb 2012 13:04:32 +0000 (05:04 -0800)]
.gitignore/.hgignore: add missing output files

 - extras/mini-os/include/list.h (already in .hgignore)
 - tools/flask/flask-{get,set}-bool
 - tools/flask/loadpolicy no longer exists
 - tools/xenstore/init-xenstore-domain

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agotools/flask: remove libflask
Daniel De Graaf [Mon, 6 Feb 2012 13:03:32 +0000 (05:03 -0800)]
tools/flask: remove libflask

This library has been deprecated since July 2010; remove the in-tree
users and library.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoia64: fix build (next instance)
Jan Beulich [Mon, 6 Feb 2012 16:40:05 +0000 (17:40 +0100)]
ia64: fix build (next instance)

A number of build problems crept in once again. Fix them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agoFix x86_32 build
Tim Deegan [Thu, 2 Feb 2012 15:47:26 +0000 (15:47 +0000)]
Fix x86_32 build

Signed-off-by: Tim Deegan <tim@xen.org>
13 years agox86: avoid deadlock after a PCI SERR NMI
David Vrabel [Thu, 2 Feb 2012 15:28:58 +0000 (15:28 +0000)]
x86: avoid deadlock after a PCI SERR NMI

If a PCI System Error (SERR) is asserted it causes an NMI. If this NMI
occurs while the CPU is in printk() then Xen may deadlock as
pci_serr_error() calls console_force_unlock() which screws up the
console lock.

printk() isn't safe to call from NMI context so defer the diagnostic
message to a softirq.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Tested-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm/flask: Improve domain ID auditing in AVCs
Daniel De Graaf [Thu, 2 Feb 2012 15:26:55 +0000 (15:26 +0000)]
xsm/flask: Improve domain ID auditing in AVCs

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask/policy: Add boolean example
Daniel De Graaf [Thu, 2 Feb 2012 15:25:23 +0000 (15:25 +0000)]
flask/policy: Add boolean example

This shows an example boolean (prot_doms_locked) which can be set at
runtime to prevent dom0 from mapping memory of domains of type
prot_domU_t.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask: add flask-{get,set}-bool tools
Daniel De Graaf [Thu, 2 Feb 2012 15:24:53 +0000 (15:24 +0000)]
flask: add flask-{get,set}-bool tools

These utilities can be used to modify policy booleans, which allow
minor policy changes without reloading the security policy. This can
be used to make security policy change based on external information
such as time of day, user physical presence, completion of system
boot, or other relevant variables.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agolibflask: Add boolean manipulation functions
Daniel De Graaf [Thu, 2 Feb 2012 15:24:13 +0000 (15:24 +0000)]
libflask: Add boolean manipulation functions

Add wrappers for getting and setting policy booleans by name or ID.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm/flask: allow policy booleans to be addressed by name
Daniel De Graaf [Thu, 2 Feb 2012 15:23:43 +0000 (15:23 +0000)]
xsm/flask: allow policy booleans to be addressed by name

Booleans are currently only addressable by using a sequence number
that is not easily accessible to tools. Add new FLASK operations to
get/set booleans by name, and to get the name of a boolean given its
ID.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxen/xsm: fix incorrect handling of XSM hook return
Daniel De Graaf [Thu, 2 Feb 2012 15:23:04 +0000 (15:23 +0000)]
xen/xsm: fix incorrect handling of XSM hook return

If the XSM hook denied access, the execution incorrectly continued on
after an extra unlock domain.

Reported-by: John McDermott <john.mcdermott@nrl.navy.mil>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask/policy: use declare_domain for dom0_t
Daniel De Graaf [Thu, 2 Feb 2012 15:21:42 +0000 (15:21 +0000)]
flask/policy: use declare_domain for dom0_t

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask/policy: Add user and constraint examples
Daniel De Graaf [Thu, 2 Feb 2012 15:21:13 +0000 (15:21 +0000)]
flask/policy: Add user and constraint examples

These examples show how to use constraints and the user field of the
security label to prevent communication between virtual machines of
different customers in a multi-tenant environment.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoflask/policy: Policy build updates
Daniel De Graaf [Thu, 2 Feb 2012 15:20:40 +0000 (15:20 +0000)]
flask/policy: Policy build updates

Eliminate temporary files used in creating FLASK policy to improve
error reporting during policy build. Syntax errors now point to the
file and line number visible to the user, not the intermediate
temporary file.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm/flask: Remove useless back pointers
Daniel De Graaf [Thu, 2 Feb 2012 15:19:57 +0000 (15:19 +0000)]
xsm/flask: Remove useless back pointers

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm/flask: Improve error reporting for ocontexts
Daniel De Graaf [Thu, 2 Feb 2012 15:19:24 +0000 (15:19 +0000)]
xsm/flask: Improve error reporting for ocontexts

Instead of returning -EINVAL for all errors, return -EEXIST if adding
an entry that overlaps with an existing entry, and -ENOENT if
attempting to remove an entry that does not exist. Adding an ocontext
that already exists with the same SID is no longer an error.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm: Use mapped IRQ not PIRQ in unmap_domain_pirq
Daniel De Graaf [Thu, 2 Feb 2012 15:18:50 +0000 (15:18 +0000)]
xsm: Use mapped IRQ not PIRQ in unmap_domain_pirq

XSM permissions are defined in terms of IRQs, not PIRQs; use the
correct number when checking permission in unmap_domain_pirq.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm: Add xsm_map_domain_pirq hook
Daniel De Graaf [Thu, 2 Feb 2012 15:18:19 +0000 (15:18 +0000)]
xsm: Add xsm_map_domain_pirq hook

When checking permissions in map_domain_pirq, the msi_desc field of
the irq_desc is not yet populated with the PCI device being used. Pass
in the msi_info structure which contains the intended PCI device whose
label will be used in the security check.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm/flask: Use PCI device label for PCI-MSI IRQs
Daniel De Graaf [Thu, 2 Feb 2012 15:17:46 +0000 (15:17 +0000)]
xsm/flask: Use PCI device label for PCI-MSI IRQs

Because the PCI-MSI IRQ numbers are allocated dynamically, labeling
them by number is not useful. Instead, for all IRQs beyond
nr_irqs_gsi, use the associated msi_desc to find the PCI device and
use the label of the PCI device for the IRQ.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoxsm: Add security label to IRQ debug output
Daniel De Graaf [Thu, 2 Feb 2012 15:17:11 +0000 (15:17 +0000)]
xsm: Add security label to IRQ debug output

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Keir Fraser <keir@xen.org>