]> xenbits.xensource.com Git - mini-os.git/log
mini-os.git
8 years agomini-os: add comments in Config.mk regarding new config options
Juergen Gross [Mon, 5 Sep 2016 11:43:30 +0000 (13:43 +0200)]
mini-os: add comments in Config.mk regarding new config options

Add some comment in Config.mk what to do in case of adding new config
options.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: update README to reflect recent changes
Juergen Gross [Fri, 2 Sep 2016 08:56:47 +0000 (10:56 +0200)]
mini-os: update README to reflect recent changes

Add some notes to README regarding configuration of Mini-OS via config
files.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add testbuild target to Makefile
Juergen Gross [Fri, 2 Sep 2016 08:56:46 +0000 (10:56 +0200)]
mini-os: add testbuild target to Makefile

Add a "testbuild" target to the Makefile to test building a set of
pre-defined configurations.

Configurations tested are stored under arch/<arch>/testbuild in form
of configuration files. All configurations found there are built in
a local directory.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: fix builds with uncommon config settings
Juergen Gross [Fri, 2 Sep 2016 08:56:45 +0000 (10:56 +0200)]
mini-os: fix builds with uncommon config settings

Some config settings won't build standalone. Fix the following cases:

- all CONFIG_* set to "n"
- standard config with latest Xen interface version

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: support "make config" for out-of-tree users
Juergen Gross [Tue, 30 Aug 2016 11:51:23 +0000 (13:51 +0200)]
mini-os: support "make config" for out-of-tree users

Mini-OS applications being compiled using Mini-OS headers without
being integrated in the make environment of Mini-OS need a way to set
CONFIG_* defines according to their Mini-OS configuration.

Add a new make target "config" for that purpose creating a Makefile
snipplet $(CONFIG_FILE) (defaults to ./minios-config.mk) containing
the needed information.

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: provide irq on/off/save/restore functions for Mini-OS apps
Juergen Gross [Tue, 30 Aug 2016 11:51:22 +0000 (13:51 +0200)]
mini-os: provide irq on/off/save/restore functions for Mini-OS apps

Provide non-inline variants of the local_irq_*() functions for Mini-OS
apps which should not depend on Mini-OS configuration.

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: support newer xen interface
Juergen Gross [Tue, 30 Aug 2016 11:51:21 +0000 (13:51 +0200)]
mini-os: support newer xen interface

Mini-OS is currently setting __XEN_INTERFACE_VERSION__ to a rather
ancient version.

To be able to use a more recent variant garnt_entry_t must be changed
to grant_entry_v1_t. In balloon.c we omit initializing elements of
struct xen_memory_reservation with 0 to avoid problems with different
named structure elements in different Xen interface versions.

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: don't get xenbus parameters if xenbus is disabled
Juergen Gross [Mon, 29 Aug 2016 14:18:27 +0000 (16:18 +0200)]
mini-os: don't get xenbus parameters if xenbus is disabled

get_xenbus() should be called only if CONFIG_XENBUS is set.

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: partially revert "remove using start_info ..."
Juergen Gross [Mon, 29 Aug 2016 14:18:26 +0000 (16:18 +0200)]
mini-os: partially revert "remove using start_info ..."

