]> xenbits.xensource.com Git - mini-os.git/log
mini-os.git
8 years agox86: use unified linker script
Wei Liu [Thu, 18 Aug 2016 10:15:26 +0000 (11:15 +0100)]
x86: use unified linker script

There are only a few differences between i386 and x86-64 linker scripts.
Unify them into one. Re-indent the file at the same time.

Construct a special rule in top-level directory to cope with the change.
Ideally the build system should also be made more elegant, but
overhauling the build system is out of scope of this patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86: switch to use elfnote
Wei Liu [Thu, 18 Aug 2016 10:15:25 +0000 (11:15 +0100)]
x86: switch to use elfnote

Use the newer ELF note interface. The generated ELF notes results in
equivalent configuration.

Also need to modify linker script to provide a note section.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agoIntroduce asm_macros.h
Wei Liu [Thu, 18 Aug 2016 10:15:24 +0000 (11:15 +0100)]
Introduce asm_macros.h

Ported from Xen Test Framework project (BSD license).

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: fix coverity issues in printf.c
Juergen Gross [Wed, 17 Aug 2016 13:39:59 +0000 (15:39 +0200)]
mini-os: fix coverity issues in printf.c

Fix two issues discovered by Coverity:

1. properly mark one switch case as fall-through
2. unroll a loop that only executes once

CID: 1369623
CID: 1019001

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibautl@ens-lyon.org>
8 years agogitignore: ignore vim swap file
Wei Liu [Wed, 17 Aug 2016 12:35:11 +0000 (13:35 +0100)]
gitignore: ignore vim swap file

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86/arch_mm.h: move p2m_chk_pfn to x86/mm.c
Wei Liu [Fri, 12 Aug 2016 10:32:57 +0000 (11:32 +0100)]
x86/arch_mm.h: move p2m_chk_pfn to x86/mm.c

Making that function inlined won't buy us much and is causing error in
vtpm manager stubdom build.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: repair build system
Juergen Gross [Wed, 10 Aug 2016 13:47:27 +0000 (15:47 +0200)]
mini-os: repair build system

