Commit Graph
100 Commits
Author SHA1 Message Date
Wei Liu 5c883cf036 tools: remove blktap2 related code and documentation
Blktap2 is effectively dead for a few years.

Notable changes in this patch:

0. Unhook blktap2 from build system
1. libxl no longer supports TAP disk backend, with appropriate assertions
   added and some code paths now return ERROR_FAIL
2. Tap is no longer a supported backend
3. Remove blktap2 entry from MAINTAINERS

A patch to remove blktap2 directory will come later.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-05-15 16:19:45 +01:00
Wei Liu 03e48b7b2a INSTALL: remove duplicate sentence
The same sentence is repeated in the next paragraph.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
2019-05-15 12:46:01 +01:00
Wei Liu bdd0f3c9b0 README: document requirement about python
Provide information on what is expected from the build system
regarding python.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2019-05-15 12:45:50 +01:00
Wei Liu e911b4e26f gitignore: ignore .vscode directory
The directory is created by Visual Studio Code editor to store its
local state.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
2019-05-15 12:45:37 +01:00
Wei Liu 1d1f161153 gitlab-ci: allow specifying base and tip in build test
We will soon provide this new capability to humans and automated
systems.

The default behaviour is retained: tip and base are passed by Gitlab
CI.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-05-15 11:01:06 +01:00
Wei Liu 396ce9ca02 public/tmem.h: fix version number in comment
The version number has been changed above due to rebasing onto 4.13
branch, but the one in the matching comment was left unchanged.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2019-05-13 15:30:57 +01:00
Wei Liu 004299fba4 gitlab-ci: avoid deleting build-each-commit-gcc.log
072a96c490 used `git clean -ffdx` which caused the log to be deleted.

Generate the log in the parent directory then move it back.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-05-13 12:45:57 +01:00
Wei Liu 1061631a57 docs: remove tmem related text
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-05-13 11:28:27 +01:00
Wei Liu c492e19fdd xen: remove tmem from hypervisor
This patch removes all tmem related code and CONFIG_TMEM from the
hypervisor. Also remove tmem hypercalls from the default XSM policy.

It is written as if tmem is disabled and tmem freeable pages is 0.

We will need to keep public/tmem.h around forever to avoid breaking
guests.  Remove the hypervisor only part and put guest visible part
under a xen version check. Take the chance to remove trailing
whitespaces.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-05-13 11:28:27 +01:00
Wei Liu c588c002cc tools: remove tmem code and commands
Remove all tmem related code in libxc.

Leave some stubs in libxl in case anyone has linked to those functions
before the removal.

Remove all tmem related commands in xl, all tmem related code in other
utilities we ship.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-05-13 11:28:27 +01:00
Wei Liu e83077a3d1 libxl: don't enable synthetic timers by default
It broke Windows installation. More investigation is needed. Don't
enable this feature by default.