Commit e33452c4f5547ed14defe6382b3b53664ac5bd8a ("remove using
start_info in architecture independent code") removed the start_info
variable completely. grub stubdom needs the start_info structure.

Readd the start_info structure, but make it dependent on
CONFIG_PARAVIRT.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agogitignore: ignore files generated by various indexing software
Wei Liu [Mon, 29 Aug 2016 13:01:42 +0000 (14:01 +0100)]
gitignore: ignore files generated by various indexing software

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agoMakefile: add gtags target
Wei Liu [Mon, 29 Aug 2016 13:01:41 +0000 (14:01 +0100)]
Makefile: add gtags target

Use GNU Global to generate source code index.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agoMakefile: simplify all_sources macro
Wei Liu [Mon, 29 Aug 2016 13:01:40 +0000 (14:01 +0100)]
Makefile: simplify all_sources macro

There is no SCCS file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remove unused functions from sched.c
Juergen Gross [Mon, 29 Aug 2016 06:17:22 +0000 (08:17 +0200)]
mini-os: remove unused functions from sched.c

sched.c contains some functions nobody is using. Remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: cleanup x86_64.S
Juergen Gross [Mon, 29 Aug 2016 06:17:21 +0000 (08:17 +0200)]
mini-os: cleanup x86_64.S

arch/x86/x86_64.S contains some unnecessary macros. Remove them.

Add a SAVE_PARAVIRT macro for saving %rcx and %r11 on the stack in
case of CONFIG_PARAVIRT defined.

Remove the parameter from HYPERVISOR_IRET macro as it is used with
0 only.

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: cleanup x86_32.S
Juergen Gross [Mon, 29 Aug 2016 06:17:20 +0000 (08:17 +0200)]
mini-os: cleanup x86_32.S

arch/x86/x86_32.S has some superfluous instructions. Remove them.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86_64: don't unnecessarily export some entries
Wei Liu [Thu, 25 Aug 2016 14:56:48 +0000 (15:56 +0100)]
x86_64: don't unnecessarily export some entries

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86_64: introduce and use SAVE_ALL
Wei Liu [Thu, 25 Aug 2016 14:52:38 +0000 (15:52 +0100)]
x86_64: introduce and use SAVE_ALL

Introduce this macro to match RESTORE_ALL. Also delete the unused
SAVE_REST.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86_64: merge RESTORE_REST into RESTORE_ALL
Wei Liu [Thu, 25 Aug 2016 12:55:57 +0000 (13:55 +0100)]
x86_64: merge RESTORE_REST into RESTORE_ALL

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86_64: remove unused labels
Wei Liu [Thu, 25 Aug 2016 13:11:31 +0000 (14:11 +0100)]
x86_64: remove unused labels

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agox86_32: remove inclusion of x86-32.h
Wei Liu [Thu, 25 Aug 2016 12:42:39 +0000 (13:42 +0100)]
x86_32: remove inclusion of x86-32.h

There is no need to do that explicitly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: support idle for HVMlite
Juergen Gross [Tue, 23 Aug 2016 14:45:08 +0000 (16:45 +0200)]
mini-os: support idle for HVMlite

Instead of calling HYPERVISOR_sched_op(SCHEDOP_block, 0) we need to use
the "hlt" instruction with interrupts enabled to switch to idle when
running as HVMlite domain.

This requires to setup a new timer in the timer handler as there is no
guarantee the original timer event we are waiting for won't fire
between enabling interrupts and calling "hlt".

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: get physical memory map
Juergen Gross [Mon, 22 Aug 2016 14:56:51 +0000 (16:56 +0200)]
mini-os: get physical memory map

On HVMlite we have to look at the physical memory map to know which
memory frames are usable.

In order to make life easier we define a dummy memory map for other
domain types (pv and arm) which has just one entry with a maximum
memory size.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: print start of day messages depending on domain type
Juergen Gross [Mon, 22 Aug 2016 07:58:11 +0000 (09:58 +0200)]
mini-os: print start of day messages depending on domain type

Select what to print in arch_init() depending on the domain type.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: remove using start_info in architecture independent code
Juergen Gross [Mon, 22 Aug 2016 07:01:09 +0000 (09:01 +0200)]
mini-os: remove using start_info in architecture independent code

The start_info structure should be used only in case of CONFIG_PARAVIRT
defined. Remove it from being used in other places. Especially the
usage as parameter for applications linked to the kernel is no good
idea.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: map shared info page for HVMlite
Juergen Gross [Mon, 22 Aug 2016 08:45:03 +0000 (10:45 +0200)]
mini-os: map shared info page for HVMlite

Add a service function to map the shared info page on a
non-paravirtualized system. The code is already existing on ARM side,
just move it to hypervisor.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add get_cmdline() function
Juergen Gross [Mon, 22 Aug 2016 06:22:15 +0000 (08:22 +0200)]
mini-os: add get_cmdline() function

The command line parameters are passed in start_info structure for pv,
but via hvm_start_info for HVMlite. Add a generic function to fill a
local cmdline variable with the command line string.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: setup xenbus interface parameters
Juergen Gross [Sun, 21 Aug 2016 09:29:44 +0000 (11:29 +0200)]
mini-os: setup xenbus interface parameters

In order to support HVMlite we need to get the ring page and event
channel from the hypervisor via hypercalls. Move the already existing
get_xenbus() function from arm specific coding to xenbus/xenbus.c and
provide a similar paravirtualized function.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: setup console interface parameters
Juergen Gross [Tue, 16 Aug 2016 14:10:58 +0000 (16:10 +0200)]
mini-os: setup console interface parameters

In order to support HVMlite we need to get the ring page and event
channel from the hypervisor via hypercalls. Move the already existing
get_console() function from arm specific coding to
console/xencons_ring.c and provide a similar paravirtualized function.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add map_frame_virt() function
Juergen Gross [Thu, 18 Aug 2016 11:36:36 +0000 (13:36 +0200)]
mini-os: add map_frame_virt() function

Add a function map_frame_virt() to map a given frame and return its
virtual address.

On arm we just use the frame physical address, while on x86 we take a
page from the virtual kernel area. For this purpose make this area
available even in case of undefined CONFIG_BALLOON.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: correct wrong calculation of alloc bitmap size
Juergen Gross [Thu, 18 Aug 2016 11:58:42 +0000 (13:58 +0200)]
mini-os: correct wrong calculation of alloc bitmap size

When remapping the page allocator's bitmap for the ballooning support
the calculation of the needed size is wrong. This doesn't really
matter today as nothing is allocated after that bitmap, but it should
be corrected nevertheless.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add x86 native page table handling
Juergen Gross [Thu, 18 Aug 2016 14:59:27 +0000 (16:59 +0200)]
mini-os: add x86 native page table handling

For support of HVMlite don't use mmu_update hypercalls, but write the
page table entries directly.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add static page tables for virtual kernel area for HVMlite
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: add static page tables for virtual kernel area for HVMlite

In HVMlite mode we need the virtual kernel area for mapping of the
console and xenbus ring pages as especially on 32 bit architecture
their pfns might be above the supported maximum memory size.

Add the page tables needed for doing the mapping.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: make p2m related code depend on CONFIG_PARAVIRT
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: make p2m related code depend on CONFIG_PARAVIRT

All handling related to p2m is needed for paravirtualized environment
only. So put all functions operating on p2m list in #ifdef
CONFIG_PARAVIRT sections. Add a paravirt.h header defining dummy
functions for non-paravirtualized environments. Instead of using
references to start_info use dedicated variables initialized from
start_info on boot.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: support HVMlite traps
Juergen Gross [Mon, 22 Aug 2016 12:08:28 +0000 (14:08 +0200)]
mini-os: support HVMlite traps

Trap handling in HVMlite domain is different from pv one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: initialize trap handling for HVMlite
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: initialize trap handling for HVMlite

Trap handling for HVMlite domains requires an initialized IDT.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: support hvm_op hypercall
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: support hvm_op hypercall

Support the HYPERVISOR_hvm_op() hypercall which is needed for HVMlite.
Add convenience functions hvm_get_parameter() and hvm_set_parameter().

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: setup hypercall page for HVMlite
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: setup hypercall page for HVMlite

When running in HVMlite mode we need to setup the hypercall page by
ourself.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add boot code for HVMlite support
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: add boot code for HVMlite support

A HVMlite domain is always starting in 32 bit mode. Add the appropriate
boot code to arch/x86 for the non-paravirtualized case.

For this boot code to become active we need to suppress the pv related
elfnotes and add an appropriate elfnote for HVMlite.

As the HVMlite boot code is more or less the same for 32- and 64-bit
Mini-OS #include the new code from x86_[32|64].S in order to avoid
error prone code duplication. The specific parts of 32- or 64-bit code
are added to x86_[32|64].S

This enables Mini-OS to start the boot process in HVMlite mode until it
enters C code. This is working for 32- and for 64-bit mode.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: make some memory management related macros usable from assembler
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: make some memory management related macros usable from assembler

Especially page table entry definitions are currently not usable from
assembler sources on x86 as the constants are defined with ULL suffix.
Change this by adding the suffix only when the header is included from
a C source.

Hide some C prototypes when in assembler environment.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: add CONFIG_PARAVIRT
Juergen Gross [Thu, 18 Aug 2016 11:00:27 +0000 (13:00 +0200)]
mini-os: add CONFIG_PARAVIRT

Add a new config macro CONFIG_PARAVIRT which defaults to be defined on
x86. This is the first step for supporting a HVMlite Mini-OS.

Doing this via CONFIG_PARAVIRT instead of something like CONFIG_HVMLITE
was chosen as the arm port can then drop some dummy routines needed for
para-virtualization only.

Add include/paravirt.h for future support of paravirt specific
handling.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: make dump_regs() work in early boot
Juergen Gross [Mon, 22 Aug 2016 14:01:40 +0000 (16:01 +0200)]
mini-os: make dump_regs() work in early boot

dump_regs() will result in page fault in early boot as there is no
current thread pointer. Handle this case.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
8 years agomini-os: resync xen headers
Juergen Gross [Mon, 22 Aug 2016 06:01:47 +0000 (08:01 +0200)]
mini-os: resync xen headers

Use the latest Xen headers.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
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>