The build system of Mini-OS is using different settings for arch/*/*
than for the rest of the tree. The main reasons are that Config.mk is
included only conditionally in the top level Makefile, while minios.mk
isn't included by the arch Makefiles.

Repairing this mess enables us to move the CONFIG_* handling to
Config.mk enabling the arch sources to make use of those even if no
MINIOS_CONFIG was specified by the caller.

Most of the files under config were not used. Integrate the used ones
into Config.mk and delete the rest.

The CONFIG_* defines should be set for assembler sources, too.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: balloon up in case of oom
Juergen Gross [Fri, 5 Aug 2016 14:27:53 +0000 (16:27 +0200)]
mini-os: balloon up in case of oom

If a memory shortage is detected balloon up.

Be careful to always leave some pages free as ballooning up might need
some memory, too:

- new p2m frames
- page tables for addressing new p2m frame
- new frame for page allocation bitmap
- page table for addressing new page allocation bitmap frame
- page tables for addressing new 1:1 mapped frames

For the moment we only balloon up synchronously when memory shortage
is detected in allocation routines with irqs on.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add support for ballooning up
Juergen Gross [Wed, 3 Aug 2016 07:11:37 +0000 (09:11 +0200)]
mini-os: add support for ballooning up

Add support for ballooning the domain up by a specified amount of
pages. Following steps are performed:

- extending the p2m map
- extending the page allocator's bitmap
- getting new memory pages from the hypervisor
- adding the memory at the current end of guest memory

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: map page allocator's bitmap to virtual kernel area for ballooning
Juergen Gross [Mon, 1 Aug 2016 08:11:23 +0000 (10:11 +0200)]
mini-os: map page allocator's bitmap to virtual kernel area for ballooning

In case of CONFIG_BALLOON the page allocator's bitmap needs some space
to be able to grow. Remap it to kernel virtual area if the preallocated
area isn't large enough.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remap p2m list in case of ballooning
Juergen Gross [Mon, 1 Aug 2016 07:26:08 +0000 (09:26 +0200)]
mini-os: remap p2m list in case of ballooning

In case of enabled ballooning we must be prepared for a growing p2m
list. If the maximum memory size of the domain can't be covered by the
actual p2m list remap it to the kernel virtual mapping area and leave
enough space at the end.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: move p2m related macros to header file
Juergen Gross [Fri, 5 Aug 2016 08:15:50 +0000 (10:15 +0200)]
mini-os: move p2m related macros to header file

In order to be able to use p2m related macros for ballooning move
their definitions to arch/x86/mm.h.

There is no need to define different macros regarding index masks and
number of entries for the different levels, as all levels share the
same entry format (a plain mfn). So reduce the number of macros
accordingly.

Add some macros to get the indices into p2m pages from a pfn and make
use of them in current p2m code.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add function to map one frame
Juergen Gross [Thu, 4 Aug 2016 14:14:31 +0000 (16:14 +0200)]
mini-os: add function to map one frame

Add a function to map one physical frame to a specified virtual
address as read/write. This will be used later multiple times.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: don't allocate new pages for level 1 p2m tree
Juergen Gross [Mon, 1 Aug 2016 06:51:26 +0000 (08:51 +0200)]
mini-os: don't allocate new pages for level 1 p2m tree

When constructing the 3 level p2m tree there is no need to allocate
new pages for the level 1 containing the p2m info for all pages. The
pages from the linear p2m list constructed by the hypervisor can be
used for that purpose.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add checks for out of memory
Juergen Gross [Thu, 4 Aug 2016 06:42:31 +0000 (08:42 +0200)]
mini-os: add checks for out of memory

There are several core functions in Mini-OS not checking for failed
memory allocations. Add such checks.

Add do_map_frames() dummy function to arm architecture as it will be
needed in future for compilations to succeed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remove unused mem_test() function
Juergen Gross [Wed, 3 Aug 2016 06:10:45 +0000 (08:10 +0200)]
mini-os: remove unused mem_test() function

mem_test() isn't used anywhere and its value is rather questionable
with mini-os being in a mature state. Remove the function.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: modify virtual memory layout for support of ballooning
Juergen Gross [Tue, 19 Jul 2016 06:54:22 +0000 (08:54 +0200)]
mini-os: modify virtual memory layout for support of ballooning

In order to be able to support ballooning the virtual memory layout
of Mini-OS has to be modified: instead of a (nearly) consecutive
area used for physical memory mapping, on demand mappings, and heap
we need enough spare place for adding new memory.

So instead of dynamically place the different regions based on found
memory size locate them statically at fixed virtual addresses:

area                           x86-64               x86-32
------------------------------------------------------------
mapped physical memory       00000000             00000000
kernel virtual mappings    8000000000             3f000000
demand mappings          100000000000             40000000
heap                     200000000000             b0000000

This will enable Mini-OS to support up to 512GB of domain memory with
a 64 bit kernel and nearly 1GB with a 32 bit kernel.

For a 32 bit Mini-OS we have to avoid a conflict between heap and
m2p table which the hypervisor maps at f5600000. So the demand mapping
size is reduced by 256MB in order to keep the heap at about 1GB.

The kernel virtual mappings are a new area needed for being able to
grow the p2m list without having to relocate it in physical memory.

Modify the placement of the demand mappings and heap and adjust the
memory layout description.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: get maximum memory size from hypervisor
Juergen Gross [Tue, 19 Jul 2016 05:23:02 +0000 (07:23 +0200)]
mini-os: get maximum memory size from hypervisor

Add support for obtaining the maximum memory size from the hypervisor.
This will make it possible to support ballooning.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add ballooning config item
Juergen Gross [Tue, 19 Jul 2016 05:03:43 +0000 (07:03 +0200)]
mini-os: add ballooning config item

Add CONFIG_BALLOON defaulting to 'n' as a config item to Mini-OS.

Add balloon.c, balloon.h and arch/*/balloon.c for future use.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: let memory allocation fail if no free page available
Juergen Gross [Mon, 18 Jul 2016 14:46:11 +0000 (16:46 +0200)]
mini-os: let memory allocation fail if no free page available

Instead of panicing when no page can be allocated try to fail the
memory allocation by returning NULL instead.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add nr_free_pages counter
Juergen Gross [Tue, 12 Jul 2016 11:43:55 +0000 (13:43 +0200)]
mini-os: add nr_free_pages counter

Add a variable holding the number of available memory pages. This will
aid auto-ballooning later.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add description of x86 memory usage
Juergen Gross [Tue, 12 Jul 2016 11:43:55 +0000 (13:43 +0200)]
mini-os: add description of x86 memory usage

Add a brief description how the physical and virtual address usage
looks like on x86 to include/x86/arch_mm.h

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remove MM_DEBUG code
Juergen Gross [Tue, 12 Jul 2016 11:43:55 +0000 (13:43 +0200)]
mini-os: remove MM_DEBUG code

mm.c contains unused code inside #ifdef MM_DEBUG areas. Its usability
is rather questionable and some parts are even wrong (e.g.
print_chunks() called with nr_pages > 1000 will clobber an arbitrary
stack content with a 0 byte).

Remove this code.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remove unused alloc_contig_pages() function
Juergen Gross [Tue, 12 Jul 2016 11:43:54 +0000 (13:43 +0200)]
mini-os: remove unused alloc_contig_pages() function

alloc_contig_pages() is never used anywhere in mini-os. Remove it.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: correct first free pfn
Juergen Gross [Tue, 12 Jul 2016 11:43:54 +0000 (13:43 +0200)]
mini-os: correct first free pfn

