Commit Graph
100 Commits
Author SHA1 Message Date
Wei Liu cf7900b51e Tools.mk.in: drop unused variables
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-07-16 16:08:36 +01:00
Wei Liu c66d9982eb tools: bump library version numbers to 4.12
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-07-13 08:39:35 +01:00
Wei Liu c6dd998ec8 automation/build: update stretch-i386 dockerfile
We don't need to specify /bin/bash in the entry point rune, otherwise
non-interactive invocation of the container would fail with something
like:

+ C=debian:stretch-i386
+ export CONTAINER=registry.gitlab.com/xen-project/xen/debian:stretch-i386
+ CONTAINER=registry.gitlab.com/xen-project/xen/debian:stretch-i386
+ cd /local/work/COMMITTER/xen-32.git
+ git fetch origin
+ con git reset --hard origin/staging
*** Ensuring registry.gitlab.com/xen-project/xen/debian:stretch-i386 is up to date
*** Launching container ...
/usr/bin/git: /usr/bin/git: cannot execute binary file

While at it, use shorthand "linux32".

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-07-13 08:08:12 +01:00
Wei Liu b9a3c95356 automation/build: build ovmf
Install nasm and build ovmf with gcc on x86.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Doug Goldstein <cardoe@cardoe.com>
2018-07-12 15:46:10 +01:00
Wei Liu d8fd67feac xl/vsnd: initialise rc in dryrun path
Reported-by: Coverity
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-07-10 15:17:43 +01:00
Wei Liu 06fb99498d xl/vsnd: use xcalloc to allocate memory for parser
... because it handles errors for us.

Reported-by: Coverity
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-07-10 15:17:43 +01:00
Wei Liu d7b1c5f7fa libxl/vsnd: add missing error checks
Reported-by: Coverity
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-07-10 15:17:43 +01:00
Wei Liu f14e5a00bf MAINTAINERS: use https for git trees
Commit message stolen from a reply from Ian:

The git protocol is not just unencrypted, but also unauthenticated.
In theory it is possible to verify the signed tags for actual
releases, but that is a cumbersome process which I very much doubt
anyone really does.

As for the various branch tips, there is currently no way (unless you
have a shell account on xenbits) to get any kind of authenticated
value.

Conversely, if you use an https url, you get some cryptographic
authentication of what you are cloning.  The crypto there is far from
perfect but it is massively better than nothing.

Additionally, in general, using and supporting https also means that
*what users are accessing* is encrypted.  This enhances user privacy.
In the specific case of the git trees on xenbits this is a very minor
consideration.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-07-10 14:18:44 +01:00
Wei Liu 5045b85663 MAINTAINERS: drop USB PV DRIVERS entry
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2018-07-10 14:18:44 +01:00
Wei Liu a75703b2f0 automation: build more stuff on x86 with docker
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2018-07-10 08:24:01 +01:00
Wei Liu 4dac395814 automation: introduce stretch-i386.dockerfile
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2018-07-10 08:24:01 +01:00
Wei Liu d45262a5fa automation: install some packages for CentOS from EPEL
They are needed to build tools.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2018-07-10 08:24:01 +01:00
Wei Liu e38e285a51 docs: fix xpti command line option doc
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-05-04 16:21:53 +01:00
Wei Liu 21b5d48cf4 xen/arm: fix build after f20a6e309
Commit f20a6e309 removed a parameter from smp_prepare_cpus but only
the x86 parts were submitted and committed.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
2018-04-10 09:10:36 +01:00
Wei Liu f20a6e3093 x86: remove unused parameter from smp_prepare_cpus
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
2018-04-09 10:51:27 +01:00
Wei Liu 115fb8e345 Revert "tools/libxl: Fix build following c/s 74fd984ae"
This reverts commit d96f17f50c.

It doesn't fix the build.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-04-06 10:33:58 +01:00
Wei Liu acf92c83b5 x86/mm: skip incrementing mfn if it is not a valid mfn
In a follow-up patch, some callers will be switched to pass
INVALID_MFN instead of zero for non-present mappings. So skip
incrementing mfn if it is not a valid one.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2018-04-05 18:43:42 +01:00
Wei Liu 90eff18cc5 x86/hvm/ioreq: fix two bugs in hvm_create_ioreq_server
It is possible to call the error path with i pointing beyond the end
of the array.

