]> xenbits.xensource.com Git - people/royger/xen.git/log
people/royger/xen.git
11 years agobuild: export linker emulation parameter to SeaBIOS freebsd_tools_rfc gitlab/freebsd_tools_rfc
Roger Pau Monne [Tue, 15 Apr 2014 17:02:16 +0000 (19:02 +0200)]
build: export linker emulation parameter to SeaBIOS

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agobuild: export CC value to SeaBIOS
Roger Pau Monne [Tue, 15 Apr 2014 16:54:24 +0000 (18:54 +0200)]
build: export CC value to SeaBIOS

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agogdbsx: remove cast from ioctl
Roger Pau Monne [Thu, 10 Apr 2014 07:37:45 +0000 (09:37 +0200)]
gdbsx: remove cast from ioctl

The ulong type is not defined on FreeBSD, and the cast seems
pointless, so just remove it.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenstat: add a dummy FreeBSD implementation
Roger Pau Monne [Wed, 9 Apr 2014 15:54:46 +0000 (17:54 +0200)]
xenstat: add a dummy FreeBSD implementation

Add an empty FreeBSD implementation so xenstat can compile on FreeBSD.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agohvmloader: remove size_t typedef and include stddef.h
Roger Pau Monne [Wed, 9 Apr 2014 15:47:08 +0000 (17:47 +0200)]
hvmloader: remove size_t typedef and include stddef.h

The open coded typedef of size_t was clashing with the typedef in
FreeBSD headers. Remove the typedef and include the proper header
where size_t is defined (stddef.h).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: only include utmp.h if it's present
Roger Pau Monne [Wed, 9 Apr 2014 14:32:31 +0000 (16:32 +0200)]
libxl: only include utmp.h if it's present

Add a configure check for utmp.h presence, and gate the usage of
utmp.h in libxl to the result of the test.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: add support for FreeBSD uuid implementation
Roger Pau Monne [Wed, 9 Apr 2014 14:27:44 +0000 (16:27 +0200)]
libxl: add support for FreeBSD uuid implementation

Add the FreeBSD specific uuid implementation. Since uuid_t is not
defined as an array, but as a struct on FreeBSD, use a union with a
array in order to be able to return the uuid as a bytearray.

Also, added a libxl internal compile time assert macro, that is used
to assert that the size of uuid_t is the same as the union used in
libxl.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: add FreeBSD OS support
Roger Pau Monne [Wed, 9 Apr 2014 14:08:05 +0000 (16:08 +0200)]
libxl: add FreeBSD OS support

Create a new libxl_freebsd.c file that contains OS-specific bits used
by libxl.

This currently defines which backend to use to handle disks, and
which hotplug scripts to execute.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxl: add support for OS-specific names to backend interfaces
Roger Pau Monne [Fri, 11 Apr 2014 08:48:52 +0000 (10:48 +0200)]
libxl: add support for OS-specific names to backend interfaces

libxl__device_nic_devname used to hardcode backend network interfaces
as "vif<domid>.<handle>", remove this limitation and allow libxl to
deal with OS-specific interface names.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agohotplug: add FreeBSD vif-bridge
Roger Pau Monne [Thu, 10 Apr 2014 09:07:07 +0000 (11:07 +0200)]
hotplug: add FreeBSD vif-bridge

Add a simple vif-bridge script, that takes care of adding network
backends (tap or xnb) to a pre-configured bridge.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoinit: add FreeBSD xencommons init script
Roger Pau Monne [Thu, 10 Apr 2014 08:56:57 +0000 (10:56 +0200)]
init: add FreeBSD xencommons init script

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoconsole: add FreeBSD includes
Roger Pau Monne [Wed, 9 Apr 2014 14:06:25 +0000 (16:06 +0200)]
console: add FreeBSD includes

Add FreeBSD specific includes to the console daemon.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenstore: add some missing headers
Roger Pau Monne [Wed, 9 Apr 2014 14:03:44 +0000 (16:03 +0200)]
xenstore: add some missing headers

xs_tdb_dump.c was including tdb.h, which makes use of dev_t and ino_t,
which are defined in sys/types.h.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenstored: add the FreeBSD xenstored interface
Roger Pau Monne [Wed, 9 Apr 2014 10:25:08 +0000 (12:25 +0200)]
xenstored: add the FreeBSD xenstored interface

This patch adds FreeBSD support to xenstored, by implementing the
FreeBSD interface to /dev/xen/xenstored.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolz4: add support for OSes that don't have asm/unaligned.h
Roger Pau Monne [Wed, 9 Apr 2014 11:44:38 +0000 (13:44 +0200)]
lz4: add support for OSes that don't have asm/unaligned.h

Add a configure check for asm/unaligned.h presence, and if it's not
available open-code the necessary functions for lz4.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoconfigure: add checks for endian.h and sys/endian.h
Roger Pau Monne [Tue, 15 Apr 2014 10:46:21 +0000 (12:46 +0200)]
configure: add checks for endian.h and sys/endian.h

In order to know which one to include when building
xc_dom_decompress_lz4.c

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
Please run autoconf after applying this patch.

11 years agolibelf: add defines for bswap_* functions for FreeBSD
Roger Pau Monne [Wed, 9 Apr 2014 11:40:01 +0000 (13:40 +0200)]
libelf: add defines for bswap_* functions for FreeBSD

This maps bswap_* functions used in libelf to their FreeBSD
counterparts.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxc: remove include of malloc.h
Roger Pau Monne [Wed, 9 Apr 2014 10:31:30 +0000 (12:31 +0200)]
libxc: remove include of malloc.h

The malloc set of functions should have their prototypes in stdlib.h
according to:

http://pubs.opengroup.org/onlinepubs/009695399/functions/malloc.html

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxc: remove usage of "daylight" variable
Roger Pau Monne [Wed, 9 Apr 2014 10:17:19 +0000 (12:17 +0200)]
libxc: remove usage of "daylight" variable

FreeBSD doesn't implement the XSI extension that mandates the presence
of the daylight variable as described in:

http://pubs.opengroup.org/onlinepubs/009696799/functions/tzset.html

So avoid using it for portability reasons. Use tm_isdst instead to
decide if daylight savings time conversions should be used or not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agolibxc: add support for FreeBSD
Roger Pau Monne [Wed, 9 Apr 2014 09:54:40 +0000 (11:54 +0200)]
libxc: add support for FreeBSD

Add the FreeBSD implementation of the privcmd and evtchn devices
interface.

The evtchn device interface is the same as the Linux one, while the
privcmd map interface is simplified because FreeBSD only supports
IOCTL_PRIVCMD_MMAPBATCH.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoinclude: import FreeBSD headers for evtchn and privcmd devices
Roger Pau Monne [Wed, 9 Apr 2014 09:51:31 +0000 (11:51 +0200)]
include: import FreeBSD headers for evtchn and privcmd devices

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agoconfigure: make the libaio test non-fatal on OSes different than Linux
Roger Pau Monne [Wed, 9 Apr 2014 09:28:25 +0000 (11:28 +0200)]
configure: make the libaio test non-fatal on OSes different than Linux

libaio is only present on Linux systems, so make the configure test
that checks for libaio non-fatal is the host OS is different than
Linux.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
---
Please re-run autoconf after applying this patch.

11 years agobuild: set FreeBSD specific build variables
Roger Pau Monne [Wed, 9 Apr 2014 09:27:05 +0000 (11:27 +0200)]
build: set FreeBSD specific build variables