Partially revert 26fba3c855 ("viridian: add implementation of
synthetic timers").

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
2019-05-07 14:41:59 +01:00
Wei Liu 860d6e158d xl: handle PVH type in apply_global_affinity_masks again
A call site in create_domain can call it with PVH type. That site was
missed during the review of 48dab9767.

Reinstate PVH type in the switch.

Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-04-12 15:41:43 +01:00
Wei Liu 072a96c490 gitlab-ci: use git clean -ffdx in build each commit test
The build script invoked is designed to run in a pristine checkout.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-08 13:28:12 +01:00
Wei Liu 7a01cfaeb0 gitlab-ci: log commit range in build test
It is easier to debug stuff when the target range is clearly visible
at the top.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-08 11:31:28 +01:00
Wei Liu b3c2939fdd automation: fix "build each commit" test
An error was introduced while rebasing 9b8b3f30. The new test
shouldn't depend on anything, otherwise artefacts will be downloaded
from build stage and cause the script to abort.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-04-05 15:40:01 +01:00
Wei Liu 9b8b3f300f automation: introduce a test to build each commit
This is added to the test stage so that its failure won't block other
things.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-05 11:15:38 +01:00
Wei Liu 1ba432fb73 automation: add a script to build newly pushed commits in Gitlab CI
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-05 11:15:36 +01:00
Wei Liu 78798fb431 automation: set ret for potential error in build-test.sh
`git rev-list` can fail if the base..tip range contains invalid
commit(s). If that happens ret never gets a chance to be set.

Set ret before hand to fix the issue.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-05 11:14:57 +01:00
Wei Liu f21a359a30 automation: allow build-test.sh to run in detached HEAD state
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-05 11:14:57 +01:00
Wei Liu 9f8d606b43 xen: vcpu_migrate_start can be static
It's not used outside of schedule.c.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: George Dunlap <george.dunlap@citrix.com>
2019-04-04 17:22:46 +01:00
Wei Liu 58e1417945 build: don't mandate availability of a fetcher program
It is common that build hosts are isolated from outside world. They
don't necessarily have wget or ftp installed.

Turn the error into warning in configure. And point FETCHER to `false'
command if neither wget nor ftp is available, so any attempt to
download will result in error.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-04 15:03:05 +01:00
Wei Liu bcb15f52d7 gitlab-ci: add fedora gcc build jobs
Although the image comes with clang, clang builds don't work yet.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-04 14:20:27 +01:00
Wei Liu 460837f800 automation: add Fedora image to containerize script
At the same time sort the list alphabetically.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-04 14:20:25 +01:00
Wei Liu e4c96ef233 automation: add a Fedora image
Use the latest and greatest.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2019-04-04 14:20:13 +01:00
Wei Liu a57a1b26ec tools/ocaml: make python scripts 2 and 3 compatible
1. Explicitly import reduce because that's required in 3.
2. Change print to function.
3. Eliminate invocations of has_key.

Signed-off-by: M A Young <m.a.young@durham.ac.uk>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
2019-04-02 09:50:58 +01:00
Wei Liu ff915c8cac pygrub: encode / decode string in Python 3
String is unicode in 3 but bytes in 2. We need to call encode / decode
function when using Python 3.

Reported-by: M A Young <m.a.young@durham.ac.uk>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-02 09:50:41 +01:00
Wei Liu 767ba397d3 pygrub/grub: always use integer for default entry
The original code set the default to either a string or an integer
(0) and relies on a Python 2 specific behaviour to work (integer is
allowed to be compared to string in Python 2 but not 3).

Always use integer. The caller (pygrub) already has code to handle
that.

Reported-by: M A Young <m.a.young@durham.ac.uk>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-02 09:47:38 +01:00
Wei Liu 485079e816 pygrub: fix message in grub parser
The code suggests 0 is allowed. Zero is not a positive number.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-02 09:47:14 +01:00
Wei Liu d96a4d6c9c tools/xenmon: make xenmon.py compatible with python 2 and 3
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-04-01 13:22:31 +01:00
Wei Liu 59e9783ddf libxc: fix HVM core dump
f969bc9fc9 forbid get_address_size call on HVM guests, because that
didn't make sense. It broke core dump functionality on HVM because
libxc unconditionally asked for guest width.

Force guest_width to a sensible value.

Reported-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-03-20 16:52:01 +00:00
Wei Liu a892f81dde x86: decouple xen alignment setting from EFI/ELF build
Introduce a new Kconfig option to pick the alignment for xen binary.
To retain original behaviour, the default pick for EFI build is 2M and
ELF build 4K.

Make the PVHSHIM build use 2M alignment for potentially better
performance.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2019-03-19 14:39:42 +00:00
Wei Liu 8ac7d80f8d x86: drop "depends on X86" for TBOOT Kconfig option
Given that this file already resides under arch/x86, there is no need
to have the dependency.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2019-03-19 14:39:25 +00:00
Wei Liu 75e383fa93 automation: enable building rombios with clang
Previously it is disabled because the embedded ipxe can't be built
with clang. Now that ipxe is split out we can use --with-system-ipxe
to work around the issue.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-03-15 12:40:24 +00:00
Wei Liu f67e6e904c Config.mk: update seabios to 1.12.1
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-03-14 15:00:52 +00:00
Wei Liu 7619745071 tools: bump library version numbers
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-03-14 12:31:54 +00:00
Wei Liu d2151152dd xen: make grant table support configurable
Introduce CONFIG_GRANT_TABLE. Provide stubs and make sure x86 and arm
hypervisors build with grant table disabled.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
2019-03-13 15:44:52 +00:00
Wei Liu 38a85fe8d9 build/m4: fix python library detection on Ubuntu systems
16cc3362ae doesn't work on Ubuntu with gcc (but it does work with
clang). Work around it by manipulating LIBS.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-13 15:01:36 +00:00
Wei Liu 222fb80031 travis: use python-dev instead of python2.7-dev
Xen build should be using default python now.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-13 15:01:36 +00:00
Wei Liu 49704b8d23 automation: use python-dev python2.7-dev in Debian and Ubuntu
... instead of python2.7-dev.

We installed python2.7-dev because xen only worked with 2.7.

Installing python2.7-dev only gives python2.7-config, which causes
configure to fail because it wants python-config by default. Now xen
should work with 2.6 and above, we can install python-dev and let
distros pick the default python.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-13 15:01:36 +00:00
Wei Liu 85578ea686 Run autogen.sh for 4.13
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2019-03-13 13:40:23 +00:00
Wei Liu 9b0bc91b3b README: remove requirement on Python 2
Now that all python scripts are compatible with Python 2.6 and above,
remove the restriction.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:53 +00:00
Wei Liu 83a204e695 pygrub/fsimage: make it work with python 3
With the help of two porting guides and cpython source code:

1. Use PyBytes to replace PyString counterparts.
2. Use PyVarObject_HEAD_INIT.
3. Remove usage of Py_FindMethod.
4. Use new module initialisation routine.

For #3, Py_FindMethod was removed, yet an alternative wasn't
documented.  The code is the result of reverse-engineering cpython
commit 6116d4a1d1

https://docs.python.org/3/howto/cporting.html
http://python3porting.com/cextensions.html

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:53 +00:00
Wei Liu 0aabd89dcf pygrub: make python scripts work with 2.6 and up
Run 2to3 and pick the sensible suggestions.

Import print_function and absolute_import so 2.6 can work.

There has never been a curses.wrapper module according to 2.x and 3.x
doc, only a function, so "import curses.wrapper" is not correct. It
happened to work because 2.x implemented a (undocumented) module.

We only need to import curses to make curses.wrapper available to
pygrub.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:53 +00:00
Wei Liu 660d2dd863 libxl: make python scripts work with python 2.6 and up
Go through transformations suggested by 2to3 and pick the necessary
ones.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:53 +00:00
Wei Liu 16cc3362ae build/m4: make python_devel.m4 work with both python 2 and 3
Do the following:

1. Change the form of "print".
2. Use AC_CHECK_FUNC to avoid the need to generate library name.
3. Remove unused stuff.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
2019-03-12 14:24:52 +00:00
Wei Liu b9e1368af1 pygrub: change tabs into spaces
Not sure why Python 2 never complained, but Python 3 does.

Change tabs to spaces.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:52 +00:00
Wei Liu e81209fd4e pygrub/fsimage: drop unused struct
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:52 +00:00
Wei Liu 72288c1566 Update Python requirement to 2.6
CentOS 5, which was the reason for the 2.4 restriction, is EOL. CentOS
6 ships 2.6.

Bump the version to 2.6 in README. Update configure.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2019-03-12 14:24:52 +00:00
Wei Liu 6b6ff07fbd tools: drop obsolete xen-ringwatch
This utility can't possibly work with modern Xen setup: none of the
sysfs path used (under /sys/devices/xen-backend) is documented as
stable ABI in upstream Linux kernel.

Archaeology shows that the path used could have been part of the
xenolinux fork which never got upstreamed.

Its utility is zero nowadays. Drop it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2019-02-06 12:04:26 +00:00
Wei Liu 755eb6403e automation: introduce a QEMU smoke test for PVH Dom0
Make qemu-smoke-x86-64.sh take a variant argument. Make two new tests
in test.yaml.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-02-01 15:13:25 +00:00
Wei Liu f15ff4d500 x86/pvh-boot: don't mandate validity of RSDP pointer
RSDP is not mandatory according to PVH spec. Remove the BUG_ON. The
guest (xen) will fall back to scanning if necessary.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooepr3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-01-30 14:49:07 +00:00
Wei Liu f50dd67950 libxl: correctly dispose of dominfo list in libxl_name_to_domid
Tamas reported ssid_label was leaked. Use the designated function to
free dominfo list to fix the leakage.

Reported-by: Tamas K Lengyel <tamas@tklengyel.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-01-29 14:57:58 +00:00
Wei Liu 1912f1220c libxl: fix error message for unsharing namespaces
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-01-18 14:22:36 +00:00
Wei Liu 68292c94a6 tools: only call git when necessary in OVMF Makefile
Users may choose to export a snapshot of OVMF and build it
with xen.git supplied ovmf-makefile. In that case we don't
need to call `git submodule`.

Fixes b16281870e.

Reported-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2019-01-16 14:52:22 +00:00
Wei Liu b16281870e tools/firmware: update OVMF Makefile
OVMF has become dependent on OpenSSL, which is included as a
submodule.  Initialise submodules before building.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
2019-01-09 14:35:50 +00:00
Wei Liu a9c904c5a8 xen: simplify {check,poison}_one_page
Use __map_domain_page macro to deal with page_info directly.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-12-11 17:20:32 +00:00
Wei Liu d887ced5d2 xen: clean up common/page_alloc.c
Remove trailing whitespaces. Turn bool_t into bool. Annotate a section
for CONFIG_SEPARATE_XENHEAP.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-12-11 17:20:32 +00:00
Wei Liu 31b5e595c4 x86: remove out label in spurious_interrupt
The out label is followed by a semicolon only. Use return directly.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-12-11 13:05:31 +00:00
Wei Liu 4cf5d62642 automation: skip test stage for some branches
We skipped build stage for those branches. We want to skip test state
for those branches too.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-12-10 16:31:09 +00:00
Wei Liu 81cfc1b3c7 automation: break .gitlab-yaml into smaller files
Break out files for build jobs and test jobs. Keep the top level
.gitlab-ci.yaml small.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-12-05 22:30:14 +00:00
Wei Liu 9f4ac0e6c2 automation: add a qemu smoke test for clang build
Also rename the old test to have -gcc suffix.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-12-05 22:30:03 +00:00
Wei Liu c3acf04dbd tools: set Dom0 UUID if requested
Introduce XEN_DOM0_UUID in Xen's global configuration file.  Make
xen-init-dom0 accept an extra argument for UUID.

Also switch xs_open error message in xen-init-dom0 to use perror.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Sergey Dyasli <sergey.dyasli@citrix.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-11-28 16:12:44 +00:00
Wei Liu 568653e01b automation: make clean between builds
Currently randconfig tests are more likely to fail than to succeed
because of a bug in xen's build system: symbols-dummy.o's dependency
is wrong, which causes it to not get rebuild between runs, which
eventually causes linking to fail. There may also be other corner
cases we haven't discovered.

The fix is not straightforward. For now, make sure the tree is cleaned
properly between builds so we don't see random failures in Gitlab CI.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-21 18:34:27 +00:00
Wei Liu 29e284512f automation: add qemu smoke test
This patch introduces a new test stage into the pipeline and provides
a simple QEMU based smoke test.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-20 18:15:46 +00:00
Wei Liu 3c21dba189 automation: also specify xen binary as artifact on x86_64
... so that it can be passed on to test stage.

Note that xen is only extracted for x86_64 build since others may not
have that. Use a directory to account for possibly different file
names on Arm.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-20 18:15:39 +00:00
Wei Liu b9fb402ec3 automation: stash default config file for artifact extraction
This aids troubleshooting when we notice a failure in the default
configuration.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-20 16:55:10 +00:00
Wei Liu 102a437d59 automation: introduce CONTAINER_NO_PULL for containerize
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-20 16:54:55 +00:00
Wei Liu 668f149048 automation: fix debian-{stretch,unstable}-32-gcc-debug
They should have used .gcc-x86-32-build-debug in the first place.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-20 14:44:28 +00:00
Wei Liu 0a1eb2b438 tools/helpers: make gen_stub_json_config accept an UUID argument
If that's set, the stub is going to contain that UUID.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-11-20 14:43:39 +00:00
Wei Liu cb278ebdb8 tools: update examples/README
This file gets installed to the host system.

This patch cleans it up: 1. remove things that don't exist anymore; 2.
change xm to xl; 3. fix xen-devel list address; 4. add things that are
missing; 5. delete trailing whitespaces.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-11-20 14:42:50 +00:00
Wei Liu d4f507e55d automation: properly tag x86 jobs in Gitlab CI
Since we have introduced arm64 variants, we'd better start tagging the
old ones.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-19 21:11:41 +00:00
Wei Liu 75c8037c1e automation: introduce some RANDCONFIG tests
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-19 21:11:38 +00:00
Wei Liu 988ebbefc2 automation: refactor gitlab-ci.yaml
Use the "extends" keyword introduced in 11.3 to reduce repetition in
jobs. More importantly, this helps us better organise the properties
of jobs.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-19 21:11:11 +00:00
Wei Liu 30311d2e82 x86: fix efi.lds dependency generation
RANDCONFIG builds discover efi.lds is not updated when autogenerated
headers are updated.

Upon inspection, the generated .d file contains xen.lds.o as target,
not the once thought efi.lds.o. That's because gcc disregards the
output object name specified by -o when generating dependency, so the
sed invocation has no effect.

Arguably that's a bug in gcc, which can be fixed at some point, so we
make the sed rune work with *.lds. At the same time replace the
hardcoded sed rune for xen.lds with the new one.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-11-19 11:09:51 +00:00
Wei Liu e9c4574d81 Config.mk: update seabios
This new release contains a fix for building legacy acpi tables with
newer iasl, which we want.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-11-19 10:03:54 +00:00
Wei Liu f089fddd94 xen: report PV capability in sysctl and use it in toolstack
0e2c886ef ("xen: decouple HVM and IOMMU capabilities") provided a
truth table for what `xl info` would report. In order to make the
table work xen will need to report its PV capability.

Replace cap_directio with cap_pv in libxl IDL. It is safe to do so
because cap_directio has never been released. Revert to use
cap_hvm_directio to mark the availability of IOMMU, to save us from
providing a compatibility layer.

Don't bump sysctl version number because we've already done so.

Also provide a new virt_caps "pv", change "directio" to "pv_directio".
The truth table is now:

    pv      hvm     iommu           flags in xl info
    0       0       x               n/a
    0       1       0               hvm
    0       1       1               hvm hvm_directio
    1       0       0               pv
    1       0       1               pv pv_directio
    1       1       0               pv hvm
    1       1       1               pv hvm hvm_directio pv_directio

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-11-15 15:16:49 +00:00
Wei Liu 15410d8fc8 automation: lift tools build restriction in build script
The restrictions are mostly from Travis CI days when cross-compilation
was not feasible. Now we will be building natively on Arm, remove
those lines.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-13 13:48:46 +00:00
Wei Liu 4cbc298570 automation: add two Arm64 builds to Gitlab CI
Add two gcc builds. Clang builds are known to be broken at the moment.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-13 13:48:42 +00:00
Wei Liu 8cf264cba5 automation: add debian unstable arm64v8 image
Unfortunately sharing dockerfile has proven impossible: 1) the base
image is different; 2) Arm doesn't need libc-dev-i386; 3) Arm needs
libfdt-dev.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-13 13:48:40 +00:00
Wei Liu 94bd9df0f7 x86: fix hvm_migrate_irq assertion
782cf8ba46 ("pass-through: adjust pIRQ migration") added an assertion
to hvm_migrate_irq.

PVH Dom0 is broken because it doesn't have dpci allocated. Add an
is_hardware_domain check to the assertion.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-11-12 15:16:12 +00:00
Wei Liu 28f1c549e7 x86: eliminate pv_post_outb_hook
Use amd_acpi_c1e_quirk and amd_check_disable_c1e instead.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-12 09:31:55 +00:00
Wei Liu a34eb9ff15 x86/traps: use only one stub function for l/cstar
And place it into .text.cold.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2018-11-09 11:33:32 +00:00
Wei Liu 21b17f9eaa automation: build with Ubuntu 18.04
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-08 18:15:37 +00:00
Wei Liu 77533e4f7d automation: add dockerfile for Ubuntu 18.04
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-08 18:15:24 +00:00
Wei Liu 9044a8c185 Revert "arch/x86: Add registers to vm_event"
This reverts commit da61a2102f, because
it breaks !CONFIG_HVM builds.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-11-08 17:22:35 +00:00
Wei Liu 7ef789d79f automation: build some customised configs
Introduce a new directory to put in configs we care about. Modify
build script to build with those configs.

While we only introduce x86 configs initially, provision for non-x86
configs.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-11-08 16:40:20 +00:00
Wei Liu 657b303878 x86: expose CONFIG_PV
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-08 16:40:20 +00:00
Wei Liu 02cd416985 x86: make PV hypercall entry points work with !CONFIG_PV
We want Xen to crash if we hit these paths when PV is disabled.

For syscall, we provide stubs for {l,c}star_enter which end up calling
panic.  For sysenter, we initialise CS to 0 so that #GP can be raised.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-08 16:40:20 +00:00
Wei Liu 20c076d13b x86/amd: don't set pv_post_outb_hook when !CONFIG_PV
Obviously it won't exist when PV is disabled.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-11-08 16:40:20 +00:00
Wei Liu a76e48f879 x86: put x86emul_{read,write}_dr under CONFIG_PV
A build breakage is discovered by a non-debug build. Debug build
worked because the ASSERT made the compiler eliminate the rest of the
functions.

Currently they are PV only. There are comments alluding to possible
future HVM support but we can cross the bridge when we get there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-06 10:19:32 +00:00
Wei Liu ec651bd246 x86: make entry point code build when !CONFIG_PV
Skip building x86_64/compat/entry.S and put CONFIG_PV in
x86_64/entry.S.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-05 17:23:47 +00:00
Wei Liu f8810d333e x86: update help string for CONFIG_HVM
Update text. Change "guest" to "domain" where appropriate because
"guest" doesn't include Domain 0.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-11-05 16:12:12 +00:00
Wei Liu 9ea75d2c13 x86: rearrange x86_64/entry.S
Split the file into two halves. The first half pertains to PV guest
code while the second half is mostly used by the hypervisor itself to
handle interrupts and exceptions.

No functional change intended.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-05 16:10:35 +00:00
Wei Liu f969bc9fc9 x86/domctl: rework XEN_DOMCTL_{set,get}_address_size
Going through toolstack code, they are used for PV guests only.

Tighten their access to PV only. Return -EOPNOTSUPP if they are called
on HVM guests. Rewrite the code in a pattern that makes DCE work.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-05 16:09:50 +00:00
Wei Liu aa0816b74f x86: make traps.c build with !CONFIG_PV
Provide a stub for pv_inject_event. Put code that accesses PV fields
and GDT / LDT fault handling code under CONFIG_PV. Move set_debugreg
to pv/misc-hypercalls.c.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-05 16:08:03 +00:00
Wei Liu 3cbecb3c63 x86: put vcpumask_to_pcpumask under CONFIG_PV
This function is used by PV code only. This issue is discovered by
clang build.

Drop spurious inline while at it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-11-05 10:30:29 +00:00
Wei Liu 2cf113891a libxl/arm: fix guest type conversion
Commit 359970fd8b ("tools/libxl: Switch Arm guest type to PVH") missed
changing the type field in c_info. This issue didn't surface until
ef72c93df9 which made creating PV guest on Arm unusable.

Create libxl__arch_domain_create_info_setdefault and switch the type
there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-11-02 14:22:20 +00:00
Wei Liu 079df73c0a x86: put some code in arch_set_info_guest under CONFIG_PV
This function is called by both PV and HVM. Unfortunately the code is
very convoluted. We can reason that code between the call to
hvm_set_info_guest and out label is PV only. Put that portion under
CONFIG_PV.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-10-28 20:01:58 +00:00
Wei Liu de5a2bdced x86: make mm.c build with !CONFIG_PV
Start by putting hypercall handlers which are supposed to be PV only
under CONFIG_PV. Shuffle some code around to avoid introducing
excessive numbers of CONFIG_PV.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-10-28 20:01:37 +00:00
Wei Liu 76bfbcec42 arm: fix Dom0 creation after ef72c93df9
ARM Dom0 creation was broken by the said commit because ARM neither
provided XEN_DOMCTL_CDF_hvm_guest nor had CONFIG_PV set.

Set XEN_DOMCTL_CDF_hvm_guest flag for ARM Dom0 to fix the issue. Also
set XEN_DOMCTL_CDF_hap while at it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
2018-10-22 14:43:40 +01:00