There is another bug that if there is already a default ioreq server,
the code will actually sets the element to NULL, hence leaking memory.

Move setting NULL to where it is needed.

Coverity-ID: 1433777
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-04-04 12:44:52 +01:00
Wei Liu 913acc1aa0 Revert "Config.mk: update mini-os commit"
This reverts commit 55e0590e4b.

The update has broken stubdom tests.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-04-03 18:51:14 +01:00
Wei Liu 55e0590e4b Config.mk: update mini-os commit
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-03-27 17:21:36 +01:00
Wei Liu 4fd21cf4d1 Config.mk: update seabios to release 1.11.1
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-03-27 16:29:46 +01:00
Wei Liu 0e8e4a4437 x86/vpci: validate data first in register_vpci_mmcfg_handler
Avoid the need to deallocate memory when the data is invalid. It has
the benefit to not fragment memory in Xen.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-03-27 16:29:46 +01:00
Wei Liu 1dd9fa04fa Revert "tools: detect appropriate debug optimization level"
This reverts commit b435014517.

Due to the implementation of cc-option, the check is always true,
which means build for gcc that doesn't have -Og support is broken.

This patch can be reapplied once we have fixed cc-option.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-03-14 17:15:15 +00:00
Wei Liu 93de1d0b34 gitignore: ignore wrappers.c link for fuzzer
At the same time reorder the entries alphabetically.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-03-14 11:46:27 +00:00
Wei Liu 5cfbd651da x86: rename HAVE_GAS_* to HAVE_AS_*
Xen also uses clang's assembler when it is possible. Change the macro
names to not be GAS specific.

Patch produced with:

$ for f in `git grep HAVE_GAS_ | cut -d':' -f1`; \
    do sed -i 's/HAVE_GAS_/HAVE_AS_/g' $f; done

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-03-02 17:11:35 +00:00
Wei Liu 63dc135aea x86: invpcid support
Provide the functions needed for different modes. Add cpu_has_invpcid.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-03-02 17:11:25 +00:00
Wei Liu 3a6719f40f Revert "make xen ocaml safe-strings compliant"
This reverts commit df1e4c6e7f.

Oxenstored is broken by this change.
2018-02-12 11:05:35 +00:00
Wei Liu f2728cfb4c Revert "ocaml/libs/xb: update xb.mli in accordance with df1e4c6e7f8"
This reverts commit a53b9b987a.
2018-02-12 11:05:35 +00:00
Wei Liu c93014ad3a ocaml/libs/xb: don't generate *.mli automatically
To stay in line with other parts of the ocaml code base.

This requires committing a bunch of mli files in tree.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
2018-02-07 17:31:13 +00:00
Wei Liu a53b9b987a ocaml/libs/xb: update xb.mli in accordance with df1e4c6e7f
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
2018-02-07 17:30:37 +00:00
Wei Liu 76dcdb75b7 xen: Fix xsm build after [g]cov renaming
Commit e8d461497d renamed gcov_op to coverage_op but forgot to change
XSM handles.

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>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-01-26 11:15:36 +00:00
Wei Liu 8155476765 x86: fix GET_STACK_END
AIUI the purpose of having the .if directive is to make GET_STACK_END
work with any general purpose registers. The code as-is would produce
the wrong result for r8. Fix it.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-25 11:34:17 +00:00
Wei Liu 73d1f55efc tools: bump library version numbers to 4.11
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-01-24 12:41:21 +00:00
Wei Liu 1c8627d2a1 Revert "x86/boot: Map more than the first 16MB"
This reverts commit 7d6f958d9d.

Now we have PVH info relocation support, this change is no longer
needed.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-01-23 18:00:02 +00:00
Wei Liu 201f852eaf x86: relocate pvh_info
Modify early boot code to relocate pvh info as well, so that we can be
sure __va in __start_xen works.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-23 18:00:02 +00:00
Wei Liu 8b5314f5d6 xen/shim: stash RSDP address for ACPI driver
It used to the case that we placed RSDP under 1MB and let Xen search
for it. We moved the placement to under 4GB in 4a5733771, so the
search wouldn't work.

Introduce rsdp_hint to ACPI code and set that variable in
convert_pvh_info.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-01-22 17:29:53 +00:00
Wei Liu 4dcfd7d143 libxl: lower shim related message to level DEBUG
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-01-22 15:42:50 +00:00
Wei Liu 831cbe98f6 x86/shim: use credit scheduler
Remove sched=null from shim cmdline and doc