This is very similar to what we do in order to build on NetBSD.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
11 years agotmem: remove dumb check in do_tmem_destroy_pool
Julien Grall [Fri, 4 Apr 2014 09:13:32 +0000 (11:13 +0200)]
tmem: remove dumb check in do_tmem_destroy_pool

do_tmem_destroy_pool is checking if pools == NULL. But, pools is a fixed
array.

Clang 3.5 will fail to compile xen/common/tmem.c with the following error:
tmem.c:1848:18: error: comparison of array 'client->pools' equal to a null
pointer is always false [-Werror,-Wtautological-pointer-compare]
    if ( client->pools == NULL )

Coverity-ID:1055632

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11 years agotmem: propagate ENOMEM result in error handling
Matthew Daley [Fri, 4 Apr 2014 09:08:24 +0000 (11:08 +0200)]
tmem: propagate ENOMEM result in error handling

...otherwise if pcd_associate fails due to out-of-memory, the caller of
do_tmem_put will think the call was successful.

While at it, fix up the style issue.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Reviewed-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11 years agotmem: Some functions are only used internally
Julien Grall [Fri, 4 Apr 2014 09:07:04 +0000 (11:07 +0200)]
tmem: Some functions are only used internally

The list of function above are only used internally in common/tmem:
    - oid_compare
    - oid_set_invalid
    - oid_hash

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11 years agoxenctx: Fix print_ctx_32on64's print_special call.
Don Slutz [Thu, 3 Apr 2014 19:07:09 +0000 (15:07 -0400)]
xenctx: Fix print_ctx_32on64's print_special call.

print_special() uses the width argument to both select output format
and array size.  So by passing 4 it expects an array of uint32_t.
But an array of uint64_t is passed.

So copy and mask the registers to 32 bits.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add 16 bit output
Don Slutz [Thu, 3 Apr 2014 19:07:08 +0000 (15:07 -0400)]
xenctx: Add 16 bit output

This output happens on !guest_protected_mode.  The cpu is in 16 bit
mode in this case.

For example:

$ xenctx 4
cs:eip: f000:0000d61b
flags: 00000002 nz
ss:esp: 0000:00001fee
eax: 0000ffc2   ebx: 00000049   ecx: 00000049   edx: ffffffff
esi: 00000000   edi: 00000010   ebp: 00001ff0
 ds:     e000    es:     0040    fs:     0000    gs:     0000
Code (instr addr 000fd61b)
04 67 66 8b 70 08 67 66 8b 68 0c 67 66 8b 58 10 67 66 8b 50 14 <67> 66 8b 48 18 67 8e 40 02 67 ff

Stack:
 8e30 0000 0246 812f 0000 0206 80e7 0080 0080

$ xenctx 4 -d 0x00001fee -m 0x00001fee -l 1
Memory (address 1fee):
 8e30 0000 0246 812f 0000 0206 80e7 0080 0080 c2c2 c2c2 c2c2 c2c2 c2c2 c2c2 c2c2

Stack:
 8e30 0000 0246 812f 0000 0206 80e7 0080 0080

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Fix handling of !guest_protected_mode
Don Slutz [Thu, 3 Apr 2014 19:07:07 +0000 (15:07 -0400)]
xenctx: Fix handling of !guest_protected_mode

Start with adding the code to the 64 bit path that the 32 bit path
has.

Next disable the "Stack Trace" or "Call Trace".

Finally allow stack dump.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add output of vcpu value and state for --all-vcpus
Don Slutz [Thu, 3 Apr 2014 19:07:06 +0000 (15:07 -0400)]
xenctx: Add output of vcpu value and state for --all-vcpus

This makes it easier to know which vcpu the registers belong to and
when not all vcpus are online, which vcpu it is.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add conversion of more registers to symbols
Don Slutz [Thu, 3 Apr 2014 19:07:05 +0000 (15:07 -0400)]
xenctx: Add conversion of more registers to symbols

For example can change:
 gs: 0000 @ ffffffff803ac000/0000000000000000
to
 gs: 0000 @ ffffffff803ac000/0000000000000000 boot_cpu_pda/

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: change is_kernel_text() into kernel_addr().
Don Slutz [Thu, 3 Apr 2014 19:07:04 +0000 (15:07 -0400)]
xenctx: change is_kernel_text() into kernel_addr().

A new enum has been added to allow the caller to determine if this
kernel address is a text or data address.  This is currenlty not
used, but will be in the next patch.

Add both _end and __bss_stop as kernel_end.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add -d (--dump-as-stack) <daddr> option to dump memory at daddr as a stack.
Don Slutz [Thu, 3 Apr 2014 19:07:03 +0000 (15:07 -0400)]
xenctx: Add -d (--dump-as-stack) <daddr> option to dump memory at daddr as a stack.

Also switch from read_stack_word to read_mem_word since the provided
address may not be aligned.

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add error output if --all-vcpus (-C) and [VCPU] are both specified.
Don Slutz [Thu, 3 Apr 2014 19:07:02 +0000 (15:07 -0400)]
xenctx: Add error output if --all-vcpus (-C) and [VCPU] are both specified.

To do this correctly the program name must be remembered since argv
is adjusted at the end of option parsing.

Switch all uses of argv[0] to prog.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add -m (--memory) <maddr> option to dump memory at maddr.
Don Slutz [Thu, 3 Apr 2014 19:07:01 +0000 (15:07 -0400)]
xenctx: Add -m (--memory) <maddr> option to dump memory at maddr.

Currently not supported on ARM.

New routine read_mem_word() will correctly read a word that crosses
a page boundary.  It will not fault if the 2nd page can not be
mapped.

Moved xenctx because guest_word_t is not defined where it was.

Here is an example:

Memory (address ffffffff803ddf90):
 ffffffff80048d19 0000000000200800 ffffffff803e7801 0000000000086800
 0000000000000000 ffffffff80430720 ffffffff803e722f 80008e000010019c
 00000000ffffffff 0000000000000000 0000000000000000 0000000000200000
 0000000000000000 0000000000000000 0000000000000000 00cf9b000000ffff
 00af9b000000ffff 00cf93000000ffff 00cffb000000ffff 00cff3000000ffff

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add output of stack address to Call and Stack Trace.
Don Slutz [Thu, 3 Apr 2014 19:07:00 +0000 (15:07 -0400)]
xenctx: Add output of stack address to Call and Stack Trace.

Here is an example:

Call Trace:
                   [<ffffffff8006b2b0>] default_idle+0x29 <--
ffffffff803ddf90:  [<ffffffff80048d19>] cpu_idle+0x95
ffffffff803ddfa0:  [<ffffffff803e7801>] start_kernel+0x220
ffffffff803ddfc0:  [<ffffffff803e722f>] x86_64_start_kernel+0x22f

and

Stack Trace:
                 * [<ffffffff8006b2b0>] default_idle+0x29 <--
ffffffff803ddf90:  [<ffffffff80048d19>] cpu_idle+0x95
ffffffff803ddf98:    0000000000200800
ffffffff803ddfa0:  [<ffffffff803e7801>] start_kernel+0x220
ffffffff803ddfa8:    0000000000086800
ffffffff803ddfb0:    0000000000000000
ffffffff803ddfb8:    ffffffff80430720
ffffffff803ddfc0:  [<ffffffff803e722f>] x86_64_start_kernel+0x22f
ffffffff803ddfc8:    80008e000010019c
ffffffff803ddfd0:    00000000ffffffff
ffffffff803ddfd8:    0000000000000000
ffffffff803ddfe0:    0000000000000000
ffffffff803ddfe8:    0000000000200000
ffffffff803ddff0:    0000000000000000
ffffffff803ddff8:    0000000000000000

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: More info on failed to map page.
Don Slutz [Thu, 3 Apr 2014 19:06:59 +0000 (15:06 -0400)]
xenctx: More info on failed to map page.

