aboutsummaryrefslogtreecommitdiffstats
path: root/stubdom
Commit message (Collapse)AuthorAgeFilesLines
* stubdom/vtpm: make state save operation atomicDaniel De Graaf2013-04-121-14/+60
| | | | | | | | | | This changes the save format of the vtpm stubdom to include two copies of the saved data: one active, and one inactive. When saving the state, data is written to the inactive slot before updating the key and hash saved with the TPM Manager, which determines the active slot when the vTPM starts up. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* stubdom/vtpm: Support locality fieldDaniel De Graaf2013-04-123-1/+52
| | | | | | | | | | | | The vTPM protocol now contains a field allowing the locality of a command to be specified; pass this to the TPM when processing a packet. While the locality is not currently checked for validity, a binding between locality and some distinguishing feature of the client domain (such as the XSM label) will need to be defined in order to properly support a multi-client vTPM. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu>
* stubdom/vtpm: correct the buffer size returned by TPM_CAP_PROP_INPUT_BUFFERDaniel De Graaf2013-04-122-0/+14
| | | | | | | | The vtpm2 ABI supports packets of up to 4088 bytes by default; expose this property though the TPM's interface so clients do not attempt to send larger packets. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* mini-os/tpmback: Replace UUID field with opaque pointerDaniel De Graaf2013-04-122-2/+8
| | | | | | | | Instead of only recording the UUID field, which may not be of interest to all tpmback implementations, provide a user-settable opaque pointer associated with the tpmback instance. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* mini-os/tpmback: set up callbacks before enumerationDaniel De Graaf2013-04-122-2/+2
| | | | | | | | | | | | The open/close callbacks in tpmback cannot be properly initalized in order to catch the initial enumeration events because init_tpmback clears the callbacks and then asynchronously starts the enumeration of existing tpmback devices. Fix this by passing the callbacks to init_tpmback so they can be installed before enumeration. This also removes the unused callbacks for suspend and resume. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
* tools+stubdom: install under /usr/local by default.Ian Campbell2013-04-122-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the hotplug scripts have been fixed to remove hardcoded paths lets try this again. From 26470:acaf29203cf9: This is the defacto (or FHS mandated?) standard location for software built from source, in order to avoid clashing with packaged software which is installed under /usr/bin etc. I think there is benefit in having Xen's install behave more like the majority of other OSS software out there. The major downside here is in the transition from 4.2 to 4.3 where people who have built from source will innevitably discover breakage because 4.3 no longer overwrites stuff in /usr like it used to so they pickup old stale bits from /usr instead of new stuff from /usr/local. Packages will use ./configure --prefix=/usr or whatever helper macro their package manager gives them. I have confirmed that doing this results in the same list of installed files as before this patch was applied. The hypervisor remains in /boot/ and there is no intention to move it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com>
* stubdom/Makefile: Fix gmp extract ruleDaniel De Graaf2013-04-111-0/+1
| | | | | | | | | When NEWLIB_STAMPFILE is updated but gmp has already been extracted, the mv command will incorrectly create a subdirectory instead of renaming. Remove the old target before renaming to fix this. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com>
* build: Fix distclean when repo location changesAndrei Lifchits2013-02-221-1/+1
| | | | | | | | | If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink). Signed-off-by: Andrei Lifchits <andrei.lifchits@citrix.com>
* tools: revert to installing in /usrIan Campbell2013-01-282-0/+3
| | | | | | | | | | 26470:acaf29203cf9 missed a bunch of hardcoded paths, e.g. in the initscripts. I think at this juncture it is appropriate to revert this change and try again after some more testing. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: Install xenstore stubdom in $(XENFIRMWAREDIR)Ian Campbell2013-01-251-2/+2
| | | | | | | | Removes hardcoded /usr prefix. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* build: cleanup configure detritus at toplevel and stubdomIan Campbell2013-01-251-0/+1
| | | | | | | | | | | | | | | These files were left over after $ git clean -f -dx $ ./configure $ make distclean and picked up by a subsequent. $ git clean -f -dx Ensure that these files are also correctly ignored. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* vtpm/vtpmmgr: Use libpolarssl.a instead of hardcoding own list of .o filesIan Campbell2013-01-243-10/+4
| | | | | | Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* tools+stubdom: install under /usr/local by default.Ian Campbell2013-01-242-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the defacto (or FHS mandated?) standard location for software built from source, in order to avoid clashing with packaged software which is installed under /usr/bin etc. I think there is benefit in having Xen's install behave more like the majority of other OSS software out there. The major downside here is in the transition from 4.2 to 4.3 where people who have built from source will innevitably discover breakage because 4.3 no longer overwrites stuff in /usr like it used to so they pickup old stale bits from /usr instead of new stuff from /usr/local. Packages will use ./configure --prefix=/usr or whatever helper macro their package manager gives them. I have confirmed that doing this results in the same list of installed files as before this patch was applied. The hypervisor remains in /boot/ and there is no intention to move it. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Roger Pau Monné <roger.pau@citrix.com> Acked-by: Matt Wilson <msw@amazon.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* vtpmmgr: fix build on 32-bitIan Campbell2013-01-213-3/+3
| | | | | | | | | | | | | | | | | | | Correct format string, fixing: vtpm_storage.c: In function 'vtpm_storage_load_header': vtpm_storage.c:658: error: format '%ld' expects type 'long int', but argument 5 has type 'unsigned int' vtpm_storage.c:658: error: format '%ld' expects type 'long int', but argument 5 has type 'unsigned int' make[2]: *** [vtpm_storage.o] Error 1 Add padlock.o to PSSL_OBJS, fixing: /local/scratch/ianc/devel/xen-unstable.git/stubdom/mini-os-x86_32-vtpmmgr/mini-os.o: In function `aes_crypt_ecb': /local/scratch/ianc/devel/xen-unstable.git/stubdom/polarssl-x86_32/library/aes.c:659: undefined reference to `padlock_supports' /local/scratch/ianc/devel/xen-unstable.git/stubdom/polarssl-x86_32/library/aes.c:661: undefined reference to `padlock_xcryptecb' /local/scratch/ianc/devel/xen-unstable.git/stubdom/mini-os-x86_32-vtpmmgr/mini-os.o: In function `aes_crypt_cbc': /local/scratch/ianc/devel/xen-unstable.git/stubdom/polarssl-x86_32/library/aes.c:771: undefined reference to `padlock_supports' /local/scratch/ianc/devel/xen-unstable.git/stubdom/polarssl-x86_32/library/aes.c:773: undefined reference to `padlock_xcryptcbc' make[1]: *** [/local/scratch/ianc/devel/xen-unstable.git/stubdom/mini-os-x86_32-vtpmmgr/mini-os] Error 1 Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> [ ijc -- applied same fix to stubdom/vtpm/Makefile ] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: rerun autogen.shIan Campbell2013-01-181-160/+132
| | | | | | | | I forgot to do this while checking in 26424:e1d7053e4d45. Refresh now so as to not cause confusing looking changes next time it is run. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: Add autoconfMatthew Fioravante2013-01-184-48/+4697
| | | | | | | | | | | | | | | | | | Stub domains now use autoconf to build. This configure script can enable or disable specific domains and also specify custom download locations for stubdom library packages. See ./configure --help for details. C and Caml are disabled by default. vtpm-stubdom is conditional on the presense of cmake. Rename vtpmmgrdom to vtpmmgr-stubdom Also update .*ignore Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* Add vtpm documentationMatthew Fioravante2013-01-182-0/+150
| | | | | | | | See the files included in this patch for details Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* vtpm/vtpmmgr and required libs to stubdom/MakefileMatthew Fioravante2013-01-183-1/+209
| | | | | | | | | | | | | | | | | | | Add 3 new libraries to stubdom: libgmp polarssl Berlios TPM Emulator 0.7.4 Add makefile structure for vtpm and vtpmmgrdom. Both vtpm domains are optional builds as vtpm depends on cmake. To build either of them, you must do so explicitly. make vtpm-stubdom vtpmmgrdom Finally, also update .*ignore Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> [ijc, folded in fix from Matthew to workaround cmake 2.8.2 build failure] Committed-by: Ian Campbell <ian.campbell@citrix.com>
* add stubdom/vtpmmgr codeMatthew Fioravante2013-01-1818-0/+4766
| | | | | | | | | Add the code base for vtpmmgrdom. Makefile changes next patch. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* add vtpm-stubdom codeMatthew Fioravante2013-01-1810-0/+1212
| | | | | | | | | Add the code base for vtpm-stubdom to the stubdom heirarchy. Makefile changes in later patch. Signed-off-by: Matthew Fioravante <matthew.fioravante@jhuapl.edu> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* libxc: builder: limit maximum size of kernel/ramdisk.Ian Jackson2012-10-261-0/+4
| | | | | | | | | | | | | | | | | | | | | | Allowing user supplied kernels of arbitrary sizes, especially during decompression, can swallow up dom0 memory leading to either virtual address space exhaustion in the builder process or allocation failures/OOM killing of both toolstack and unrelated processes. We disable these checks when building in a stub domain for pvgrub since this uses the guest's own memory and is isolated. Decompression of gzip compressed kernels and ramdisks has been safe since 14954:58205257517d (Xen 3.1.0 onwards). This is XSA-25 / CVE-2012-4544. Also make explicit checks for buffer overflows in various decompression routines. These were already ruled out due to other properties of the code but check them as a belt-and-braces measure. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 26109:6ccfe4d29f95Ian Jackson2012-10-261-4/+0
| | | | | | | This changeset was contaminated by changes hanging around in my working tree. Sorry :-(. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* xl: Do not leak events when a domain exits.Ian Campbell2012-10-251-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | The goto in both of these places misses the event free which would normally clean up. ==8655== 80 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==8655== at 0x4024370: calloc (vg_replace_malloc.c:593) ==8655== by 0x406EAAE: libxl__zalloc (libxl_internal.c:83) ==8655== by 0x4078173: libxl__event_new (libxl_event.c:1167) ==8655== by 0x4056373: domain_death_occurred (libxl.c:958) ==8655== by 0x4058D06: domain_death_xswatch_callback (libxl.c:1038) ==8655== by 0x4078EB5: watchfd_callback (libxl_event.c:458) ==8655== by 0x407839E: afterpoll_internal (libxl_event.c:949) ==8655== by 0x4079142: eventloop_iteration (libxl_event.c:1371) ==8655== by 0x40799BB: libxl_event_wait (libxl_event.c:1396) ==8655== by 0x805CC67: create_domain (xl_cmdimpl.c:1698) ==8655== by 0x805E001: main_create (xl_cmdimpl.c:3986) ==8655== by 0x804D43D: main (xl.c:285) Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* stubdom: install stubdompath.sh as data fileOlaf Hering2012-10-181-1/+2
| | | | | | | | | | | | | | rpmlint complains a script helper which is only sourced: [ 1875s] xen-tools.i586: W: script-without-shebang /usr/lib/xen/bin/stubdompath.sh [ 1875s] This text file has executable bits set or is located in a path dedicated for [ 1875s] executables, but lacks a shebang and cannot thus be executed. If the file is [ 1875s] meant to be an executable script, add the shebang, otherwise remove the [ 1875s] executable bits or move the file elsewhere. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: fix rpmlint warning spurious-executable-permOlaf Hering2012-10-181-1/+1
| | | | | | | | | | | | [ 1758s] xen-tools.x86_64: E: spurious-executable-perm (Badness: 50) /usr/lib/xen/boot/xenstore-stubdom.gz [ 1758s] The file is installed with executable permissions, but was identified as one [ 1758s] that probably should not be executable. Verify if the executable bits are [ 1758s] desired, and remove if not. NOTE: example scripts should be packaged under [ 1758s] %docdir/examples, which will avoid this warning. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: fix compile errors in grubOlaf Hering2012-10-181-0/+45
| | | | | | | | | | | | | | | | | | | | | Building xen.rpm in SLES11 started to fail due to these compiler warnings: [ 1436s] ../grub-upstream/netboot/fsys_tftp.c:213: warning: operation on 'block' may be undefined [ 1437s] ../grub-upstream/netboot/main.c:444: warning: operation on 'block' may be undefined [ 1234s] E: xen sequence-point ../grub-upstream/netboot/fsys_tftp.c:213 [ 1234s] E: xen sequence-point ../grub-upstream/netboot/main.c:444 The reason for this is that the assignment is done twice: tp.u.ack.block = ((uint16_t)( (((uint16_t)((block = prevblock)) & (uint16_t)0x00ffU) << 8) | (((uint16_t)((block = prevblock)) & (uint16_t)0xff00U) >> 8))); Fix this package build error by adding another patch for grub, which moves the assignment out of the macro usage. Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: fix error assignment in grub:load_moduleOlaf Hering2012-10-111-1/+1
| | | | | | | | | [ 1333s] mini-os.c: In function 'load_module': [ 1333s] mini-os.c:244: warning: statement with no effect Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* stubdom: fix parallel build by expanding CROSS_MAKEOlaf Hering2012-10-081-28/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently I changed my rpm xen.spec file from doing 'make -C tools -j N && make stubdom' to 'make -j N stubdom' because stubdom depends on tools, so both get built. The result was the failure below. .... mkdir -p grub-x86_64 CPPFLAGS="-isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include -D__MINIOS__ -DHAVE_LIBC -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../tools/xenstore -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86 -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/x86/x86_64 -U __linux__ -U __FreeBSD__ -U __sun__ -nostdinc -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os/include/posix -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/cross-root-x86_64/x86_64-xen-elf/include -isystem /usr/lib64/gcc/x86_64-suse-linux/4.7/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include -isystem /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/lwip-x86_64/src/include/ipv4 -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/include -I/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../xen/include" CFLAGS="-mno-red-zone -O1 -fno-omit-frame-pointer -m64 -mno-red-zone -fno-reorder-blocks -fno-asynchronous-unwind-tables -m64 -g -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -fno-stack-protector -fno-exceptions" make DESTDIR= -C grub OBJ_DIR=/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub-x86_64 make[2]: Entering directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub' make[2]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule. make[2]: *** INTERNAL: readdir: Bad file descriptor . Stop. make[2]: Makefile: Field 'stem' not cached: Makefile make[2]: Leaving directory `/home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/grub' make[1]: *** [grub] Error 2 [ -d mini-os-x86_64-xenstore ] || \ for i in $(cd /home/abuild/rpmbuild/BUILD/xen-4.2.25602/non-dbg/stubdom/../extras/mini-os ; find . -type d) ; do \ mkdir -p mini-os-x86_64-xenstore/$i ; \ done .... Expanding every occurrence of CROSS_MAKE avoids this error. It also has the nice side effect of actually enabling parallel build for stubdom. According to the GNU make documentation $(MAKE) gets its special meaning only if it appears directly in the recipe: http://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
* PV-GRUB: add support for btrfsMatt Wilson2012-04-041-0/+3512
| | | | | | | | | | This patch adds btrfs support to the GRUB tree used to build PV-GRUB. The original patch is from Gentoo: https://bugs.gentoo.org/show_bug.cgi?id=283637 Signed-off-by: Matt Wilson <msw@amazon.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* PV-GRUB: add support for ext4Matt Wilson2012-04-041-0/+474
| | | | | | | | | | This patch adds support for ext4 to the GRUB tree used to build PV-GRUB. The original patch is taken from the Fedora GRUB package in this commit: http://pkgs.fedoraproject.org/gitweb/?p=grub.git;a=commitdiff;h=32bf414af04d377055957167aac7dedec691ef57 Signed-off-by: Matt Wilson <msw@amazon.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* PV-GRUB: Check for errors when applying patches to GRUBMatt Wilson2012-04-041-1/+1
| | | | | | | | | | We want to ensure that patches apply cleanly without rejects. Bail if patch returns a non-zero exit code. Signed-off-by: Matt Wilson <msw@amazon.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* stubdom: enable xenstored buildDaniel De Graaf2012-02-092-3/+33
| | | | | | | Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* mini-os: make frontends and xenbus optionalDaniel De Graaf2012-02-091-0/+1
| | | | | | | | | | | | | | | | | This adds compile-time logic to disable certain frontends in mini-os: - pcifront is disabled by default, enabled for ioemu - blkfront, netfront, fbfront, kbdfront, consfront are enabled by default - xenbus is required for any frontend, and is enabled by default If all frontends and xenbus are disabled, mini-os will run without needing to communicate with xenstore, making it suitable to run the xenstore daemon. The console frontend is not required for the initial console, only consoles opened via openpt or ptmx. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* mini-os: Move test functions into test.cDaniel De Graaf2012-02-092-0/+2
| | | | | | | | | | While useful, these test functions should not be compiled into every mini-os instance that we compile. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* mini-os: create app-specific configurationDaniel De Graaf2012-02-095-4/+8
| | | | | | | | | | | | | | Instead of using CONFIG_QEMU and CONFIG_GRUB to enable or disable minios code, create CONFIG_ items for features and use application-specific configuration files to enable or disable the features. The configuration flags are currently added to the compiler command line; as the number of flags grows this may need to move to a header. Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
* stubdom: update README to reference xl configuration syntaxIan Campbell2012-02-091-12/+13
| | | | | | | Remove reference to fsback -- it was removed some time ago. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Rename ioemu-dir as qemu-xen-traditional-dir2012-01-241-4/+4
| | | | | | | From: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* stubdom: allow to build with older tool chainJan Beulich2011-12-131-1/+1
| | | | | | | | | | | GNU make prior to 3.81 doesn't support $(realpath ...). This fixes a regression introduced in 23368:0f670f5146c8 (the option tested via cc-option-add got interpreted as the argument of the -I compiler option, as its intended argument was blank, and hence the compiler was falsely considered to support *any* option in the pciutils sub-tree). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* pv-grub: Fix for incorrect dom->p2m_host[] list initializationDaniel Kiper2011-04-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Introduction of Linux Kernel git commit ceefccc93932b920a8ec6f35f596db05202a12fe (x86: default CONFIG_PHYSICAL_START and CONFIG_PHYSICAL_ALIGN to 16 MB) revealed deeply hidden bug in pv-grub. During kernel load stage dom->p2m_host[] list has been incorrectly initialized. At the beginning of kernel load stage dom->p2m_host[] list is populated with current PFN->MFN layout. Later during memory allocation (memory is allocated page by page in kexec_allocate()) page order is changed to establish linear layout in new domain. It is done by exchanging subsequent MFNs with newly allocated MFNs. dom->p2m_host[] list is indexed by currently requested PFN (it is incremented from 0) and PFN of newly allocated paged. If PFN of newly allocated page is less than currently requested PFN then earlier allocated MFN is overwritten which leads to domain crash later. This patch corrects that issue. If PFN of newly allocated page is less then currently requested PFN then relevant PFN/MFN pair is properly calculated and usual exchange occurs later. Signed-off-by: Daniel Kiper <dkiper@net-space.pl> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* build: Make XEN_ROOT an absolute path.Keir Fraser2011-03-175-20/+19
| | | | | | | | Otherwise make can search the path relative to certain standard paths such as /usr/include (e.g., the line '-include $(XEN_ROOT)/.config' in Config.mk suffers from this). Signed-off-by: Keir Fraser <keir@xen.org>
* stubdom: Fix stubdom-dm using "grep" improperlyJohn Weekes2011-01-111-1/+1
| | | | | | | | | | | | | | | | | stubdom-dm uses "grep" on "xm list" output to determine whether it is already running. The existing behavior is to use "grep $domname-dm" but this will result in a false-positive in the case of another domU running whose name ends with the full new name; for instance, if "abctest-dm" is running, a new "test-dm" will spin forever, waiting for it the end. Any easy fix is to have it use "grep -w" instead of "grep", searching for the whole word only. It also might be worth considering a switch to "xl list" from "xm list", here and in other places. Signed-off-by: John Weekes <lists.xen@nuclearfallout.net> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Reapply 61c0c52a8c6c "qemu-xen: build adjustments"Ian Jackson2010-11-231-2/+12
| | | | | | | | The changeset qemu-xen: build adjustments to support out-of-tree builds works after all. Sorry for the noise. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Revert 61c0c52a8c6c "qemu-xen: build adjustments"Ian Jackson2010-11-231-12/+2
| | | | | | | | It appears that the changeset qemu-xen: build adjustments to support out-of-tree builds broke the build. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* qemu-xen: build adjustments to support out-of-tree buildsJan Beulich2010-11-231-2/+12
| | | | | | | | | | | | | | | | QEMU by itself can be built outside of its source directory. With the qemu repository being separate from the hypervisor/tools one it seems to make sense to make use of this feature, but doing so requires a couple of adjustments to the Xen changes to it. Basically, if CONFIG_QEMU is found to indicate an existing directory, this directory will be used rather than cloning the git repo into the build tree. [ This changeset is the xen-unstable part of the patch but also includes the QEMU_TAG update to pull in the qemu part. -iwj ] Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* stubdom: allow building with read-only sourcesJan Beulich2010-11-191-1/+2
| | | | | | Signed-off-by: Jan Beulich <jbeulich@novell.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools: caml-stubdom: fix "red zone" bugPatrick Colp2010-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the AMD64 ABI, the 128-byte area below %rsp is reserved for scratch space and should not be used by signal, interrupt, or exception handlers. However, Mini-OS does not adhere to this interface. As a result, the -mno-red-zone flag must be provided to gcc in order to force code to be compiled without this assumption. In the case of the c-stubdom or the ioemu stubdom, Makefile configuration and flags are inherited from Xen, which includes this flag. However, in the case of the ocaml stubdom, since an independent ocaml version is pulled and compiled, with its own make system in place, this flag is not present. As a default optimisation (no optimisation flags specified), gcc generates function header code that uses mov instead of push (to save a few instructions). However, with the 128-byte scratch space assumption in place, registers are moved onto the stack *before* %rsp is updated. This results in cases where when a function is being called, *after* the first mov <foo>, <offset>(%rsp) but *before* the %rsp update, sub <bar>, %rsp, if an interrupt is fired, then the stack will be clobbered (as Mini-OS uses the application stack for its stack, pushing registers onto the stack on entry and popping them off on exit). This patch fixes this issue by passing the -mno-red-zone flag to the ocaml configure script in the stubdom Makefile. Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* tools/ocaml: Fix caml-stubdom make line to depend on the ocaml cross compilerPatrick Colp2010-09-211-1/+1
| | | | | | | | | | | The provided sample caml stubdom needs to use the ocaml cross compiler, but if it hasn't been downloaded and compiled, then it won't find it and the build will fail. This makes caml-stubdom depend on the cross compiler, so it will automatically get built before the stubdom. Signed-off-by: Patrick Colp <pjcolp@cs.ubc.ca> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* x86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded ↵Keir Fraser2010-07-251-3/+1
| | | | | | targets. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* stubdom: correct handling DESTDIR during buildIan Campbell2010-07-211-26/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stubdom/Makefile expects components to install themselves to stubdom/$(CROSS_ROOT) and passes the appropriate configure and make variables to make this happen. However if the top-level build uses DESTDIR then this not only effects the installation targets in stubdom/Makefile but is also propagated to the individual components' build causing them to install into an unexpected location and breaking the build. In other words "make -C stubdom DESTDIR=/tmp/a-dest-dir" fails due to missing headers because they had been installed into /tmp/a-dest-dir instead of stubdom/$(CROSS_ROOT). The existing attempt to clear DESTDIR for the newlib install phase was insufficient. Define a CROSS_MAKE variable which should be used to recurse into the cross compiled components and which clears DESTDIR. Also move the definition of the genpath target to after the first "all" target so that the default target is all. I have confirmed that with this fix only the Xen build system outputs end up in /tmp/a-dest-dir. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-6/+6
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>