We use the default scheduler (credit1 as of writing). The NULL
scheduler still has bugs to fix.

Update shim.config.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-01-22 15:42:50 +00:00
Wei Liu 68ccebedb9 x86/guest: clean up guest/xen.h
Remove extraneous semicolon. Add blank lines. Remove unused static
inline functions.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2018-01-22 15:42:50 +00:00
Wei Liu 4a79815ab1 libxl: remove whitespaces introduced in 62982da926
No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-01-22 15:42:50 +00:00
Wei Liu 086740e457 Update shim.config
Kconfig has

  bool "VGA support" if !PV_SHIM_EXCLUSIVE

so for the shim build VGA option doesn't exist.

This avoids having shim.config changed every time the shim is built.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2018-01-22 15:42:50 +00:00
Wei Liu 81838c9067 ocaml: fix arm build
ARM doesn't have emulation_flags in the arch_domainconfig.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
2018-01-18 10:54:08 +00:00
Wei Liu db3ae8becc tools: fix arm build after bdf693ee61
The ramdisk fields were removed. We should use modules[0] instead.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2018-01-17 11:32:23 +00:00
Wei Liu 36c560e7f3 Don't build xen-shim for 32 bit build host
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:56:45 +00:00
Wei Liu 1557ebd863 x86: don't swallow the first command line item in guest mode
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu fe18227d82 x86: read wallclock from Xen when running in pvh mode
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2018-01-16 18:34:04 +00:00
Wei Liu 02e0de0115 x86: APIC timer calibration when running as a guest
The timer calibration currently depends on PIT. Introduce a variant
to wait for a tick's worth of time to elapse when running as a PVH
guest.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2018-01-16 18:34:04 +00:00
Wei Liu 357b4ede66 x86: xen pv clock time source
It is a variant of TSC clock source.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu b95c86b01a xen/pvshim: keep track of used PFN ranges
Simple infrastructure to keep track of PFN space usage, so that we can
use unpopulated PFNs to map special pages like shared info and grant
table.

As rangeset depends on malloc being ready so hypervisor_setup is
introduced for things that can be initialised late in the process.

Note that the PFN is marked as reserved at least up to 4GiB (or more
if the guest has more memory). This is not a perfect solution but
avoids using the MMIO hole below 4GiB. Ideally the shim (L1) should
have a way to ask the underlying Xen (L0) which memory regions are
populated, unpopulated, or MMIO space.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu 770e5c7f62 xen: introduce rangeset_claim_range
Reserve a hole in a rangeset.

Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu 5cf4b4617d xen/console: Introduce console=xen
This specifies whether to use Xen specific console output. There are
two variants: one is the hypervisor console, the other is the magic
debug port 0xe9.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu ef3410a759 x86/pvh: Retrieve memory map from Xen
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu d96bb172e8 x86/entry: Early PVH boot code
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu 4ab99cb919 x86: produce a binary that can be booted as PVH
Produce a binary that can be booted as PVH. It doesn't do much yet.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu cb3842d5ee x86: introduce ELFNOTE macro
It is needed later for introducing PVH entry point.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu 2dd3e22949 tools/libelf: fix elf notes check for PVH guest
PVH only requires PHYS32_ENTRY to be set. Return immediately if that's
the case.

Also remove the printk in pvh_load_kernel.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu 83d6b08b8b tools/libxc: remove extraneous newline in xc_dom_load_acpi
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2018-01-16 18:34:04 +00:00
Wei Liu a08ee2c06d docs: rename hvmlite.markdown to pvh.markdown
And remove stale paragraph and escape underscores.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-11-13 10:50:09 +00:00
Wei Liu 1f61c07d79 Revert "tools/dombuilder: Switch to using gfn terminology for console and xenstore rings"
This reverts commit f48b5449da, which
breaks pvgrub.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-11-06 14:52:39 +00:00
Wei Liu cc2dc90434 Revert "tools/dombuilder: Fix asymmetry when setting up console and xenstore rings"
This reverts commit 87b0ae7e82.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-11-06 14:52:20 +00:00
Wei Liu e07ebab865 Revert "tools/dombuilder: Prevent failures of xc_dom_gnttab_init()"
This reverts commit 9ff6dbfa75, which
breaks hvm save/restore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-11-03 14:14:46 +00:00
Wei Liu 29028ed8db Merge remote-tracking branch 'origin/staging' into staging 2017-11-02 17:07:58 +00:00
Wei Liu f48b5449da tools/dombuilder: Switch to using gfn terminology for console and xenstore rings
The sole use of xc_dom_translated() and xc_dom_p2m() outside of the domain
builder is for libxl_dom() to translate the console and xenstore pfns back
into useful values.  PV guest pfns are only interesting to the domain builder,
and gfns are the address space used by all other hypercalls.