Also output an extra new line since we may be in the middle of output.

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
11 years agoxenctx: Change print_symbol to do the space before.
Don Slutz [Thu, 3 Apr 2014 19:06:58 +0000 (15:06 -0400)]
xenctx: Change print_symbol to do the space before.

This stops the output of an extra space at the end of the line.

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
11 years agoxenctx: Add command line option -t (--tag-stack-dump)
Don Slutz [Thu, 3 Apr 2014 19:06:57 +0000 (15:06 -0400)]
xenctx: Add command line option -t (--tag-stack-dump)

If specified, add stack address to dump.

This is not the default because the result exceeds 80 characters per line.

Here is an example:

Stack:
ffffffff803ddf90ffffffff80048d19 0000000000200800 ffffffff803e7801 0000000000086800
ffffffff803ddfb00000000000000000 ffffffff80430720 ffffffff803e722f 80008e000010019c
ffffffff803ddfd000000000ffffffff 0000000000000000 0000000000000000 0000000000200000
ffffffff803ddff00000000000000000 0000000000000000

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add command line option -D (--decode-as-ascii)
Don Slutz [Thu, 3 Apr 2014 19:06:56 +0000 (15:06 -0400)]
xenctx: Add command line option -D (--decode-as-ascii)

If specified, output ascii version of stack also.

This is not the default because the result exceeds 80 characters per line.

Here is an example:

Stack:
 ffffffff80048d19 0000000000200800 ffffffff803e7801 0000000000086800  .......... ......x>......h......
 0000000000000000 ffffffff80430720 ffffffff803e722f 80008e000010019c  ........ .C...../r>.............
 00000000ffffffff 0000000000000000 0000000000000000 0000000000200000  .......................... .....
 0000000000000000 0000000000000000                                    ................

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add command line options -b (--bytes-per-line) and -l (--lines)
Don Slutz [Thu, 3 Apr 2014 19:06:55 +0000 (15:06 -0400)]
xenctx: Add command line options -b (--bytes-per-line) and -l (--lines)

  -b <bytes>, --bytes-per-line <bytes>
                     change the number of bytes per line output for Stack.
                     (default 32) Note: rounded to native size (4 or 8 bytes).

This option allows you to change the width of the output line.  When
used with the -D option and/or -t, the output can be adjusted with
this to less then 80 columns.

  -l <lines>, --lines <lines>
                     change the number of lines output for Stack. (default 5)
                     Can be specified as MAX.  Note: Fewer lines will be output
                     if stack limit reached.

The default value show a reasonable amount of the raw stack.  The -S
option will output all of it one line at a time.  This can be used
to select something in the middle.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Add -n (--display-stack-pages) option to output larger stack
Don Slutz [Thu, 3 Apr 2014 19:06:54 +0000 (15:06 -0400)]
xenctx: Add -n (--display-stack-pages) option to output larger stack

Important: This is the stack size (also known as stack limit) to
display, not the configured stack size.

Note: use with caution (easy to get garbage).

Below is a pictures of a downwards growing configured 3 page stack,
and where the SP currently is.  Each box is a page.

+ pages                     -n 1    -n 2    -n 3

End of Memory
       +------------------+
       |                  |
       |                  |
       |                  |
       |                  |
       |                  |
       +------------------+
...
       +------------------+
       |                  |
       |                  |
       |                  |
       |                  |
MAX+3  |                  |
       +------------------+                   *
       |                  |                   |
       |                  |                   |
       |                  |                   |
       |                  |                   |
MAX+2  |                  |                   |
       +------------------+           *       |
       |                  |           |       |
       |                  |           |       |
       |                  |           |       |
       |                  |           |       |
MAX+1  |                  |           |       |
       +------------------+   *       |       |
       |                  |   |       |       |
SP --> |                  |   *       *       *
       |                  |
       |                  |
MAX    |                  |
       +------------------+
...
       +------------------+
       |                  |
       |                  |
       |                  |
       |                  |
0      |                  |
       +------------------+

Display using "-n 3" since the used stack pages is 3.

At a different time, the SP may be in the 1st page and so "-n 3"
will display garbage.

For example:

$ xenctx -s /boot/System.map-2.6.32-279.2.1.el6.x86_64 3 1 -n 1
...
Call Trace:
                    [<ffffffff81346898>] io_serial_out+0x18 <--