The first free pfn available for allocation is calculated by adding the
number of page table frames to the pfn of the first page table and
then the magic number 3 to account for start info page et al.

As the start info page, xenstore page and console page are allocated
_before_ the page tables leaving room for these pages behind the page
tables makes no sense.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: replace lib/printf.c with a version not under GPL
Juergen Gross [Mon, 4 Jul 2016 09:16:59 +0000 (11:16 +0200)]
mini-os: replace lib/printf.c with a version not under GPL

Instead of a Linux kernel based implementation use one from FreeBSD.

As a result some of the printings will change due to more posix like
behavior of %p format (omitting leading zeroes, prepending "0x").

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[ wei: s/freeBSD/FreeBSD/ in commit message and code comment ]

8 years agomini-os: make cscope repair
Juergen Gross [Fri, 1 Jul 2016 09:33:11 +0000 (11:33 +0200)]
mini-os: make cscope repair

"make cscope" doesn't like symbolic link include/mini-os->. as it
leads to a file system recursion. Repair that by not following links
when searching the sources.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agolib/sys.c: enclose file_types in define guards xen-RELEASE-4.7.0 xen-RELEASE-4.7.1 xen-RELEASE-4.7.2 xen-RELEASE-4.7.3 xen-RELEASE-4.7.4 xen-RELEASE-4.7.5
Wei Liu [Fri, 13 May 2016 14:21:10 +0000 (15:21 +0100)]
lib/sys.c: enclose file_types in define guards

Otherwise some build environments complain file_types array is defined
but not used.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agobuild: change MINI-OS_ROOT to MINIOS_ROOT
Wei Liu [Mon, 2 May 2016 12:55:00 +0000 (13:55 +0100)]
build: change MINI-OS_ROOT to MINIOS_ROOT

In the GNU make manual "How to Use Variables" section there is such
word:

"However, variable names containing characters other than letters,
numbers, and underscores should be considered carefully, as in some
shells they cannot be passed through the environment to a sub-make (see
Communicating Variables to a Sub-make)."

I discover xen stubdom fails to build on Ubuntu 16.04 and Debian
unstable due to MINI-OS_ROOT is not preserved in the invocation of
sub-make, while stubdom builds fine on older versions of Ubuntu and
Debian. It's hard to track down what exactly is changed in those
systems, but changing MINI-OS_ROOT to MINIOS_ROOT fixes the problem.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoFix time update xen-4.7.0-rc1
Samuel Thibault [Sat, 9 Apr 2016 22:46:32 +0000 (00:46 +0200)]
Fix time update

The timer handler should actually not update the shadowed copy, since that
makes reading them non-atomic. Users of the shadowed copy should just update
it themselves, which is already the case in monotonic_clock(), we just need
to make to make gettimeofday() update the wallclock.

This also fixes an issue reported by David Vercauteren: when the timer
interrupt was not called yet, gettimeofday was returning bogus values.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoClean arch/x86/time.c
Samuel Thibault [Sat, 9 Apr 2016 22:46:31 +0000 (00:46 +0200)]
Clean arch/x86/time.c

block_domain() does not actually use the value returned by gettimeofday.
Fix indent in monotonic_clock() along the way.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoMini-OS: netfront: fix off-by-one error introduced in 7c8f3483
Samuel Thibault [Fri, 1 Apr 2016 18:17:01 +0000 (20:17 +0200)]
Mini-OS: netfront: fix off-by-one error introduced in 7c8f3483

7c8f3483 introduced a break within a loop in netfront.c such that
cons and nr_consumed were no longer always being incremented. The
offset at cons will be processed multiple times with the break in
place.

This commit reverts to using the "some" variable in the loop condition,
but avoids ifdefs for the non-libc case. It also renames it to dobreak
to make its usage clearer.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: Sarah Newman <srn@prgmr.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agomini-os: Include libxenforeignmemory with libxc
Ian Campbell [Fri, 15 Jan 2016 13:24:03 +0000 (13:24 +0000)]
mini-os: Include libxenforeignmemory with libxc

libxenforeignmemory has just been split out from libxc. From mini-os's
point of view we don't care about the distinction, so keep things
simple by just including libxenforeignmemory if libxc is enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agomini-os: Include libxencall with libxc
Ian Campbell [Fri, 15 Jan 2016 13:24:02 +0000 (13:24 +0000)]
mini-os: Include libxencall with libxc

libxencall has just been split out from libxc. From mini-os's point
of view we don't care about the distinction, so keep things simple by
just including libxencall if libxc is enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agomini-os: Include libxengnttab with libxc
Ian Campbell [Fri, 15 Jan 2016 13:24:01 +0000 (13:24 +0000)]
mini-os: Include libxengnttab with libxc