Renaming the fields in xc_dom_image is deliberate, as it will cause
out-of-tree users of the dombuilder to notice the different semantics.

Correct the terminology throughout xc_dom_gnttab{_hvm,}_seed(), which are all
using gfns despite the existing variable names.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Julien Grall <julien.grall@arm.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
[ wei: fix stubdom build ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-11-02 17:07:11 +00:00
Wei Liu 03dd1e2a54 Config.mk: update mini-os changeset
The new changeset contains the new console.h fix in xen.git.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
2017-10-25 11:27:45 +01:00
Wei Liu e1bc61af76 docs: update coverage.markdown
The coverage support in hypervisor is redone. Update the document.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
2017-10-23 14:03:44 +01:00
Wei Liu 8e77dabc58 libxl: annotate s to be nonnull in libxl__enum_from_string
Hope this can placate coverity.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
2017-10-20 11:40:49 +01:00
Wei Liu 6b8ed03ccf Revert "DEBUG PRINTFS"
This reverts commit cf8e5f25a9.

It is not supposed to be committed.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-10-11 15:03:01 +01:00
Wei Liu a164e14c6e travis: disable UBSAN
The stock compiler in travis doesn't support -fsanitize=undefined.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
2017-10-10 18:24:32 +01:00
Wei Liu 572a781904 xen: hook up UBSAN with CONFIG_UBSAN
Make the following changes:

1. Introduce CONFIG_UBSAN and other auxiliary options.
2. Introduce Build system rune to filter objects.
3. Make ubsan.c build.

Currently only x86 is supported. All init.o's are filtered out because
of limitation in the build system. There is no user of noubsan-y yet
but it is worth keeping to ease future development.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-10-09 17:05:00 +01:00
Wei Liu 3e4bc919cb xen, tools: console.h shouldn't require string.h by default
Unilaterally making string.h a prerequisite for console.h is going to
break build for a lot of consumers of console.h.

Define a macro for the new flex ring. Consumers which want to use it
should define the macro.

Partially revert af8d935641.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
2017-10-09 09:57:02 +01:00
Wei Liu 2b668a84e5 libxl: use correct type modifier for vuart_gfn
Fixes compilation error like:

libxl_console.c: In function ‘libxl__device_vuart_add’:
libxl_console.c:379:5: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘xen_pfn_t’ [-Werror=format=]
      flexarray_append(ro_front, GCSPRINTF("%lu", state->vuart_gfn));

Reported-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Tested-by: Bhupinder Thakur <bhupinder.thakur@linaro.org>
2017-10-05 15:46:38 +01:00
Wei Liu 72b0c19a70 xenconsole: fix 32bit compilation
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-10-04 16:58:57 +01:00
Wei Liu 0b0ca65b54 Config.mk: update mini-os changeset
It contains build fix for stubdom.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-10-04 15:14:51 +01:00
Wei Liu a71a96a41e libxl/gentypes: fix generating array of enums
There is no reason to hardcode "x" in code. Use "w" which is passed
by the higher level.

This change requires us to allow "x" to be unused so that the
top-level enum parse_json functions continue to compile.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-10-04 11:09:46 +01:00
Wei Liu 71b7b4e0f5 libxendevicemodel: initialise extent.pad to zero
The pad field needs to be zero as required by the hypervisor.

Instead of setting the pad separately, use C99 initialiser.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
2017-09-28 11:57:45 +01:00
Wei Liu 1c2ea5ee05 x86/hvm/dmop: fix EFAULT condition
The copy macro returns false when the copy fails.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2017-09-28 11:57:21 +01:00
Wei Liu c4169f955d python/libxc: extend the call to get/set cap for credit2
Commit 68817024 ("xen: credit2: allow to set and get utilization cap")
added a new parameter. Implement it for the python binding as well.

Coverity-ID: 1418532

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2017-09-27 18:04:38 +01:00
Wei Liu 1fafc4b23c xen/credit2: add missing unlock
Coverity-ID: 1418531

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
2017-09-27 18:04:28 +01:00
Wei Liu a8ea6e2688 Merge remote-tracking branch 'origin/staging' into staging 2017-09-26 11:26:07 +01:00
Wei Liu e90188b981 x86emul/test: generate non-pie executable for 64bit builds
PIE may (and commonly will) result in the binary being loaded above
the 4Gb boundary, which can't work with at least the VZEROUPPER compat
mode test.

Add -fno-PIE and -no-pie when appropriate so that gcc won't generate a
PIE executable.

Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-25 15:29:04 +01:00
Wei Liu 7ff9661b90 x86/mm: move declaration of new_guest_cr3 to local pv/mm.h
It is only used by PV. The code can only be moved together with other
PV mm code.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu f3b95fd07f x86/mm: move PV l4 table setup code
Move the code to pv/mm.c. Export pv_arch_init_memory via global
pv/mm.h and init_guest_l4_table via local pv/mm.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 1bd39738a5 x86/mm: factor out pv_arch_init_memory
Move the split l4 setup code into the new function. It can then be
moved to pv/ in a later patch.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu e044318e03 x86/mm: move and rename map_ldt_shadow_page
Add pv prefix to it. Move it to pv/mm.c. Fix call sites.

Take the chance to change v to curr and d to currd.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu db3e0e3331 x86/mm: move compat descriptor table manipulation code
Move them alongside the non-compat variants.

Change u{32,64} to uint{32,64}_t and the type of ret from long to int
while moving.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 67756788e3 x86/mm: split out descriptor table manipulation code
Move the code to pv/descriptor-tables.c. Change u64 to uint64_t while
moving. Use currd in do_update_descriptor.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu e7a07839f1 x86/mm: add pv prefix to {set,destroy}_gdt
Unfortunately they can't stay local to PV code because domain.c still
needs them. Change their names and fix up call sites. The code will be
moved later together with other descriptor table manipulation code.

Also move the declarations to pv/mm.h and provide stubs.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 0bf001d21b x86/mm: split out pv grant table code
Move the code to pv/grant_table.c. Nothing needs to be done with
regard to headers.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 39061c6099 x86/mm: move map_guest_l1e to pv/mm.c
And export the function via pv/mm.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu d232ba8708 x86/mm: remove the now unused inclusion of pv/emulate.h
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 7fde99cb73 x86/mm: move ro page fault emulation code
Move the code to pv/ro-page-fault.c.  Create a new header file
asm-x86/pv/mm.h and move the declaration of pv_ro_page_fault there.
Include the new header file in traps.c.

Fix some coding style issues. The prefixes (ptwr and mmio) are
retained because there are two sets of emulation code in the same file.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu f04bc26dd5 x86/mm: move {un,}adjust_guest_l*e to pv/mm.h
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 792c0977fa x86/mm: move update_intpte to pv/mm.h
While at it, change the type of preserve_ad to bool.  Also move
UPDATE_ENTRY there.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 60a2de33a7 x86/mm: export get_page_from_mfn
It will be used later in multiple files.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 0f43e9cb6f x86/mm: move guest_get_eff_l1e to pv/mm.h
Make it static inline. It will be used by map_ldt_shadow_page and ro
page fault emulation code later.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
2017-09-22 16:31:50 +01:00
Wei Liu 829324d18c libxl: provide typedefs for device framework functions
Use the new typedefs to avoid copy-n-paste everywhere.

No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2017-09-22 11:07:59 +01:00
Wei Liu 9fbd310715 xl: avoid leaking memory in vdispl parser
Coverity-ID: 1418095

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-09-18 16:41:18 +01:00
Wei Liu 3e10635193 libxl: use libxl__read_xenstore_mandatory in vtpm function
libxl__read_xenstore can return NULL. Use the _mandatory variant to
return early when the read fails.

Coverity-ID: 1418098

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-09-18 16:41:09 +01:00
Wei Liu 2655a08216 libxl: use libxl__read_xenstore_mandatory in vdispl function
Coverity-ID: 1418097

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
2017-09-18 16:40:56 +01:00
Wei Liu 64a00683ed arm: use plain bool in various headers
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
2017-09-15 16:28:07 +01:00