ffff880032bb1310:   [<ffffffff81346f51>] serial8250_console_putchar+0x31
ffff880032bb1330:   [<ffffffff813428de>] uart_console_write+0x3e
ffff880032bb1338:   [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
ffff880032bb1370:   [<ffffffff813472ad>] serial8250_console_write+0xbd
ffff880032bb13c0:   [<ffffffff8106b8f5>] __call_console_drivers+0x75
ffff880032bb13f0:   [<ffffffff8106b95a>] _call_console_drivers+0x4a
ffff880032bb1410:   [<ffffffff8106be6e>] release_console_sem+0x4e
ffff880032bb1450:   [<ffffffff8106c628>] vprintk+0x248
ffff880032bb14f0:   [<ffffffff814fd363>] printk+0x41

$ xenctx -s /boot/System.map-2.6.32-279.2.1.el6.x86_64 3 1 -n 2
...
Call Trace:
                    [<ffffffff81346898>] io_serial_out+0x18 <--
ffff880032bb1310:   [<ffffffff81346f51>] serial8250_console_putchar+0x31
ffff880032bb1330:   [<ffffffff813428de>] uart_console_write+0x3e
ffff880032bb1338:   [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
ffff880032bb1370:   [<ffffffff813472ad>] serial8250_console_write+0xbd
ffff880032bb13c0:   [<ffffffff8106b8f5>] __call_console_drivers+0x75
ffff880032bb13f0:   [<ffffffff8106b95a>] _call_console_drivers+0x4a
ffff880032bb1410:   [<ffffffff8106be6e>] release_console_sem+0x4e
ffff880032bb1450:   [<ffffffff8106c628>] vprintk+0x248
ffff880032bb14f0:   [<ffffffff814fd363>] printk+0x41

$ xenctx -s /boot/System.map-2.6.32-279.2.1.el6.x86_64 3 1 -n 3
...
Call Trace:
                    [<ffffffff81346898>] io_serial_out+0x18 <--
ffff880032bb1310:   [<ffffffff81346f51>] serial8250_console_putchar+0x31
ffff880032bb1330:   [<ffffffff813428de>] uart_console_write+0x3e
ffff880032bb1338:   [<ffffffff8100bc0e>] apic_timer_interrupt+0xe
ffff880032bb1370:   [<ffffffff813472ad>] serial8250_console_write+0xbd
ffff880032bb13c0:   [<ffffffff8106b8f5>] __call_console_drivers+0x75
ffff880032bb13f0:   [<ffffffff8106b95a>] _call_console_drivers+0x4a
ffff880032bb1410:   [<ffffffff8106be6e>] release_console_sem+0x4e
ffff880032bb1450:   [<ffffffff8106c628>] vprintk+0x248
ffff880032bb14f0:   [<ffffffff814fd363>] printk+0x41
ffff880032bb3f20:   [<ffffffff8100204c>] do_one_initcall+0x3c
ffff880032bb3f50:   [<ffffffff810b0eb1>] sys_init_module+0xe1
ffff880032bb3f80:   [<ffffffff8100b0f2>] system_call_fastpath+0x16

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Clean up stack trace when hypercall_page not in symbol table
Don Slutz [Thu, 3 Apr 2014 19:06:53 +0000 (15:06 -0400)]
xenctx: Clean up stack trace when hypercall_page not in symbol table

Before:

Call Trace:
  [<ffffffff8006b2b0>] default_idle+0x29  <--
  [<ffffffff80048d19>] cpu_idle+0x95
  [<ffffffff803e7801>] start_kernel+0x220
  [<0000000000000000>] startup_64+0x80000000
  [<ffffffff803e722f>] x86_64_start_kernel+0x22f
  [<0000000000000000>] startup_64+0x80000000
  [<0000000000000000>] startup_64+0x80000000
  [<0000000000000000>] startup_64+0x80000000
  [<0000000000000000>] startup_64+0x80000000

After:

Call Trace:
  [<ffffffff8006b2b0>] default_idle+0x29  <--
  [<ffffffff80048d19>] cpu_idle+0x95
  [<ffffffff803e7801>] start_kernel+0x220
  [<ffffffff803e722f>] x86_64_start_kernel+0x22f

Signed-off-by: Don Slutz <Don@CloudSwitch.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
11 years agoxenctx: clean up usage output
Don Slutz [Thu, 3 Apr 2014 19:06:52 +0000 (15:06 -0400)]
xenctx: clean up usage output

Fix usage formatting to be all the same.

Fix usage display of default --kernel-start for 64 bit.

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxenctx: Correct FMT_??B_WORD for arm64.
Ian Campbell [Thu, 3 Apr 2014 19:06:51 +0000 (15:06 -0400)]
xenctx: Correct FMT_??B_WORD for arm64.

These should all be unsigned long long to match various variables used
in the code, same as x86_64.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Don Slutz <dslutz@verizon.com>
11 years agoRevert "Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workar...
Ian Campbell [Thu, 3 Apr 2014 16:54:34 +0000 (17:54 +0100)]
Revert "Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround""

This reverts commit 1be5c1947fd52f5faaf6b678a829d47b0ec88bfd, effectively
reinstating 6c21cb36e263de2db8716b477157a5b6cd531e1e.

Without this booting dom0 on systems with >4GB of RAM is broken because the
guest gets allocated a memory range which it cannot access.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen: arm: document what low level primitives we have imported from Linux
Ian Campbell [Wed, 26 Mar 2014 13:38:52 +0000 (13:38 +0000)]
xen: arm: document what low level primitives we have imported from Linux

As part of the recent update I had to reverse engineer what we had, which was
very tedious. Check in my notes so that I have a reference for next time.

Now the secret is to remember to update this file every time!

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm: refactor xchg and cmpxchg into their own headers
Ian Campbell [Wed, 26 Mar 2014 13:38:51 +0000 (13:38 +0000)]
xen: arm: refactor xchg and cmpxchg into their own headers

Since these functions are taken from Linux this makes it easier to compare
against the Lihnux cmpxchg.h headers (which were split out from Linux's
system.h a while back).

Since these functions are from Linux the intention is to use Linux coding
style, therefore include a suitable emacs magic block.

For this reason also fix up the indentation in the 32-bit version to use hard
tabs while moving it. The 64-bit version was already correct.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm64: optimised clear_page
Ian Campbell [Wed, 19 Mar 2014 17:19:56 +0000 (17:19 +0000)]
xen: arm64: optimised clear_page

Taken from Linux v3.14-rc7.

The clear_page header now needs to be within the !__ASSEMBLY__

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm64: assembly optimised mem* and str*
Ian Campbell [Wed, 26 Mar 2014 13:38:49 +0000 (13:38 +0000)]
xen: arm64: assembly optimised mem* and str*

Taken from Linux v3.14-rc7.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm64: asm: remove redundant "cc" clobbers
Ian Campbell [Wed, 26 Mar 2014 13:38:48 +0000 (13:38 +0000)]
xen: arm64: asm: remove redundant "cc" clobbers

This resyncs atomics and cmpxchgs with Linux v3.14-rc7 by importing:
commit 95c4189689f92fba7ecf9097173404d4928c6e9b
Author: Will Deacon <will.deacon@arm.com>
Date:   Tue Feb 4 12:29:13 2014 +0000

    arm64: asm: remove redundant "cc" clobbers

    cbnz/tbnz don't update the condition flags, so remove the "cc" clobbers
    from inline asm blocks that only use these instructions to implement
    conditional branches.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm64: reinstate hard tabs in system.h cmpxchg
Ian Campbell [Wed, 26 Mar 2014 13:38:47 +0000 (13:38 +0000)]
xen: arm64: reinstate hard tabs in system.h cmpxchg

These functions are from Linux and the intention was to keep the formatting
the same to make resyncing easier.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm64: atomics: fix use of acquire + release for full barrier semantics
Ian Campbell [Wed, 26 Mar 2014 13:38:46 +0000 (13:38 +0000)]
xen: arm64: atomics: fix use of acquire + release for full barrier semantics

Xen, like Linux, expects full barrier semantics for bitops, atomics and
cmpxchgs. This issue was discovered on Linux and we get our implementation of
these from Linux so quoting Will Deacon in Linux commit 8e86f0b409a4 for the
gory details:
    Linux requires a number of atomic operations to provide full barrier
    semantics, that is no memory accesses after the operation can be
    observed before any accesses up to and including the operation in
    program order.

    On arm64, these operations have been incorrectly implemented as follows:

        // A, B, C are independent memory locations

        <Access [A]>

        // atomic_op (B)
    1:  ldaxr   x0, [B]         // Exclusive load with acquire
        <op(B)>
        stlxr   w1, x0, [B]     // Exclusive store with release
        cbnz    w1, 1b

        <Access [C]>

    The assumption here being that two half barriers are equivalent to a
    full barrier, so the only permitted ordering would be A -> B -> C
    (where B is the atomic operation involving both a load and a store).

    Unfortunately, this is not the case by the letter of the architecture
    and, in fact, the accesses to A and C are permitted to pass their
    nearest half barrier resulting in orderings such as Bl -> A -> C -> Bs
    or Bl -> C -> A -> Bs (where Bl is the load-acquire on B and Bs is the
    store-release on B). This is a clear violation of the full barrier
    requirement.

    The simple way to fix this is to implement the same algorithm as ARMv7
    using explicit barriers:

        <Access [A]>

        // atomic_op (B)
        dmb     ish             // Full barrier
    1:  ldxr    x0, [B]         // Exclusive load
        <op(B)>
        stxr    w1, x0, [B]     // Exclusive store
        cbnz    w1, 1b
        dmb     ish             // Full barrier

        <Access [C]>

    but this has the undesirable effect of introducing *two* full barrier
    instructions. A better approach is actually the following, non-intuitive
    sequence:

        <Access [A]>

        // atomic_op (B)
    1:  ldxr    x0, [B]         // Exclusive load
        <op(B)>
        stlxr   w1, x0, [B]     // Exclusive store with release
        cbnz    w1, 1b
        dmb     ish             // Full barrier

        <Access [C]>

    The simple observations here are:

      - The dmb ensures that no subsequent accesses (e.g. the access to C)
        can enter or pass the atomic sequence.

      - The dmb also ensures that no prior accesses (e.g. the access to A)
        can pass the atomic sequence.

      - Therefore, no prior access can pass a subsequent access, or
        vice-versa (i.e. A is strictly ordered before C).

      - The stlxr ensures that no prior access can pass the store component
        of the atomic operation.

    The only tricky part remaining is the ordering between the ldxr and the
    access to A, since the absence of the first dmb means that we're now
    permitting re-ordering between the ldxr and any prior accesses.

    From an (arbitrary) observer's point of view, there are two scenarios:

      1. We have observed the ldxr. This means that if we perform a store to
         [B], the ldxr will still return older data. If we can observe the
         ldxr, then we can potentially observe the permitted re-ordering
         with the access to A, which is clearly an issue when compared to
         the dmb variant of the code. Thankfully, the exclusive monitor will
         save us here since it will be cleared as a result of the store and
         the ldxr will retry. Notice that any use of a later memory
         observation to imply observation of the ldxr will also imply
         observation of the access to A, since the stlxr/dmb ensure strict
         ordering.

      2. We have not observed the ldxr. This means we can perform a store
         and influence the later ldxr. However, that doesn't actually tell
         us anything about the access to [A], so we've not lost anything
         here either when compared to the dmb variant.

    This patch implements this solution for our barriered atomic operations,
    ensuring that we satisfy the full barrier requirements where they are
    needed.

Cc: <stable@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm64: disable alignment traps
Ian Campbell [Wed, 26 Mar 2014 13:38:45 +0000 (13:38 +0000)]
xen: arm64: disable alignment traps

The mem* primitives which I am about to import from Linux in a subsequent
patch rely on the hardware handling misalignment.

The benefits of an optimised memcpy etc outweigh the downsides.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm: remove atomic_clear_mask()
Ian Campbell [Wed, 26 Mar 2014 13:38:44 +0000 (13:38 +0000)]
xen: arm: remove atomic_clear_mask()

This has no users.

This brings arm32 atomic.h into sync with Linux v3.14-rc7.

arm64/atomic.h requires other patches for this to be the case.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: add optimised strchr and strrchr routines
Ian Campbell [Wed, 26 Mar 2014 13:38:43 +0000 (13:38 +0000)]
xen: arm32: add optimised strchr and strrchr routines

Taken from Linux v3.14-rc7.

These aren't widely used enough to be critical, but we may as well have them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: add optimised memchr routine
Ian Campbell [Wed, 26 Mar 2014 13:38:42 +0000 (13:38 +0000)]
xen: arm32: add optimised memchr routine

This isn't used enough to be critical, but it completes the set of mem*.

Taken from Linux v3.14-rc7.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: resync mem* with Linux v3.14-rc7
Ian Campbell [Wed, 26 Mar 2014 13:38:41 +0000 (13:38 +0000)]
xen: arm32: resync mem* with Linux v3.14-rc7

This pulls in the following Linux commits:
commit 455bd4c430b0c0a361f38e8658a0d6cb469942b5
Author: Ivan Djelic <ivan.djelic@parrot.com>
Date:   Wed Mar 6 20:09:27 2013 +0100

    ARM: 7668/1: fix memset-related crashes caused by recent GCC (4.7.2) optimi

    Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on
    assumptions about the implementation of memset and similar functions.
    The current ARM optimized memset code does not return the value of
    its first argument, as is usually expected from standard implementations.

    For instance in the following function:

    void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *waite
    {
        memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter));
        waiter->magic = waiter;
        INIT_LIST_HEAD(&waiter->list);
    }

    compiled as:

    800554d0 <debug_mutex_lock_common>:
    800554d0:       e92d4008        push    {r3, lr}
    800554d4:       e1a00001        mov     r0, r1
    800554d8:       e3a02010        mov     r2, #16 ; 0x10
    800554dc:       e3a01011        mov     r1, #17 ; 0x11
    800554e0:       eb04426e        bl      80165ea0 <memset>
    800554e4:       e1a03000        mov     r3, r0
    800554e8:       e583000c        str     r0, [r3, #12]
    800554ec:       e5830000        str     r0, [r3]
    800554f0:       e5830004        str     r0, [r3, #4]
    800554f4:       e8bd8008        pop     {r3, pc}

    GCC assumes memset returns the value of pointer 'waiter' in register r0; ca
    register/memory corruptions.

    This patch fixes the return value of the assembly version of memset.
    It adds a 'mov' instruction and merges an additional load+store into
    existing load/store instructions.
    For ease of review, here is a breakdown of the patch into 4 simple steps:

    Step 1
    ======
    Perform the following substitutions:
    ip -> r8, then
    r0 -> ip,
    and insert 'mov ip, r0' as the first statement of the function.
    At this point, we have a memset() implementation returning the proper resul
    but corrupting r8 on some paths (the ones that were using ip).

    Step 2
    ======
    Make sure r8 is saved and restored when (! CALGN(1)+0) == 1:

    save r8:
    -       str     lr, [sp, #-4]!
    +       stmfd   sp!, {r8, lr}

    and restore r8 on both exit paths:
    -       ldmeqfd sp!, {pc}               @ Now <64 bytes to go.
    +       ldmeqfd sp!, {r8, pc}           @ Now <64 bytes to go.
    (...)
            tst     r2, #16
            stmneia ip!, {r1, r3, r8, lr}
    -       ldr     lr, [sp], #4
    +       ldmfd   sp!, {r8, lr}

    Step 3
    ======
    Make sure r8 is saved and restored when (! CALGN(1)+0) == 0:

    save r8:
    -       stmfd   sp!, {r4-r7, lr}
    +       stmfd   sp!, {r4-r8, lr}

    and restore r8 on both exit paths:
            bgt     3b
    -       ldmeqfd sp!, {r4-r7, pc}
    +       ldmeqfd sp!, {r4-r8, pc}
    (...)
            tst     r2, #16
            stmneia ip!, {r4-r7}
    -       ldmfd   sp!, {r4-r7, lr}
    +       ldmfd   sp!, {r4-r8, lr}

    Step 4
    ======
    Rewrite register list "r4-r7, r8" as "r4-r8".

Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Reviewed-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
commit 418df63adac56841ef6b0f1fcf435bc64d4ed177
Author: Nicolas Pitre <nicolas.pitre@linaro.org>
Date:   Tue Mar 12 13:00:42 2013 +0100

    ARM: 7670/1: fix the memset fix

    Commit 455bd4c430b0 ("ARM: 7668/1: fix memset-related crashes caused by
    recent GCC (4.7.2) optimizations") attempted to fix a compliance issue
    with the memset return value.  However the memset itself became broken
    by that patch for misaligned pointers.

    This fixes the above by branching over the entry code from the
    misaligned fixup code to avoid reloading the original pointer.

    Also, because the function entry alignment is wrong in the Thumb mode
    compilation, that fixup code is moved to the end.

    While at it, the entry instructions are slightly reworked to help dual
    issue pipelines.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Alexander Holler <holler@ahsoftware.de>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: resync atomics with (almost) v3.14-rc7
Ian Campbell [Wed, 26 Mar 2014 13:38:40 +0000 (13:38 +0000)]
xen: arm32: resync atomics with (almost) v3.14-rc7

Almost because I omitting aed3a4e "ARM: 7868/1: arm/arm64: remove
atomic_clear_mask() ..." which I will apply to both arm32 and arm64
simultaneously in a later patch.

This pulls in the following Linux patches:

commit f38d999c4d16fc0fce4270374f15fbb2d8713c09
Author: Will Deacon <will.deacon@arm.com>
Date:   Thu Jul 4 11:43:18 2013 +0100

    ARM: atomics: prefetch the destination word for write prior to strex

    The cost of changing a cacheline from shared to exclusive state can be
    significant, especially when this is triggered by an exclusive store,
    since it may result in having to retry the transaction.

    This patch prefixes our atomic access implementations with pldw
    instructions (on CPUs which support them) to try and grab the line in
    exclusive state from the start. Only the barrier-less functions are
    updated, since memory barriers can limit the usefulness of prefetching
    data.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
commit 4dcc1cf7316a26e112f5c9fcca531ff98ef44700
Author: Chen Gang <gang.chen@asianux.com>
Date:   Sat Oct 26 15:07:25 2013 +0100

    ARM: 7867/1: include: asm: use 'int' instead of 'unsigned long' for 'oldval

    For atomic_cmpxchg(), the type of 'oldval' need be 'int' to match the
    type of "*ptr" (used by 'ldrex' instruction) and 'old' (used by 'teq'
    instruction).

Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm32: replace hard tabs in atomics.h
Ian Campbell [Wed, 26 Mar 2014 13:38:39 +0000 (13:38 +0000)]
xen: arm32: replace hard tabs in atomics.h

This file is from Linux and the intention was to keep the formatting the same
to make resyncing easier. Put the hardtabs back and adjust the emacs magic to
reflect the desired use of whitespace.

Adjust the 64-bit emacs magic too.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: ensure cmpxchg has full barrier semantics
Ian Campbell [Wed, 26 Mar 2014 13:38:38 +0000 (13:38 +0000)]
xen: arm32: ensure cmpxchg has full barrier semantics

Unrelated reads/writes should not pass the xchg.

Provide cmpxchg_local for parity with arm64, although it appears to be unused.
It also helps make the reason for the separation of __cmpxchg_mb more
apparent.

With this our cmpxchg is in sync with Linux v3.14-rc7.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: arm32: resync bitops with Linux v3.14-rc7
Ian Campbell [Wed, 26 Mar 2014 13:38:37 +0000 (13:38 +0000)]
xen: arm32: resync bitops with Linux v3.14-rc7

This pulls in the following Linux commits:

commit c36ef4b1762302a493c6cb754073bded084700e2
Author: Will Deacon <will.deacon@arm.com>
Date:   Wed Nov 23 11:28:25 2011 +0100

    ARM: 7171/1: unwind: add unwind directives to bitops assembly macros

    The bitops functions (e.g. _test_and_set_bit) on ARM do not have unwind
    annotations and therefore the kernel cannot backtrace out of them on a
    fatal error (for example, NULL pointer dereference).

    This patch annotates the bitops assembly macros with UNWIND annotations
    so that we can produce a meaningful backtrace on error. Callers of the
    macros are modified to pass their function name as a macro parameter,
    enforcing that the macros are used as standalone function implementations.

Acked-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
commit d779c07dd72098a7416d907494f958213b7726f3
Author: Will Deacon <will.deacon@arm.com>
Date:   Thu Jun 27 12:01:51 2013 +0100

    ARM: bitops: prefetch the destination word for write prior to strex

    The cost of changing a cacheline from shared to exclusive state can be
    significant, especially when this is triggered by an exclusive store,
    since it may result in having to retry the transaction.

    This patch prefixes our atomic bitops implementation with prefetchw,
    to try and grab the line in exclusive state from the start. The testop
    macro is left alone, since the barrier semantics limit the usefulness
    of prefetching data.

Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
commit b7ec699405f55667caeb46d96229d75bf33a83ad
Author: Will Deacon <will.deacon@arm.com>
Date:   Tue Nov 19 15:46:11 2013 +0100

    ARM: 7893/1: bitops: only emit .arch_extension mp if CONFIG_SMP

    Uwe reported a build failure when targetting a NOMMU platform with my
    recent prefetch changes:

      arch/arm/lib/changebit.S: Assembler messages:
      arch/arm/lib/changebit.S:15: Error: architectural extension `mp' is
                        not allowed for the current base architecture

    This is due to use of the .arch_extension mp directive immediately prior
    to an ALT_SMP(...) instruction. Whilst the ALT_SMP macro will expand to
    nothing if !CONFIG_SMP, gas will still choke on the directive.

    This patch fixes the issue by only emitting the sequence (including the
    directive) if CONFIG_SMP=y.

Tested-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoxen: x86 & generic: change to __builtin_prefetch()
Ian Campbell [Wed, 26 Mar 2014 13:38:36 +0000 (13:38 +0000)]
xen: x86 & generic: change to __builtin_prefetch()

Quoting Andi Kleen in Linux b483570a13be from 2007:
    gcc 3.2+ supports __builtin_prefetch, so it's possible to use it on all
    architectures. Change the generic fallback in linux/prefetch.h to use it
    instead of noping it out. gcc should do the right thing when the
    architecture doesn't support prefetching

    Undefine the x86-64 inline assembler version and use the fallback.

ARM wants to use the builtins.

Fix a pair of spelling errors, one of which was from Lucas De Marchi in the
Linux tree.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Acked-by: Tim Deegan <tim@xen.org>
11 years agoRevert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround"
Ian Campbell [Wed, 2 Apr 2014 12:03:36 +0000 (13:03 +0100)]
Revert "xen/arm: Allocate memory for dom0 from the bottom with the 1:1 Workaround"

This reverts commit 6c21cb36e263de2db8716b477157a5b6cd531e1e.

The Linux = issue which this works around was fixed in v3.13 via f52bb722547f
"ARM: mm: Correct virt_to_phys patching for 64 bit physical addresses".

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm32: don't force the compiler to allocate a dummy register
Ian Campbell [Thu, 3 Apr 2014 08:59:43 +0000 (09:59 +0100)]
xen: arm32: don't force the compiler to allocate a dummy register

TLBIALLH, ICIALLU and BPIALL make no use of their register argument. Instead
of making the compiler allocate a dummy register just hardcode r0, there is no
need to represent this in the inline asm since the register is neither
clobbered nor used in any way.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agoxen: arm: flush TLB on all CPUs when setting or clearing fixmaps
Ian Campbell [Thu, 3 Apr 2014 08:59:42 +0000 (09:59 +0100)]
xen: arm: flush TLB on all CPUs when setting or clearing fixmaps

These mappings are global and therefore need flushing on all processors. Add
flush_all_xen_data_tlb_range_va which accomplishes this.

Likewise when removing the early mappings

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
[ ijc -- fixed coding style ]

11 years agoxen: arm: consolidate body of flush_xen_data_tlb_range_va_local
Ian Campbell [Thu, 3 Apr 2014 08:59:41 +0000 (09:59 +0100)]
xen: arm: consolidate body of flush_xen_data_tlb_range_va_local

This is almost identical on both sub architectures.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
[ ijc -- fixed coding style ]

11 years agoxen: arm: clarify naming of the Xen TLB flushing functions
Ian Campbell [Thu, 3 Apr 2014 08:59:40 +0000 (09:59 +0100)]
xen: arm: clarify naming of the Xen TLB flushing functions

All of the flush_xen_*_tlb functions operate on the local processor only. Add
_local to the name and update the comments to clarify.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
11 years agox86/mm: fix checks against max_mapped_pfn
Jan Beulich [Thu, 3 Apr 2014 07:47:28 +0000 (08:47 +0100)]
x86/mm: fix checks against max_mapped_pfn

This value is an inclusive one, i.e. this fixes an off-by-one in memory
sharing and an off-by-two in shadow code.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
11 years agox86/HVM: fix setting mem access to default
Jan Beulich [Wed, 2 Apr 2014 08:09:33 +0000 (09:09 +0100)]
x86/HVM: fix setting mem access to default

commit 3b0bcb89 ("x86/mm/p2m: Move p2m code in HVMOP_[gs]et_mem_access
into p2m.c") introduced an off-by-one mistake forcing an input of
HVMMEM_access_default to always fail. Since related, also eliminate the
inefficient setup of an on-stack array for each function invocation.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
11 years agox86/HVM: fix preemption handling in do_hvm_op() (try 2)
Jan Beulich [Wed, 2 Apr 2014 08:09:00 +0000 (09:09 +0100)]
x86/HVM: fix preemption handling in do_hvm_op() (try 2)

Just like previously done for some mem-op hypercalls, undo preemption
using the interface structures (altering it in ways the caller may not
expect) and replace it by storing the continuation point in the high
bits of sub-operation argument.

This also changes the "nr" fields of struct xen_hvm_track_dirty_vram
(operation already limited to 1Gb worth of pages) and struct
xen_hvm_modified_memory to be only 32 bits wide, consistent with those
of struct xen_set_mem{type,access}. If that's not acceptable for some
reason, we'd need to shrink the HVMOP_op_bits (while still enforcing
the [then higher] limit resulting from the need to be able to encode
the continuation).

Whether (and if so how) to adjust xc_hvm_track_dirty_vram(),
xc_hvm_modified_memory(), xc_hvm_set_mem_type(), and
xc_hvm_set_mem_access() to reflect the 32-bit restriction on "nr" is
unclear: If the APIs need to remain stable, all four functions should
probably check that there was no truncation. Preferably their
parameters would be changed to uint32_t or unsigned int, though.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
11 years agox86/mm: Fix compile with DEBUG_TRACE_DUMP turned on
Aravindh Puthiyaparambil [Tue, 1 Apr 2014 00:32:54 +0000 (17:32 -0700)]
x86/mm: Fix compile with DEBUG_TRACE_DUMP turned on

Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
Acked-by: Tim Deegan <tim@xen.org>
11 years agocommon/domctl: some functions are only used internally
Julien Grall [Wed, 2 Apr 2014 15:46:35 +0000 (17:46 +0200)]
common/domctl: some functions are only used internally

The list of function above are only used internally in common/domctl.c.
    - bitmap_to_xenctl_bitmap
    - xenctl_bitmap_to_bitmap
    - nodemask_to_xenctl_bitmap
    - xenctl_bitmap_to_nodemask

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoMerge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging
Ian Campbell [Wed, 2 Apr 2014 13:15:56 +0000 (14:15 +0100)]
Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging

11 years agons16550: make some initialisation common
Ian Campbell [Wed, 26 Mar 2014 11:55:55 +0000 (11:55 +0000)]
ns16550: make some initialisation common

Should avoid accidents like forgetting to init lsr_mask for DT devices in the
future.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
11 years agons16550: setup default lsr_mask for DT systems too
Ian Campbell [Wed, 26 Mar 2014 11:55:54 +0000 (11:55 +0000)]
ns16550: setup default lsr_mask for DT systems too

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-By: Pranavkumar Sawargaonkar <pranavkumar@linaro.org>
Tested-By: Chen Baozi <baozich@gmail.com>
Cc: keir@xen.org
11 years agocrypto: rijndael: fix compilation with Clang 3.5
Julien Grall [Tue, 1 Apr 2014 16:24:43 +0000 (18:24 +0200)]
crypto: rijndael: fix compilation with Clang 3.5

Td0, Td1, Td2, Td3, Td4 are only used when NEED_RIJNDAEL is defined.

rijndael.c:383:18: error: unused variable 'Td0' [-Werror,-Wunused-const-variable]
static const u32 Td0[256] = {
                 ^
rijndael.c:449:18: error: unused variable 'Td1' [-Werror,-Wunused-const-variable]
static const u32 Td1[256] = {
                 ^
rijndael.c:515:18: error: unused variable 'Td2' [-Werror,-Wunused-const-variable]
static const u32 Td2[256] = {
                 ^
rijndael.c:581:18: error: unused variable 'Td3' [-Werror,-Wunused-const-variable]
static const u32 Td3[256] = {
                 ^
rijndael.c:647:18: error: unused variable 'Td4' [-Werror,-Wunused-const-variable]
static const u32 Td4[256] = {

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoevtchn: rearrange fields
Daniel De Graaf [Tue, 1 Apr 2014 16:22:40 +0000 (18:22 +0200)]
evtchn: rearrange fields

Event channel arrays are allocated in blocks with EVTCHNS_PER_BUCKET
elements, which must be a power of 2.  When XSM is disabled, struct
evtchn is 32 bytes including padding; however, when XSM is enabled, the
structure becomes larger and EVTCHNS_PER_BUCKET is halved.  Rearranging
some of the fields in struct evtchn allows a 4-byte XSM field to fit
within the 32-byte structure.

This rearrangement turns the xen_consumer field of struct evtchn into a
bitfield and adjusts the xen_consumers array to fit the number of
addressable elements from this value.  Since there are currently only
two users of this array, only 3 bits (7 values) are reserved.  This
field is also used rarely enough that the slight overhead from applying
a bitmask should not cause problems.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agofix sed usage in build rules
Jan Beulich [Tue, 1 Apr 2014 16:21:43 +0000 (18:21 +0200)]
fix sed usage in build rules

Apparently FreeBSD sed is more picky than GNU sed, wanting a semicolon
at the end of a brace enclosed statement list.

Reported-by: Roger Pau Monné<roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoinclude: fix Makefile for FreeBSD
Jan Beulich [Tue, 1 Apr 2014 16:20:58 +0000 (18:20 +0200)]
include: fix Makefile for FreeBSD

Don't use non-standard extensions:
- \t in bracket expressions
- \+ in basic regular expressions

Reported-by: Roger Pau Monné<roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné<roger.pau@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoVMX: fix PAT value seen by guest
Jan Beulich [Tue, 1 Apr 2014 14:49:18 +0000 (16:49 +0200)]
VMX: fix PAT value seen by guest

The XSA-60 fixes introduced a window during which the guest PAT gets
forced to all zeros. This shouldn't be visible to the guest. Therefore
we need to intercept PAT MSR accesses during that time period.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Liu Jinsong <jinsong.liu@intel.com>
11 years agokexec: propagate ENOMEM result in error handling
Matthew Daley [Tue, 1 Apr 2014 14:48:02 +0000 (16:48 +0200)]
kexec: propagate ENOMEM result in error handling

...otherwise if kimage_alloc_control_page fails (presumably due to
out-of-memory; see the invocation just before this one), the caller of
do_kimage_alloc will think the call was successful.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
11 years agocpupool: cpupool_unassign_cpu is only used internally
Julien Grall [Tue, 1 Apr 2014 14:44:50 +0000 (16:44 +0200)]
cpupool: cpupool_unassign_cpu is only used internally

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
11 years agopv-grub: correct sizeof usage
Matthew Daley [Sat, 29 Mar 2014 05:08:08 +0000 (18:08 +1300)]
pv-grub: correct sizeof usage

We were lucky that sizeof(frame) >= sizeof(*frame) anyway.

Signed-off-by: Matthew Daley <mattd@bugfuzz.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Replace early_{printk, panic} call to {printk, panic} call
Julien Grall [Thu, 13 Mar 2014 15:09:18 +0000 (15:09 +0000)]
xen/arm: Replace early_{printk, panic} call to {printk, panic} call

Now that the console supports earlyprintk, we can get a rid of
early_printk and early_panic calls.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/console: Add support for early printk
Julien Grall [Thu, 13 Mar 2014 15:09:17 +0000 (15:09 +0000)]
xen/console: Add support for early printk

On ARM, a function (early_printk) was introduced to output message when the
serial port is not initialized.

This solution is fragile because the developper needs to know when the serial
port is initialized, to use either early_printk or printk. Moreover some
functions (mainly in common code), only use printk. This will result to a loss
of message sometimes.

Directly call early_printk in console code when the serial port is not yet
initialized. For this purpose use serial_steal_fn.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Keir Fraser <keir@xen.org>
11 years agoxen/arm: Rename EARLY_PRINTK compile option to CONFIG_EARLY_PRINTK
Julien Grall [Thu, 13 Mar 2014 15:09:16 +0000 (15:09 +0000)]
xen/arm: Rename EARLY_PRINTK compile option to CONFIG_EARLY_PRINTK

Most of common compile option start with CONFIG_. Rename EARLY_PRINTK option
to CONFIG_EARLY_PRINTK to be compliant.

This option will be used in common code (eg console) later.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: earlyprintk: export early_puts
Julien Grall [Thu, 13 Mar 2014 15:09:15 +0000 (15:09 +0000)]
xen/arm: earlyprintk: export early_puts

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Cambpell <ian.campbell@citrix.com>
11 years agoxen/arm: earlyprintk: move early_flush in early_puts
Julien Grall [Thu, 13 Mar 2014 15:09:14 +0000 (15:09 +0000)]
xen/arm: earlyprintk: move early_flush in early_puts

early_puts function will be exported to be used in the console code. To
avoid loosing characters (see why in commit cafdceb "xen/arm: avoid lost
characters with early_printk), early_flush needs to be called in this
function.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/serial: Don't leak memory mapping if the serial initialization has failed
Julien Grall [Fri, 28 Mar 2014 15:11:57 +0000 (15:11 +0000)]
xen/serial: Don't leak memory mapping if the serial initialization has failed

The memory mapping leaked when the serial driver failed to retrieve
the IRQ. We can safely move the call to ioremap after.

Also use ioremap_cache instead of ioremap_attr in some serial drivers.

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: Don't need to export p2m_load_VTTBR
Julien Grall [Wed, 19 Mar 2014 15:43:39 +0000 (15:43 +0000)]
xen/arm: Don't need to export p2m_load_VTTBR

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Use p2m_restore_state in construct_dom0
Julien Grall [Wed, 19 Mar 2014 15:43:38 +0000 (15:43 +0000)]
xen/arm: Use p2m_restore_state in construct_dom0

The address translation functions used while building dom0 rely on certain EL1
state being configured. In particular they are subject to the behaviour of
SCTLR_EL1.M (stage 1 MMU enabled).

The Xen (and Linux) boot protocol require that the kernel be entered with the
MMU disabled but they don't say anything explicitly about exception levels
other than the one which is active when entering the kernels. Arguably the
protocol could be said to apply to all exception levels but in any case we
should cope with this and setup the EL1 state as necessary.

Fu Wei discovered this when booting Xen from grub.efi over UEFI, it's not
clear whether grub or UEFI is responsible for leaving stage 1 MMU enabled.

Use directly the newly created function p2m_restore_state to retrieve a
correct EL1 state to translate an address.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Reported-by: Fu Wei <fu.wei@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agoxen/arm: Move p2m context save/restore in a separate function
Julien Grall [Wed, 19 Mar 2014 15:43:37 +0000 (15:43 +0000)]
xen/arm: Move p2m context save/restore in a separate function

Introduce p2m_{save,restore}_state to save/restore p2m context.

The both functions will take care of:
    - VTTBR: contains the pointer to the domain P2M
    - Update HCR_RW if the domain is 64 bit
    - SCTLR: contains bit to know if the MMU is enabled or not

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agodocs/Makefile: Split the install target
Andrew Cooper [Fri, 28 Mar 2014 11:24:05 +0000 (11:24 +0000)]
docs/Makefile: Split the install target

Split the current install target into two subtargets, install-man-pages and
install-html, with the main install target depending on both.

This helps packagers who want the man pages to put in appropriate rpms/debs,
but don't want to build the html developer docs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
11 years agodocs: Honour --{en, dis}able-xend when building docs
Andrew Cooper [Fri, 28 Mar 2014 11:24:04 +0000 (11:24 +0000)]
docs: Honour --{en, dis}able-xend when building docs

If a user has specified --disable-xend, they wont want the manpages either.

Propagating this parameters requires reorganising the way in which the
makefile chooses which documents to build.

There is now a split of {MAN1,MAN5,MARKDOWN,TXT}SRC-y to select which
documentation to build, which is separate from the patsubst section which
generates appropriate paths to trigger the later rules.

The manpages are quite easy to split between xend, xl and xenstore, and have
been.  Items from misc/ are much harder and been left.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
[ ijc -- reran autogen.sh as requested. ]

11 years agotools/libxl: Introduce libxl__malloc()
Andrew Cooper [Thu, 27 Mar 2014 17:41:55 +0000 (17:41 +0000)]
tools/libxl: Introduce libxl__malloc()

For those large allocations which are going to be filled immediately, where
redundantly clearing the memory would just be a waste of time.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
11 years agotools/libxl: Correct libxl__zalloc() to take an unsigned number of bytes
Andrew Cooper [Thu, 27 Mar 2014 17:41:54 +0000 (17:41 +0000)]
tools/libxl: Correct libxl__zalloc() to take an unsigned number of bytes

Convert 'int bytes' to 'size_t size' to mirror malloc(3) which it is
imitating, and calloc(3) which it is actually using.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
11 years agoMAINTAINERS: Add ARM UART drivers to "ARM ARCHITECTURE" part
Julien Grall [Wed, 12 Mar 2014 10:12:29 +0000 (10:12 +0000)]
MAINTAINERS: Add ARM UART drivers to "ARM ARCHITECTURE" part

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Keir Fraser <keir@xen.org>
11 years agoRevert "x86/HVM: fix preemption handling in do_hvm_op()"
Jan Beulich [Tue, 1 Apr 2014 08:41:29 +0000 (10:41 +0200)]
Revert "x86/HVM: fix preemption handling in do_hvm_op()"

This reverts commit 8bad6c5626129ffba04dbab3a38115b6f3669596
(clearly broken for 32-bit callers, reportedly broken also
for 64-bit Dom0 with qemu-trad).

11 years agopublic/platform.h: replace unsigned long with xen_ulong_t
Stefano Stabellini [Fri, 28 Mar 2014 12:48:39 +0000 (13:48 +0100)]
public/platform.h: replace unsigned long with xen_ulong_t

Replace unsigned long with xen_ulong_t in public/platform.h.
Also replace unsigned int with uint32_t for clarity. It is safe because
unsigned int are 4 byte sized and 4 byte aligned an all the supported
architectures.

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>