libxengnttab has just been split out from libxc. From mini-os's point
of view we don't care about the distinction, so keep things simple by
just including libxengnttab if libxc is enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agomini-os: Include libxenevtchn with libxc
Ian Campbell [Fri, 15 Jan 2016 13:24:00 +0000 (13:24 +0000)]
mini-os: Include libxenevtchn with libxc

libxenevtchn has just been split out from libxc. From mini-os's point
of view we don't care about the distinction, so keep things simple by
just including libxenevtchn if libxc is enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agomini-os: Include libxentoollog with libxc
Ian Campbell [Thu, 3 Dec 2015 11:23:25 +0000 (11:23 +0000)]
mini-os: Include libxentoollog with libxc

libxentoollog has just been split out from libxc. From mini-os's point
of view we don't care about the distinction, so keep things simple by
just including libxentoollog if libxc is enabled.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agoAdd a .gitignore
Ian Campbell [Mon, 23 Nov 2015 16:34:31 +0000 (16:34 +0000)]
Add a .gitignore

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agominios: don't rely on specific page table allocation scheme
Juergen Gross [Fri, 20 Nov 2015 18:32:42 +0000 (19:32 +0100)]
minios: don't rely on specific page table allocation scheme

Today mini-os is making assumptions how the page tables it is started
with are being allocated. Especially it is using the number of page
table frames to calculate which is the first unmapped pfn.

Instead of relying on page table number assumptions just look into the
page tables to find the first pfn not already mapped.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoxenbus: notify the other end when necessary
Wei Liu [Tue, 27 Oct 2015 15:43:28 +0000 (15:43 +0000)]
xenbus: notify the other end when necessary

The xenbus thread didn't send notification to other end when it expected
more data or consumed responses, which led to stalling the ring from
time to time.

This is the culprit that guest was less responsive when using stubdom
because the device model was stalled.

Fix this by sending notification to the other end when it consumes a
message. A bunch of memory barriers are also added to ensure
correctness.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoarm: interrupt controller
Thomas Leonard [Thu, 23 Jul 2015 10:08:38 +0000 (11:08 +0100)]
arm: interrupt controller

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
9 years agoCorrect printf formatting for tpm_tis message. xen-RELEASE-4.6.0
Ian Campbell [Fri, 26 Jun 2015 10:58:40 +0000 (11:58 +0100)]
Correct printf formatting for tpm_tis message.

This is under #ifdef HAVE_LIBC so went unnoticed before.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agoAccept %z in printf formats
Thomas Leonard [Wed, 1 Jul 2015 09:24:50 +0000 (10:24 +0100)]
Accept %z in printf formats

Before, we only supported %Z (upper-case). It seems that the lower-case
version is standard, and this matches the behaviour of Xen's vsprintf.c.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
9 years agomini-os: enable compiler check for printk format types
Thomas Leonard [Wed, 17 Jun 2015 10:08:20 +0000 (11:08 +0100)]
mini-os: enable compiler check for printk format types

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agoFix accidentally removed brace causing a build error.
Sander Eikelenboom [Thu, 12 Mar 2015 18:08:05 +0000 (19:08 +0100)]
Fix accidentally removed brace causing a build error.

Introduced in:
commit bd5920cb92e6799bfd64957284a9e2cfe7699039
"mini-os: sort objects in binary archives"

Signed-off-by: Sander Eikelenboom <linux@eikelenboom.it>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: replace XEN_TARGET_ARCH with MINIOS_TARGET_ARCH
Wei Liu [Tue, 10 Mar 2015 13:14:38 +0000 (13:14 +0000)]
mini-os: replace XEN_TARGET_ARCH with MINIOS_TARGET_ARCH

One place was missed when I did the replacement in 55f7cd7427 ("Mini-OS:
standalone build").

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: sort objects in binary archives
Olaf Hering [Tue, 3 Feb 2015 11:45:37 +0000 (12:45 +0100)]
mini-os: sort objects in binary archives

When building stubdom the mini-os objects are also linked into the
binary. Unfortunately the linker will place them in the order found in
the archive. Since this order is random the resulting stubdom binary
differs when it was built from identical sources but on different
build hosts. To help with creating a reproducible binary the elements
in an archive must simply be sorted before passing them to $(AR).

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[ ijc -- massaged paths to apply to external mini-os tree ]

10 years agoMini-OS: standalone build
Wei Liu [Thu, 29 Jan 2015 19:10:04 +0000 (19:10 +0000)]
Mini-OS: standalone build

In order to keep the tree bisectable all the changes are done in one
single commit.

Things done in this commit:

1. Import necessary .mk files from Xen.
2. Move all XEN_ related variables to MINIOS_ namespace.
3. Import Xen public header files.
4. Import BSD's list.h and helper script.

Mini-OS's vanilla Config.mk is modified to contain some macros copied
from Xen's Config.mk. It also contains compatibility handling logic for
Xen's stubdom build environment.

Files modified:
   Config.mk
   Makefile
   arch/x86/Makefile
   arch/x86/arch.mk
   minios.mk

All other files are just imported from Xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agovTPM/TPM2: TPM2.0 TIS initialization and self test.
Quan Xu [Thu, 15 Jan 2015 09:21:46 +0000 (04:21 -0500)]
vTPM/TPM2: TPM2.0 TIS initialization and self test.

call the TPM 2.0 various registers that allow communication between
the TPM 2.0 and platform hardware and software. TPM2_SelfTest causes
the TPM 2.0 to perform a test of its capabilities.

Signed-off-by: Quan Xu <quan.xu@intel.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
10 years agox86/minios: remove more vestigial remnants of SUPERVISOR_MODE_KERNEL
Andrew Cooper [Mon, 19 Jan 2015 11:17:24 +0000 (12:17 +0100)]
x86/minios: remove more vestigial remnants of SUPERVISOR_MODE_KERNEL

MiniOS has never advertised support for supervisor_mode_kernel, and the
feature was only ever implemented for 32bit Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agoMini-OS: netfront: Fix rx ring starvation in network_rx
Martin Lucina [Thu, 4 Dec 2014 13:33:53 +0000 (14:33 +0100)]
Mini-OS: netfront: Fix rx ring starvation in network_rx

In network_rx() we must push the same amount of requests back onto the
ring in the second loop that we consumed in the first loop. Otherwise
the ring will eventually starve itself of free request slots and no
packets will be delivered.

Further, we make the HAVE_LIBC codepath clearer to follow by removing
the "some" variable from the for loop initialisation and conditions.

Signed-off-by: Martin Lucina <martin@lucina.net>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: arm: show registers, stack and exception vector on fault
Thomas Leonard [Fri, 3 Oct 2014 09:20:51 +0000 (10:20 +0100)]
mini-os: arm: show registers, stack and exception vector on fault

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
[ ijc -- dropped change to extras/mini-os/ARM-TODO.txt, since the
  patch which creates it hasn't been applied yet. ]

10 years agomini-os: arm: time
Thomas Leonard [Fri, 3 Oct 2014 09:20:48 +0000 (10:20 +0100)]
mini-os: arm: time

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agovTPM: Fix Atmel timeout bug. xen-4.5.0-rc3 xen-4.5.0-rc4 xen-RELEASE-4.5.0
Emil Condrea [Thu, 30 Oct 2014 13:05:30 +0000 (15:05 +0200)]
vTPM: Fix Atmel timeout bug.

Some versions of Atmel TPMs provide invalid values for TPM_CAP_PROP_TIS_TIMEOUT query.
Because timeouts are invalid, every other command after tpm_get_timeouts will fail.
It is a known issue and it was fixed recently in linux kernel tpm_tis.c on 2014-07-29.
This patch does not allow timeouts to be less than standard values.
I tested it on a Dell Latitude E5520 and after making the changes I was able to start vtpmmgr-stubdom.

Signed-off-by: Emil Condrea <emilcondrea@gmail.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
10 years agoMove xenstore and libxc public headers to include subdir xen-4.5.0-rc1 xen-4.5.0-rc2
Stefano Stabellini [Thu, 10 Jul 2014 15:35:28 +0000 (15:35 +0000)]
Move xenstore and libxc public headers to include subdir

Also moves xc_dom.h to include as it is used often by other xen tools.
Use the new include subdirectories to build Xen tools, qemu-xen and
stubdoms.

Add the old libxc include path to the programs that need it to build,
on a case by case basis and commeting that they shouldn't require
internal libxc headers to build.

[ And: update QEMU_TRADITIONAL_REVISION to corresponding qemu patch
   - Ian jackson ]

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
10 years agomini-os: arm: events
Karim Raslan [Fri, 8 Aug 2014 15:47:37 +0000 (16:47 +0100)]
mini-os: arm: events

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: arm: scheduling
Thomas Leonard [Fri, 8 Aug 2014 15:47:36 +0000 (16:47 +0100)]
mini-os: arm: scheduling

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: arm: memory management
Thomas Leonard [Fri, 8 Aug 2014 15:47:35 +0000 (16:47 +0100)]
mini-os: arm: memory management

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: arm: boot code
Thomas Leonard [Fri, 8 Aug 2014 15:47:34 +0000 (16:47 +0100)]
mini-os: arm: boot code

Based on an initial patch by Karim Raslan.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
10 years agomini-os: arm: add header files
Karim Raslan [Fri, 8 Aug 2014 15:47:33 +0000 (16:47 +0100)]
mini-os: arm: add header files

Adds header files for future ARM support.
Based on work by Karim Allah Ahmed.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: move poor rand function to test.c
Thomas Leonard [Fri, 8 Aug 2014 15:47:32 +0000 (16:47 +0100)]
mini-os: move poor rand function to test.c

It's only used by test.c and probably isn't something that should be
exposed for general use (it just calls gettimeofday).

This is also useful for ARM, which doesn't use math.c, where this used
to live.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: added HYPERVISOR_xsm_op
Thomas Leonard [Fri, 8 Aug 2014 15:47:31 +0000 (16:47 +0100)]
mini-os: added HYPERVISOR_xsm_op

Avoids using _hypercall1 in events.c.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: don't include lib.h from mm.h
Thomas Leonard [Fri, 8 Aug 2014 15:47:30 +0000 (16:47 +0100)]
mini-os: don't include lib.h from mm.h

This breaks the include cycle hypervisor.h -> hypercall-x86_32.h -> mm.h
-> lib.h -> gntmap.h -> os.h -> hypervisor.h.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: tpm: remove usage of inline keyword
Olaf Hering [Tue, 22 Jul 2014 07:19:16 +0000 (09:19 +0200)]
mini-os: tpm: remove usage of inline keyword

Compilation fails with gcc-4.3:

tpmback.c: In function 'tpmback_resp':
tpmback.c:148: error: inlining failed in call to 'tpmdev_check_req': call is unlikely and code size would grow
tpmback.c:165: error: called from here
tpmback.c: In function 'new_tpmif':
tpmback.c:384: error: inlining failed in call to '__init_tpmif': call is unlikely and code size would grow
tpmback.c:425: error: called from here

Adjust code to use static instead of inline, it has the same effect.
Change also tpmif_req_ready and tpmif_req_finished before they start to
cause failures.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: tpm: fix array access in locality_enabled
Olaf Hering [Tue, 22 Jul 2014 07:19:15 +0000 (09:19 +0200)]
mini-os: tpm: fix array access in locality_enabled

gcc-4.3 fails to prove that array indices will remain positive. Add a
hint for the compiler and check the index value before using it.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agoextras/mini-os/tpmback.c: fix compilation error.
Dushyant Behl [Sun, 20 Jul 2014 20:52:59 +0000 (02:22 +0530)]
extras/mini-os/tpmback.c: fix compilation error.

This patch is with respect to the following discussion on xen-devel -
http://lists.xenproject.org/archives/html/xen-devel/2014-07/msg01991.html

The file extras/mini-os/tpmback.c was failing compilation on certain compilers
because of size mismatch between enum and int. Earlier the code used to read
value of enum using %d format, which failed compilation on some compilers:

tpmback.c: In function ‘tpmif_change_state’:
tpmback.c:350:4: error: format ‘%d’ expects argument of type ‘int *’,
but argument 3 has type ‘enum xenbus_state *’ [-Werror=format=]
    if(sscanf(value, "%d", &readst) != 1) {
    ^

Now the value is read into an actual int variable and then assigned to the
enum.

Signed-off-by:- Dushyant Behl <myselfdushyantbehl@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[ ijc -- added the actual error to the commit log ]

10 years agomini-os: use generic local_irq_enable function
Thomas Leonard [Wed, 16 Jul 2014 11:07:46 +0000 (12:07 +0100)]
mini-os: use generic local_irq_enable function

__sti is x86 specific.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: x86_64: make thread stacks 16-byte aligned
Thomas Leonard [Wed, 16 Jul 2014 11:07:41 +0000 (12:07 +0100)]
mini-os: x86_64: make thread stacks 16-byte aligned

Otherwise, passing doubles to varargs functions causes a crash.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: add BUILD_BUG_ON()
Jan Beulich [Thu, 3 Jul 2014 14:37:22 +0000 (16:37 +0200)]
mini-os: add BUILD_BUG_ON()

Just copy over what the hypervisor currently uses (comments dropped due
to being of unknown origin; the implementation was done by me anyway).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Tim Deegan <tim@xen.org>
10 years agominios: fix incorrect {, un}likely() definitions
Andrew Cooper [Wed, 2 Jul 2014 12:46:42 +0000 (14:46 +0200)]
minios: fix incorrect {, un}likely() definitions

As identified in e5545fb6, likely() and unlikely() must convert their
expressions to booleans before comparing to 1 or 0, to avoid truncation
issues.

While editing this file, add inclusion guards.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: use irqs_disabled() helper in schedule
Thomas Leonard [Thu, 26 Jun 2014 11:28:33 +0000 (12:28 +0100)]
mini-os: use irqs_disabled() helper in schedule

Testing whether the result of local_irq_save is zero doesn't work on
ARM.

Suggested by Julien Grall.
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: enable test_xenbus again
Thomas Leonard [Thu, 26 Jun 2014 11:28:32 +0000 (12:28 +0100)]
mini-os: enable test_xenbus again

The old code said "Xenbus tests disabled, because of a Xend bug".
Since xend doesn't exist any longer, we can enable these again.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: moved unlikely/likely macros to new compiler.h
Thomas Leonard [Thu, 26 Jun 2014 11:28:31 +0000 (12:28 +0100)]
mini-os: moved unlikely/likely macros to new compiler.h

Requested by Julien Grall.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: moved __pte to x86
Thomas Leonard [Thu, 26 Jun 2014 11:28:30 +0000 (12:28 +0100)]
mini-os: moved __pte to x86

We don't need to define this on ARM. Suggested by Julien Grall.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: added arch_unbind_ports
Thomas Leonard [Thu, 26 Jun 2014 11:28:29 +0000 (12:28 +0100)]
mini-os: added arch_unbind_ports

This allows closing any ports opened by the arch-specific code.
ARM will use it for the debug port.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: add missing casts to MM printk
Thomas Leonard [Thu, 26 Jun 2014 11:28:27 +0000 (12:28 +0100)]
mini-os: add missing casts to MM printk

The code previously assumed that a long was 64-bits.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: don't require XEN_HAVE_PV_UPCALL_MASK
Thomas Leonard [Thu, 26 Jun 2014 11:28:26 +0000 (12:28 +0100)]
mini-os: don't require XEN_HAVE_PV_UPCALL_MASK

This isn't available on ARM.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: added arch_init_gnttab
Karim Raslan [Thu, 26 Jun 2014 11:28:25 +0000 (12:28 +0100)]
mini-os: added arch_init_gnttab

Moves some x86-specific code into arch/x86.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: split into multiple patches]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: whitespace
Thomas Leonard [Thu, 26 Jun 2014 11:28:24 +0000 (12:28 +0100)]
mini-os: whitespace

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: switched initial C entry point to arch_init
Karim Raslan [Thu, 26 Jun 2014 11:28:23 +0000 (12:28 +0100)]
mini-os: switched initial C entry point to arch_init

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: separated from big ARM commit]
[talex5@gmail.com: restored comment, moved prototypes to headers]
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[talex5@gmail.com: restored stack address printk on x86]
[talex5@gmail.com: moved first printk's after start_info setup on x86]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
10 years agomini-os: made off_t type signed
Thomas Leonard [Thu, 26 Jun 2014 11:28:22 +0000 (12:28 +0100)]
mini-os: made off_t type signed

POSIX requires this.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: use unbind_evtchn in unbind_all_ports
Thomas Leonard [Thu, 26 Jun 2014 11:28:21 +0000 (12:28 +0100)]
mini-os: use unbind_evtchn in unbind_all_ports

This marks the channel as closed, in case someone tries to use it again.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: fixed format string error in unbind_evtchn
Thomas Leonard [Thu, 26 Jun 2014 11:28:20 +0000 (12:28 +0100)]
mini-os: fixed format string error in unbind_evtchn

Would crash if HYPERVISOR_event_channel_op returned an error code.
The other changes in this commit are just fixing indentation.

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.cammpbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: fixed shutdown thread
Thomas Leonard [Thu, 26 Jun 2014 11:28:19 +0000 (12:28 +0100)]
mini-os: fixed shutdown thread

Before, it read "" and started a shutdown immediately. Now, it waits for
a non-empty value and then actually shuts down.

Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[talex5@gmail.com: avoid declaration-after-statement in kernel.c]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
10 years agomini-os: build fixes
Thomas Leonard [Thu, 26 Jun 2014 11:28:18 +0000 (12:28 +0100)]
mini-os: build fixes

Make .o rules depend on the includes. Before, only the final link step
depended on setting up the includes directory, making parallel builds
unreliable.

Make symlinks use explicit make rules instead of using a phony target.
Avoids unnecessary rebuilds.

[talex5@gmail.com: bring back "make links", for stubdom]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: don't include queue.h if there's no libc
Thomas Leonard [Wed, 11 Jun 2014 10:30:17 +0000 (11:30 +0100)]
mini-os: don't include queue.h if there's no libc

Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: moved events code under arch
Karim Raslan [Wed, 11 Jun 2014 10:30:15 +0000 (11:30 +0100)]
mini-os: moved events code under arch

This is all code motion, except that we now initialise
the ev_actions array before calling the arch-specific code
to make it more robust against future changes.

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: separated from big ARM commit]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
10 years agomini-os: tidied up code
Karim Raslan [Wed, 11 Jun 2014 10:30:14 +0000 (11:30 +0100)]
mini-os: tidied up code

Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
[talex5@gmail.com: separated from big ARM commit]
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
[talex5@gmail.com: use __func__ in DEBUG macro]
[talex5@gmail.com: drop text about "xm create"]
Signed-off-by: Thomas Leonard <talex5@gmail.com>
11 years agominios (blkfront): Add more information on block error
Samuel Thibault [Thu, 20 Mar 2014 12:10:22 +0000 (13:10 +0100)]
minios (blkfront): Add more information on block error

This notably prints the offset and size of the block operation in error.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agominios: Correct HYPERVISOR_physdev_op() xen-4.4.0-rc3 xen-4.4.0-rc4 xen-4.4.0-rc5 xen-4.4.0-rc6 xen-4.4.1-rc1 xen-4.4.1-rc2 xen-RELEASE-4.4.0 xen-RELEASE-4.4.1
Andrew Cooper [Fri, 24 Jan 2014 18:28:11 +0000 (18:28 +0000)]
minios: Correct HYPERVISOR_physdev_op()

A physdev_op is a two argument hypercall, taking a command parameter and an
optional pointer to a structure.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agomini-os: Fix stubdom build failures on gcc 4.8
Mike Neilsen [Wed, 22 Jan 2014 17:41:11 +0000 (11:41 -0600)]
mini-os: Fix stubdom build failures on gcc 4.8

This is a fix for bug 35:
http://bugs.xenproject.org/xen/bug/35

This bug report describes several format string mismatches which prevent
building the stubdom target in Xen 4.3 and Xen 4.4-rc2 on gcc 4.8.  This is a
copy of Alex Sharp's original patch with the following modifications:

* Andrew Cooper's recommendation applied to extras/mini-os/xenbus/xenbus.c to
  avoid stack corruption
* Samuel Thibault's recommendation to make "fun" an unsigned int rather than an
  unsigned long in pcifront_physical_to_virtual and related functions
  (extras/mini-os/include/pcifront.h and extras/mini-os/pcifront.c)

Tested on x86_64 gcc Ubuntu/Linaro 4.8.1-10ubuntu9.

Coverity-IDs: 1055807 1055808 1055809 1055810
Signed-off-by: Mike Neilsen <mneilsen@acm.org>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agomini-os: remove repeated statement in netfront_input xen-4.4.0-rc1 xen-4.4.0-rc2
Matthew Daley [Fri, 8 Nov 2013 10:10:08 +0000 (11:10 +0100)]
mini-os: remove repeated statement in netfront_input

Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agotools: remove unnecessary null pointer checks before frees
Matthew Daley [Tue, 15 Oct 2013 05:18:02 +0000 (18:18 +1300)]
tools: remove unnecessary null pointer checks before frees

Patch generated by the following semantic patch
(http://coccinelle.lip6.fr/):

@@
expression *P;
@@

- if(P) free(P);
+ free(P);

...and then by filtering through the following command:

filterdiff -p1 -x 'stubdom/*' -x 'tools/firmware/*' -x 'tools/qemu-*' -x 'tools/blktap*'

Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
11 years agomini-os: fix various memory leaks in various locations
Matthew Daley [Wed, 18 Sep 2013 03:38:03 +0000 (15:38 +1200)]
mini-os: fix various memory leaks in various locations

Coverity-ID: 1055827
Coverity-ID: 1055828
Coverity-ID: 1055829
Coverity-ID: 1055830
Coverity-ID: 1055831
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix various memory leaks in consfront
Matthew Daley [Wed, 18 Sep 2013 03:38:02 +0000 (15:38 +1200)]
mini-os: fix various memory leaks in consfront

Coverity-ID: 1055816
Coverity-ID: 1055817
Coverity-ID: 1055818
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix various memory leaks in pcifront
Matthew Daley [Wed, 18 Sep 2013 03:38:01 +0000 (15:38 +1200)]
mini-os: fix various memory leaks in pcifront

Coverity-ID: 1055834-1055840
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix various memory leaks in netfront
Matthew Daley [Wed, 18 Sep 2013 03:38:00 +0000 (15:38 +1200)]
mini-os: fix various memory leaks in netfront

Coverity-ID: 1055832
Coverity-ID: 1055833
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix various memory leaks in {fb, kbd}front
Matthew Daley [Wed, 18 Sep 2013 03:37:59 +0000 (15:37 +1200)]
mini-os: fix various memory leaks in {fb, kbd}front

Coverity-ID: 1055819-1055826
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix various memory leaks in blkfront
Matthew Daley [Wed, 18 Sep 2013 03:37:58 +0000 (15:37 +1200)]
mini-os: fix various memory leaks in blkfront

Coverity-ID: 1055814
Coverity-ID: 1055815
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
11 years agomini-os: fix nodename generation in init_netfront
Matthew Daley [Wed, 18 Sep 2013 03:37:57 +0000 (15:37 +1200)]
mini-os: fix nodename generation in init_netfront

Using strlen here makes no sense.

Coverity-ID: 1056053
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>