]> xenbits.xensource.com Git - xen.git/log
xen.git
9 years agopublic/io/netif.h: document control ring and toeplitz hashing
Paul Durrant [Tue, 12 Jan 2016 09:58:56 +0000 (09:58 +0000)]
public/io/netif.h: document control ring and toeplitz hashing

This patch documents a new shared ring between frontend and backend that
can be used to pass bulk out-of-band data, such as that required to
implement toeplitz hashing in the backend such that it is configurable by
the frontend (which is needed to support NDIS RSS for Windows guests).

The patch then goes on to document the messages passed over the control
ring that can be used to configure toeplitz hashing and a new extra info
fragment that can be used to pass hash values between frontend and
backend for both transmit and receive packets.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agopublic/io/netif.h: clarifications to wire formats
Paul Durrant [Tue, 12 Jan 2016 09:58:55 +0000 (09:58 +0000)]
public/io/netif.h: clarifications to wire formats

My previous patch 03809ae7 "document transmit and receive wire formats
separately" improved documentation of the receive and transmit wire
formats but further clarifications were requested.

This patch adds those clarifications.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstat: handle more than 1024 domains
Juergen Gross [Fri, 15 Jan 2016 16:07:39 +0000 (17:07 +0100)]
xenstat: handle more than 1024 domains

get_domain_ids() in libxenstat used by read_attributes_qdisk() is
limited to 1024 domains. Remove that limit.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoINSTALL: fix typo
Doug Goldstein [Mon, 18 Jan 2016 23:17:43 +0000 (17:17 -0600)]
INSTALL: fix typo

There's a case of a missing T in the word 'the'.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoMAINTAINERS: add myself for kconfig
Doug Goldstein [Wed, 16 Dec 2015 14:41:56 +0000 (08:41 -0600)]
MAINTAINERS: add myself for kconfig

Added myself as the maintainer of kconfig.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: Keir Fraser <keir@xen.org>
CC: Tim Deegan <tim@xen.org>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agodocs: document xenstore domain xenstore paths
Juergen Gross [Mon, 18 Jan 2016 08:04:04 +0000 (09:04 +0100)]
docs: document xenstore domain xenstore paths

Add the xenstore domain specific xenstore paths to
docs/misc/xenstore-paths.markdown

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: don't stop xenstore domain when stopping dom0
Juergen Gross [Mon, 18 Jan 2016 08:04:03 +0000 (09:04 +0100)]
tools: don't stop xenstore domain when stopping dom0

When restarting or shutting down dom0 the xendomains script tries to
stop all other domains. Don't do this for the xenstore domain, as it
might survive a dom0 reboot in the future.

The same applies to xl shutdown --all. Here the xenstore domain is
flagged as "never stop".

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: write xenstore domain data to xenstore
Juergen Gross [Mon, 18 Jan 2016 08:04:02 +0000 (09:04 +0100)]
xenstore: write xenstore domain data to xenstore

After starting the xenstore domain write the basic data (domid, name
and memory values) to the xenstore. This makes the domain appear
correctly in xl list. Create a stub json object in order to make e.g.
xl list -l happy.

Add a new option to init-xenstore-domain to be able to specify the
domain's name.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: split up xen-init-dom0.c
Juergen Gross [Mon, 18 Jan 2016 08:04:01 +0000 (09:04 +0100)]
tools: split up xen-init-dom0.c

Split up tools/helpers/xen-init-dom0.c in order to prepare reusing
generation of the json configuration by init-xenstore-domain.c.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: add init-xenstore-domain parameter to specify cmdline
Juergen Gross [Mon, 18 Jan 2016 08:04:00 +0000 (09:04 +0100)]
xenstore: add init-xenstore-domain parameter to specify cmdline

Add a parameter to init-xenstore-domain for support of arbitrary
parameters for the xenstore domain.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agoxenstore: make use of the "xenstore domain" flag
Juergen Gross [Mon, 18 Jan 2016 08:03:59 +0000 (09:03 +0100)]
xenstore: make use of the "xenstore domain" flag

Create the xenstore domain with the xenstore flag specified. This
enables us to test whether such a domain is already running before
we create it. As there ought to be only one xenstore in the system
we don't need to start another one.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: modify init-xenstore-domain parameter syntax
Juergen Gross [Mon, 18 Jan 2016 08:03:58 +0000 (09:03 +0100)]
xenstore: modify init-xenstore-domain parameter syntax

init-xenstore-domain takes only positional parameters today. Change
this to a more flexible parameter syntax allowing to specify additional
options or to omit some.

Today the supported usage is:

init-xenstore-domain <xenstore-kernel> <memory_mb> <flask-label>
                     [<ramdisk-file>]

Modify this to:

init-xenstore-domain --kernel <xenstore-kernel>
                     --memory <memory_mb>
                     [--flask <flask-label>]
                     [--ramdisk <ramdisk-file>]

The flask label is made optional in order to support xenstore domains
without the need of a flask enabled hypervisor.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: add error messages to init-xenstore-domain
Juergen Gross [Mon, 18 Jan 2016 08:03:57 +0000 (09:03 +0100)]
xenstore: add error messages to init-xenstore-domain

Additional add some diagnostic messages to the program to have an idea
why it failed.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agoxenstore: destroy xenstore domain in case of error after creating it
Juergen Gross [Mon, 18 Jan 2016 08:03:56 +0000 (09:03 +0100)]
xenstore: destroy xenstore domain in case of error after creating it

When creating a xenstore domain via init-xenstore-domain destroy it
in case of an error occurred after calling xc_domain_create().

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxl: move xen-init-dom0 to tools/helpers
Juergen Gross [Mon, 18 Jan 2016 08:03:55 +0000 (09:03 +0100)]
libxl: move xen-init-dom0 to tools/helpers

Move xen-init-dom0 from tools/libxl to tools/helpers, as it is just a
helper program.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: adjust coding style of init-xenstore-domain.c
Juergen Gross [Mon, 18 Jan 2016 08:03:54 +0000 (09:03 +0100)]
xenstore: adjust coding style of init-xenstore-domain.c

Adjust the coding style of init-xenstore-domain.c to the general Xen
coding style.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxenstore: move init-xenstore-domain to tools/helpers
Juergen Gross [Mon, 18 Jan 2016 08:03:53 +0000 (09:03 +0100)]
xenstore: move init-xenstore-domain to tools/helpers

The program init-xenstore-domain to start a xenstore domain instead
of the xenstored daemon is built, but not installed. Change that.

Move the program to a new tools subdirectory "helpers" to be able to
use libxl in a later patch. Otherwise a dependency loop will be
created.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxl: provide a flag in dominfo to avoid stopping it
Juergen Gross [Mon, 18 Jan 2016 08:03:52 +0000 (09:03 +0100)]
libxl: provide a flag in dominfo to avoid stopping it

Add a "never_stop" flag to dominfo as indicator for the toolstack that
this domain is to be kept running. For now it is being set for xenstore
domain, but there might be other domains in the future.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxc: support new xenstore domain flag in libxc
Juergen Gross [Mon, 18 Jan 2016 08:03:51 +0000 (09:03 +0100)]
libxc: support new xenstore domain flag in libxc

Support the xenstore domain flag for obtaining domain info.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoacpi/pmstat: build for x86 only
Parth Dixit [Mon, 18 Jan 2016 13:55:23 +0000 (14:55 +0100)]
acpi/pmstat: build for x86 only

Pmstat is currently not supported for ARM in Xen. Configure and build
pmstat for x86 architecture only.

Signed-off-by: Parth Dixit <parth.dixit@linaro.org>
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
9 years agoACPI / table: add new function to get table entries
Ashwin Chaugule [Mon, 18 Jan 2016 13:54:08 +0000 (14:54 +0100)]
ACPI / table: add new function to get table entries

The acpi_table_parse() function has a callback that
passes a pointer to a table_header. Add a new function
which takes this pointer and parses its entries. This
eliminates the need to re-traverse all the tables for
each call. e.g. as in acpi_table_parse_madt() which is
normally called after acpi_table_parse().

Acked-by: Grant Likely <grant.likely@linaro.org>
Signed-off-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit f08bb472bff3c0397fb7d6f47bc5cec41dad76e3]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()
Len Brown [Mon, 18 Jan 2016 13:53:41 +0000 (14:53 +0100)]
ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()

Allow consumers of the acpi_table_parse()/acpi_table_parse_entries() API
to gracefully handle the acpi_disabled=1 case via return value
rather than checking the global flag themselves.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[Linux commit e5b8fc6ac158f65598f58dba2c0d52ba3b412f52]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agobuild: env var to enable expert config options
Jonathan Creekmore [Mon, 18 Jan 2016 13:53:02 +0000 (14:53 +0100)]
build: env var to enable expert config options

Add an additional environment variable, defaulting to disabled,
that enables the CONFIG_EXPERT configuration option. The purpose
of the CONFIG_EXPERT configuration option is to make non-standard
Kconfig options visible during the configuration process. The
CONFIG_EXPERT option is not, itself, visible during the Kconfig
configuration process, so typical users will never see it nor
any of the non-standard configuration options.

Signed-off-by: Jonathan Creekmore <jonathan.creekmore@gmail.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
9 years agox86/hvm: don't set the BSP as initialised in hvm_vcpu_initialise
Roger Pau Monné [Mon, 18 Jan 2016 13:52:31 +0000 (14:52 +0100)]
x86/hvm: don't set the BSP as initialised in hvm_vcpu_initialise

The BSP will be marked as initialised after hvm_load_cpu_ctxt has loaded the
initial state, which is called from the toolstack during domain creation.

Previous to my HVMlite series HVM guests were started without setting any
explicit CPU state (in fact we placed that horrible jmp at 0x0, because the
IP was by default set to 0x0). This is no longer true, and now HVM guests
require that a proper CPU context is loaded before starting. This change
helps enforce this policy.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
9 years agospinlock: use mnemonics for recursive spinlock sentinel values
Andrew Cooper [Mon, 18 Jan 2016 13:51:57 +0000 (14:51 +0100)]
spinlock: use mnemonics for recursive spinlock sentinel values

No resulting change.  The compiled binary is identical.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
9 years agoKconfig: fix environment variable handling
Jan Beulich [Mon, 18 Jan 2016 13:51:06 +0000 (14:51 +0100)]
Kconfig: fix environment variable handling

With xen/Makefile including include/config/auto.conf.cmd, environment
variables checked in the latter must be available at the time of
inclusion of that file, and hence must be populated in xen/Makefile
rather than by passing to or inside xen/tools/kconfig/Makefile.kconfig.
Otherwise incremental re-builds will always be full re-builds, which is
not only annoying but actively problematic when building as non-root
and only running "install-xen" as root.

Also take the opportunity and remove stray $(Q) uses.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: make FLASK utils build unconditional
Doug Goldstein [Fri, 15 Jan 2016 17:39:40 +0000 (11:39 -0600)]
tools: make FLASK utils build unconditional

The flask utilities only have dependencies on libxc so there's no
downside to always building it. Distros and projects based on Xen can
put these in a different package to not install them for all users.
Prior to this change FLASK_ENABLE needed to be set at the top level to
build the utilities and the tools/configure script would build the FLASK
policy by default, but only if the utilities were built.

This change makes item 3 from
http://lists.xenproject.org/archives/html/xen-devel/2016-01/msg01796.html
a happen by default.

CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CC: Ian Campbell <ian.campbell@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxen: move installed copy of xen/.config file to /boot
Ian Campbell [Mon, 18 Jan 2016 11:19:27 +0000 (11:19 +0000)]
xen: move installed copy of xen/.config file to /boot

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
9 years agolibxl: create 'drivers', 'feature' and 'attr' xenstore paths
Paul Durrant [Fri, 15 Jan 2016 10:00:10 +0000 (10:00 +0000)]
libxl: create 'drivers', 'feature' and 'attr' xenstore paths

My recent patch series 'docs: Document xenstore paths' included 3
patches documenting new xenstore paths to allow PV drivers/agents in
guests to advertise version information, significant features and
attributes (such as assigned IP addresses).

This patch adds the necessary code to libxl to create these paths in
xenstore when a domain is created.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoMAINTAINERS: Add xen/drivers/char/cadence-uart.c
Edgar E. Iglesias [Fri, 15 Jan 2016 12:14:18 +0000 (13:14 +0100)]
MAINTAINERS: Add xen/drivers/char/cadence-uart.c

Add xen/drivers/char/cadence-uart.c to the ARM section.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxen/arm: Add r1p12 to the list of supported Cadence UARTs
Edgar E. Iglesias [Thu, 14 Jan 2016 18:44:07 +0000 (19:44 +0100)]
xen/arm: Add r1p12 to the list of supported Cadence UARTs

Add r1p12 to the list of supported Cadence UARTs. Xen only
uses the subset of features available in r1p8, so we don't
need to differentiate between r1p8 and r1p12 yet.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxl: base libxl_list_vm() on libxl_list_domain()
Juergen Gross [Mon, 4 Jan 2016 14:55:52 +0000 (15:55 +0100)]
libxl: base libxl_list_vm() on libxl_list_domain()

libxl_list_vm() is calling xc_domain_getinfolist() today with a limit
of 1024 domains. To avoid open coding a loop around
xc_domain_getinfolist() to avoid the 1024 domain limit just use
libxl_list_domain() instead.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
9 years agolibxl: remove the xl list limit of 1024 domains
Juergen Gross [Mon, 4 Jan 2016 14:55:51 +0000 (15:55 +0100)]
libxl: remove the xl list limit of 1024 domains

xl list is currently limited to 1024 domains. Remove the limit.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
9 years agogitignore: update stubdom entries
Wei Liu [Thu, 14 Jan 2016 16:17:57 +0000 (16:17 +0000)]
gitignore: update stubdom entries

Add stubdom/libs-* to gitignore, then sort stubdom/* entries
alphabetically.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoSEABIOS_UPSTREAM_REVISION Update
Ian Campbell [Fri, 15 Jan 2016 10:34:21 +0000 (10:34 +0000)]
SEABIOS_UPSTREAM_REVISION Update

Track the upstream 1.9-stable branch.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
9 years agolibxl: fix _SC_GETPW_R_SIZE_MAX usage
Roger Pau Monne [Thu, 14 Jan 2016 15:06:50 +0000 (16:06 +0100)]
libxl: fix _SC_GETPW_R_SIZE_MAX usage

If sysconf(_SC_GETPW_R_SIZE_MAX) fails for any reason just use an initial
buffer size of 2048. This is not a critical failure, and the code that
makes use of this buffer is able to expand it later if required.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: fix python install with "xentoollog"
Konrad Rzeszutek Wilk [Wed, 13 Jan 2016 03:16:11 +0000 (22:16 -0500)]
tools: fix python install with "xentoollog"

commit 5d3dc8671521ea4a4f753e77d3e7fb3a3a6f5f80
"tools: Refactor "xentoollog" into its own library"
with older python versions (2.6.4) will fail to
the build if attempted to be done twice (which
happens due to pygrub dependencies).

make -C python DESTDIR=/tmp
make -C python DESTDIR=/tmp

The second one will fail with:
error: -Wl, -rpath-link=../../tools/libs/toollog: No such file or directory

even though the directory is there (with the libs).

Andrew pointed out that the linker additions should be in
the "extra_link_args" rather than "depends".

And true enough - with that modification it builds.

CC: Ian Campbell <ian.campbell@citrix.com>
CC: Ian Jackson <ian.jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Suggested-by: Andrew Cooper <andrew.cooper3@citirx.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- typo in commit message ]

9 years agovm_event: add altp2m info to HVM events as well
Tamas K Lengyel [Thu, 14 Jan 2016 09:49:50 +0000 (10:49 +0100)]
vm_event: add altp2m info to HVM events as well

Add altp2m information to HVM events as well when altp2m is active.

Signed-off-by: Tamas K Lengyel <tamas@tklengyel.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
9 years agobuild: remove .config when making distclean
Boris Ostrovsky [Thu, 14 Jan 2016 09:44:04 +0000 (10:44 +0100)]
build: remove .config when making distclean

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
9 years agoRevert "libxc: create an initial FPU state for HVM guests"
Roger Pau Monné [Thu, 14 Jan 2016 09:43:36 +0000 (10:43 +0100)]
Revert "libxc: create an initial FPU state for HVM guests"

This reverts commit d64dbbcc7c9934a46126c59d78536235908377ad:

Xen always set the FPU as initialized when loading a HVM context, so libxc
has to provide a valid FPU context when setting the CPU registers.

This was a stop-gap measure in order to unblock OSSTest Windows 7 failures
while a proper fix for the HVM CPU save/restore is being worked on.

This can now be reverted because a proper fix is in place and we can signal
in the save record whether the FPU is initialized or not.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agox86/xsave: simplify xcomp_bv initialization
Jan Beulich [Thu, 14 Jan 2016 09:42:53 +0000 (10:42 +0100)]
x86/xsave: simplify xcomp_bv initialization

This simplifies a number of pointless conditionals: Bits 0 and 1 of
xcomp_bv don't matter anyway, and as long as none of bits 2..62 are
set, setting bit 63 is pointless too unless XSAVES is in use.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
9 years agox86/hvm: introduce a flags field in the CPU save record
Roger Pau Monné [Thu, 14 Jan 2016 09:37:53 +0000 (10:37 +0100)]
x86/hvm: introduce a flags field in the CPU save record

Introduce a new flags field and use bit 0 to signal if the FPU has been
initialised or not. Previously Xen always wrongly assumed the FPU was
initialised on restore.

While modifying the FPU restore part of hvm_load_cpu_ctxt remove the
memcpy branching, since v->arch.fpu_ctxt will always point to the right
area for hosts with XSAVE or without it.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
9 years agobuild: convert NR_CPUS to Kconfig
Doug Goldstein [Thu, 14 Jan 2016 09:36:40 +0000 (10:36 +0100)]
build: convert NR_CPUS to Kconfig

Use CONFIG_NR_CPUS from Kconfig as NR_CPUS instead of the previous
MAX_PHYS_CPUS variable from make. Remove the creation of MAX_PHYS_CPUS
as well.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
9 years agobuild: introduce CONFIG_NR_CPUS in Kconfig
Doug Goldstein [Thu, 14 Jan 2016 09:34:27 +0000 (10:34 +0100)]
build: introduce CONFIG_NR_CPUS in Kconfig

Introduce an option where the user can modifiy the maximum number of
supported physical CPUs.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
9 years agox86/HVM: prune error labels in do_hvm_op()
Jan Beulich [Thu, 14 Jan 2016 09:33:39 +0000 (10:33 +0100)]
x86/HVM: prune error labels in do_hvm_op()

I've got repeatedly annoyed by the bad naming: Make them slightly
better recognizable (and less likely to get mixed up), except in cases
where they can be eliminated altogether.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
9 years agox86emul: support clzero
Jan Beulich [Thu, 14 Jan 2016 09:32:35 +0000 (10:32 +0100)]
x86emul: support clzero

... in anticipation of this possibly going to get used by guests for
basic thinks like memset() or clearing or pages.

Since the emulation doesn't use clzero itself, checking the guest's
CPUID for the feature to be exposed is (intentionally) being avoided
here. All that's required is sensible guest side data for the clflush
line size.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
9 years agoconvert XSM_ENABLE to Kconfig
Doug Goldstein [Tue, 12 Jan 2016 10:39:47 +0000 (11:39 +0100)]
convert XSM_ENABLE to Kconfig

Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
CONFIG_XSM.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agoconvert FLASK_ENABLE to Kconfig
Doug Goldstein [Tue, 12 Jan 2016 10:36:33 +0000 (11:36 +0100)]
convert FLASK_ENABLE to Kconfig

Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
is converted to Kconfig.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agobuild: save generated xen .config
Doug Goldstein [Tue, 12 Jan 2016 10:33:55 +0000 (11:33 +0100)]
build: save generated xen .config

Since we now support changing Xen options with Kconfig, we should save
the configuration that was used to build up Xen. This will save it in
/usr/lib/debug alongside xen-syms and call it xen-$(FULLVERSION).config

Suggested-by: Ian Campbell <ian.campbell@citrix.com>
Requested-by: Jan Beulich <jbeulich@suse.com> # the directory
Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
9 years agox86/VPMU: implement ipc and arch filter flags
Brendan Gregg [Tue, 12 Jan 2016 10:33:16 +0000 (11:33 +0100)]
x86/VPMU: implement ipc and arch filter flags

This introduces a way to have a restricted VPMU, by specifying one of two
predefined groups of PMCs to make available. For secure environments, this
allows the VPMU to be used without needing to enable all PMCs.

Signed-off-by: Brendan Gregg <bgregg@netflix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
9 years agoadd xenstore domain flag to hypervisor
Juergen Gross [Tue, 12 Jan 2016 10:29:55 +0000 (11:29 +0100)]
add xenstore domain flag to hypervisor

In order to be able to have full support of a xenstore domain in Xen
add a "Xenstore-domain" flag to the hypervisor. This flag must be
specified at domain creation time and is returned by
XEN_DOMCTL_getdomaininfo.

It will allow the domain to retrieve domain information by issuing the
XEN_DOMCTL_getdomaininfo itself in order to be able to check for
domains having been destroyed. At the same time this flag will inhibit
the domain to be migrated, as this wouldn't be a very wise thing to do.

In case of a later support of a rebootable Dom0 this flag will allow to
recognize a xenstore domain already being present to connect to.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Andrew Cooper <andrew.cooper3@citirx.com>
9 years agox86/hvm: add support for pcommit instruction
Haozhong Zhang [Tue, 12 Jan 2016 10:29:25 +0000 (11:29 +0100)]
x86/hvm: add support for pcommit instruction

Pass PCOMMIT CPU feature into HVM domain. Currently, we do not intercept
pcommit instruction for L1 guest, and allow L1 to intercept pcommit
instruction for L2 guest.

The specification of pcommit instruction can be found in
https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
9 years agox86/hvm: allow guest to use clflushopt and clwb
Haozhong Zhang [Tue, 12 Jan 2016 10:28:58 +0000 (11:28 +0100)]
x86/hvm: allow guest to use clflushopt and clwb

Pass CPU features CLFLUSHOPT and CLWB into HVM domain so that those two
instructions can be used by guest.

The specification of above two instructions can be found in
https://software.intel.com/sites/default/files/managed/0d/53/319433-022.pdf

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Wei Liu <wei.liu2@citrix.com> for tools bits
9 years agox86: convert bigmem to Kconfig
Doug Goldstein [Tue, 12 Jan 2016 10:27:49 +0000 (11:27 +0100)]
x86: convert bigmem to Kconfig

Convert the bigmem build option to Kconfig.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
9 years agoRevert "convert FLASK_ENABLE to Kconfig"
Jan Beulich [Fri, 8 Jan 2016 16:35:30 +0000 (17:35 +0100)]
Revert "convert FLASK_ENABLE to Kconfig"

This reverts commit b36bf230270baba4f0fe35b230ea8b80ebb2c4a7,
as osstest needs to be ready first.

9 years agoRevert "convert XSM_ENABLE to Kconfig"
Jan Beulich [Fri, 8 Jan 2016 16:34:53 +0000 (17:34 +0100)]
Revert "convert XSM_ENABLE to Kconfig"

This reverts commit 2b2ab5d88b2d2ab0155101a0a6922025064061af,
as osstest needs to be ready first.

9 years agoRevert "fix missing XSM_ENABLE change"
Jan Beulich [Fri, 8 Jan 2016 16:34:16 +0000 (17:34 +0100)]
Revert "fix missing XSM_ENABLE change"

This reverts commit 9754544a55d3a290e3198c36198e66d059033a38,
as the one it fixes needs reverting.

9 years agotools/libxc: Adjust error handling in map_p2m_list() to fix CentOS 7 build
Andrew Cooper [Fri, 8 Jan 2016 14:38:03 +0000 (14:38 +0000)]
tools/libxc: Adjust error handling in map_p2m_list() to fix CentOS 7 build

The "goto err;" for malloc() error handling would cause the cleanup code
to use 'ptes' before it had been initialised, and causing a build
failure because of -Werror=maybe-uninitialised.

Use "goto err;" consistently for all error handling.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agox86/time: use correct guest TSC frequency in tsc_get_info()
Haozhong Zhang [Fri, 8 Jan 2016 09:48:29 +0000 (10:48 +0100)]
x86/time: use correct guest TSC frequency in tsc_get_info()

When the TSC mode of a HVM container is TSC_MODE_DEFAULT or
TSC_MODE_PVRDTSCP and no TSC emulation is used, the existing
tsc_get_info() uses the host TSC frequency (cpu_khz) as the guest TSC
frequency. However, tsc_set_info() may set the guest TSC frequency to a
value different than the host. In order to keep consistent to
tsc_set_info(), this patch makes tsc_get_info() use the value set by
tsc_set_info() as the guest TSC frequency.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
9 years agox86/time: use correct guest TSC frequency in tsc_set_info()
Haozhong Zhang [Fri, 8 Jan 2016 09:48:10 +0000 (10:48 +0100)]
x86/time: use correct guest TSC frequency in tsc_set_info()

When TSC_MODE_PVRDTSCP is used for a HVM container and TSC scaling is
available, use the non-zero value of argument gtsc_khz of tsc_set_info()
as the guest TSC frequency rather than using the host TSC
frequency. Otherwise, TSC scaling will not be able get the correct ratio
between the host and guest TSC frequencies.

Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
9 years agofix missing XSM_ENABLE change
Doug Goldstein [Fri, 8 Jan 2016 09:46:47 +0000 (10:46 +0100)]
fix missing XSM_ENABLE change

This is broken from "xen: convert XSM_ENABLE to Kconfig"
6d5293032f5fc1c65f7a73548afaa3caa8e0105a. This hunk was dropped when I
made my v2 for some reason.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agoACPICA: ACPI 6.0: Add support for STAO table
Bob Moore [Thu, 7 Jan 2016 16:35:27 +0000 (17:35 +0100)]
ACPICA: ACPI 6.0: Add support for STAO table

Link: https://github.com/acpica/acpica/commit/532bf402
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit 37e12657f8922ebc62f696494c56c81db509053e]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPICA: Headers: Add GTDT flag definitions for the timer subtable
Hanjun Guo [Thu, 7 Jan 2016 16:35:08 +0000 (17:35 +0100)]
ACPICA: Headers: Add GTDT flag definitions for the timer subtable

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit 34ea065e5e607dcbb249046c42a491f8b24ad849]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agoACPICA/ARM: ACPI 5.1: Update for GTDT table changes
Tomasz Nowicki [Thu, 7 Jan 2016 16:34:50 +0000 (17:34 +0100)]
ACPICA/ARM: ACPI 5.1: Update for GTDT table changes

New fields and new subtables. Tomasz Nowicki.

Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit 54ea4247d389059674aaacad7af224459b135fb9]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPICA/ARM: ACPI 5.1: Update for FADT changes
Graeme Gregory [Thu, 7 Jan 2016 16:34:32 +0000 (17:34 +0100)]
ACPICA/ARM: ACPI 5.1: Update for FADT changes

Adds ARM flags and FADT minor revision. Graeme Gregory.

Signed-off-by: Graeme Gregory <graeme.gregory@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit 9eb1105babb8948c402ff785f5b43e35f79c0a0c]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPICA: ACPI 6.0: Add values for MADT GIC version field
Hanjun Guo [Thu, 7 Jan 2016 16:34:13 +0000 (17:34 +0100)]
ACPICA: ACPI 6.0: Add values for MADT GIC version field

ACPICA commit 4b100dc43e8baee8c8b4891b23bc7ad03eba6a28

Support for the new version field in the generic distributor
subtable. Hanjun Guo <hanjun.guo@linaro.org>

Link: https://github.com/acpica/acpica/commit/4b100dc4
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit a8bd0f07eb594df51845d33f272fb1952fec1a6f]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPICA: ACPI 6.0: Add changes for MADT table
Bob Moore [Thu, 7 Jan 2016 16:33:55 +0000 (17:33 +0100)]
ACPICA: ACPI 6.0: Add changes for MADT table

ACPICA commit 02cbb41232bccf7a91967140cab95d5f48291f21

New subtable type. Some additions to existing subtables.

Link: https://github.com/acpica/acpica/commit/02cbb412
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit 0cff8dc0099f6d4f7431181918b37a472bcd1bbb]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPICA/ARM: ACPI 5.1: Update for MADT changes
Tomasz Nowicki [Thu, 7 Jan 2016 16:33:31 +0000 (17:33 +0100)]
ACPICA/ARM: ACPI 5.1: Update for MADT changes

New subtables and changes to other subtables. Tomasz Nowicki.

Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[Linux commit d0c383e48d1b6cdc39cf9cc2f082bbb6f3c28b89]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
9 years agoACPI 5.0: Add new/changed tables to headers
Bob Moore [Thu, 7 Jan 2016 16:33:09 +0000 (17:33 +0100)]
ACPI 5.0: Add new/changed tables to headers

Adds new file, actbl3.h

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
[Linux commit c5bd6537329e66a8b36234f19a36d94b72d07394]
[only port changes of Generic Interrupt and Generic Distributor, other
changes already exist]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
9 years agopublic/io/netif.h: document transmit and receive wire formats separately
Paul Durrant [Thu, 7 Jan 2016 14:28:33 +0000 (15:28 +0100)]
public/io/netif.h: document transmit and receive wire formats separately

Currently there is no documented wire format for guest receive-side
packets but the location of the 'wire format' comment block suggests
it is the same as transmit-side. This is almost true but there is a
subtle difference in the use of the 'size' field for the first fragment.

For clarity this patch creates separate comment blocks for receive
and transmit side packet wire formats, tries to be more clear about the
distinction between 'fragments' and 'extras', and documents the subtlety
concerning the size field of the first fragment.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
9 years agocredit: remove pointless local variable initialization
Joshua Otto [Thu, 7 Jan 2016 14:28:08 +0000 (15:28 +0100)]
credit: remove pointless local variable initialization

Coverity CID 1343301

No functional changes.

Signed-off-by: Joshua Otto <jtotto@uwaterloo.ca>
9 years agoremove dups in x86 and x86_64 variables
Doug Goldstein [Thu, 7 Jan 2016 14:27:43 +0000 (15:27 +0100)]
remove dups in x86 and x86_64 variables

Currently the Xen build uses x86 and x86_64 variables as well as
CONFIG_X86 and CONFIG_X86_64. This just removes the duplication. The
CONFIG_ variables are now managed by Kconfig but existed previously so
this duplication existed prior to the Kconfig migration.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Feng Wu <feng.wu@intel.com>
$(CONFIG_X86_64) -> y in x86 makefiles.
$(CONFIG_X86_64) -> $(CONFIG_X86) in non-x86 makefiles.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
9 years agox86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE
Boris Ostrovsky [Thu, 7 Jan 2016 14:27:16 +0000 (15:27 +0100)]
x86/VPMU: don't allow any non-zero writes to MSR_IA32_PEBS_ENABLE

Calculation reserved bits for MSR_IA32_PEBS_ENABLE is model-dependent
and since we don't support PEBS anyway we shouldn't allow any writes to
it (but let's still permit guests wishing to disable PEBS).

We should also report PEBS as unsupported to HVM, just like we do on PV.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
9 years agox86/VPMU: check more carefully which bits are allowed to be written to MSRs
Boris Ostrovsky [Thu, 7 Jan 2016 14:26:37 +0000 (15:26 +0100)]
x86/VPMU: check more carefully which bits are allowed to be written to MSRs

Current Intel VPMU emulation needs to perform more checks when writing
PMU MSRs on guest's behalf:
* MSR_CORE_PERF_GLOBAL_CTRL is not checked at all
* MSR_CORE_PERF_FIXED_CTR_CTRL has more reserved bits in PMU version 2
* MSR_CORE_PERF_GLOBAL_OVF_CTRL's bit 61 is allowed on versions greater
* than 2.

We can also use precomputed mask in core2_vpmu_do_interrupt().

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
9 years agoconvert XSM_ENABLE to Kconfig
Doug Goldstein [Thu, 7 Jan 2016 14:25:58 +0000 (15:25 +0100)]
convert XSM_ENABLE to Kconfig

Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
CONFIG_XSM.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agoconvert FLASK_ENABLE to Kconfig
Doug Goldstein [Thu, 7 Jan 2016 14:18:45 +0000 (15:18 +0100)]
convert FLASK_ENABLE to Kconfig

Converts the Config.mk option of FLASK_ENABLE into a Kconfig option for
the hypervisor called CONFIG_FLASK. This commit knowingly breaks the
dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE
is converted to Kconfig.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
9 years agox86: misc printk() adjustments
Jan Beulich [Thu, 7 Jan 2016 14:15:01 +0000 (15:15 +0100)]
x86: misc printk() adjustments

- a missing newline
- missing log levels (in Dom0-only messages)
- one dprintk() -> printk() conversion

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
9 years agoxen/arm: ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN
Stefano Stabellini [Wed, 6 Jan 2016 17:21:25 +0000 (17:21 +0000)]
xen/arm: ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN

Injecting a fault to the guest just because it is writing to one of the
GICD_ICACTIVER registers, which are part of the GICv2 and GICv3 specs,
is harsh. Additionally it causes recent linux kernels to fail to boot on
Xen.

Ignore writes to GICD_ICACTIVER ... GICD_ICACTIVERN instead, to solve
the boot issue and for backportability. However implementing the
registers properly might a better long term solution.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: add distclean target to libs/toollog Makefile
Juergen Gross [Thu, 7 Jan 2016 08:25:01 +0000 (09:25 +0100)]
tools: add distclean target to libs/toollog Makefile

The new logging library Makefile doesn't support the distclean target.
Add it.

Also remove all created shared library versions via the clean target.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agostubdom: remove mini-os when doing make distclean
Juergen Gross [Thu, 7 Jan 2016 08:53:16 +0000 (09:53 +0100)]
stubdom: remove mini-os when doing make distclean

make distclean does not remove mini-os. Do so when cleaning stubdom.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxc: Don't write terminating NULL character to command string
Boris Ostrovsky [Wed, 6 Jan 2016 20:03:21 +0000 (15:03 -0500)]
libxc: Don't write terminating NULL character to command string

When copying boot command string for HVMlite guests we explicitly write
'\0' at MAX_GUEST_CMDLINE offset. Unless the string is close to
MAX_GUEST_CMDLINE in length this write will end up in the wrong place,
beyond the end of the mapped range.

We don't need to limit the size of command string to some arbitrary
number. Any size that can be successfully allocated and mapped is valid
and so the string is guaranteed to be NULL-terminated (since we use
strlen, which needs terminating '\0', to calculate allocation size).

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agolibxc: set flag for support of linear p2m list in domain builder
Juergen Gross [Thu, 7 Jan 2016 12:36:54 +0000 (13:36 +0100)]
libxc: set flag for support of linear p2m list in domain builder

Set the SIF_VIRT_P2M_4TOOLS flag for pv-domUs in the domain builder
to indicate the Xen tools have full support for the virtual mapped
linear p2m list.

This will enable pv-domUs to drop support of the 3 level p2m tree
and use the linear list only. Without setting this flag some kernels
might limit themselves to 512 GB memory size in order not to break
migration.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agolibxc: stop migration in case of p2m list structural changes
Juergen Gross [Thu, 7 Jan 2016 12:36:53 +0000 (13:36 +0100)]
libxc: stop migration in case of p2m list structural changes

With support of the virtual mapped linear p2m list for migration it is
now possible to detect structural changes of the p2m list which before
would either lead to a crashing or otherwise wrong behaving domU.

A guest supporting the linear p2m list will increment the
p2m_generation counter located in the shared info page before and after
each modification of a mapping related to the p2m list. A change of
that counter can be detected by the tools and reacted upon.

As such a change should occur only very rarely once the domU is up the
most simple reaction is to cancel migration in such an event.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
9 years agolibxc: support of linear p2m list for migration of pv-domains
Juergen Gross [Thu, 7 Jan 2016 12:36:52 +0000 (13:36 +0100)]
libxc: support of linear p2m list for migration of pv-domains

In order to be able to migrate pv-domains with more than 512 GB of RAM
the p2m information can be specified by the guest kernel via a virtual
mapped linear p2m list instead of a 3 level tree.

Add support for this new p2m format in libxc.

As the sanity checking of the virtual p2m address needs defines for the
xen regions use those defines when doing page table checks as well.
There were two harmless off by one errors in normalise_pagetable()
being fixed by using those defines (xen_last set to 512 instead of
511), the other one is fixed directly.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
9 years agolibxc: split mapping p2m leaves into a separate function
Juergen Gross [Thu, 7 Jan 2016 12:36:51 +0000 (13:36 +0100)]
libxc: split mapping p2m leaves into a separate function

In order to prepare using the virtual mapped linear p2m list for
migration split mapping of the p2m leaf pages into a separate function.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
9 years agoxen/arm: vtimer: Introduce vtimer_emulate_sysreg{32, 64}
Julien Grall [Fri, 11 Dec 2015 15:28:22 +0000 (15:28 +0000)]
xen/arm: vtimer: Introduce vtimer_emulate_sysreg{32, 64}

Factorize the code to emulate a a 32-bit/64-bit sysreg in specific
helpers.

While this is currently not necessary, it will be helpful in a following
patch to handle properly some registers.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxen/arm64: Document the register mapping aarch64 <-> aarch32
Julien Grall [Fri, 11 Dec 2015 15:28:21 +0000 (15:28 +0000)]
xen/arm64: Document the register mapping aarch64 <-> aarch32

The mapping between aarch64 and aarch32 has not been chosen in random.
It's based on D1.20.1 in ARM DDI 0487A.d.

The section is not obvious to find in the spec, so make it clear for the
anyone else.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxen/arm: io: handle_read: Use a local variable to store dabt
Julien Grall [Fri, 11 Dec 2015 15:28:20 +0000 (15:28 +0000)]
xen/arm: io: handle_read: Use a local variable to store dabt

Rather than getting dabt every time through info->dabt, introduce a
local variable and use it.

Also fix a coding style error in the if condition.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoxen/arm: vgic: Clarify some comments after 5d495f4
Julien Grall [Thu, 17 Dec 2015 17:29:10 +0000 (17:29 +0000)]
xen/arm: vgic: Clarify some comments after 5d495f4

Ian pointed out that the definition of "offset" and "appropriate
boundary" in the comments added by "xen/arm: vgic: Optimize the way to
store the target vCPU in the rank" were not cleared.

Clarify them by explicitly mentionning the offset is in byte and the
appropriate boundary is ITARGET<n>/IROUTER<n>

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agotools: Refactor "xentoollog" into its own library
Ian Campbell [Wed, 16 Dec 2015 12:31:09 +0000 (12:31 +0000)]
tools: Refactor "xentoollog" into its own library

In attempting to disaggregate libxenctrl I found that many of the
pieces were going to want access to this library, so split it out (as
it probably should always have been).

Various build adjustments are needed. In particular things which use
xtl_* themselves now need to explicity link against the library.

This has a nice side effect which is that users of libxl no longer
need to link against libxenctrl just to create a logger, which was
counter to the principal that applications using libxl shouldn't be
required to look behind the curtain. This means that xl no longer
links against libxenctrl.

The new library uses a version script to ensure that only expected
symbols are exported and to version them such that ABI guarantees can
be kept in the future.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
[ ijc -- dropped QEMU_TRADITIONAL_REVISION update, this had since
         progressed to 569eac99e8dd which is after 9fad9ed28583, the
         commit needed here. ]

9 years agostubdom: recurse into tools/include in mk-headers-$(XEN_TARGET_ARCH) rule
Ian Campbell [Wed, 16 Dec 2015 12:31:08 +0000 (12:31 +0000)]
stubdom: recurse into tools/include in mk-headers-$(XEN_TARGET_ARCH) rule

... rather than in the libxc rule.

This puts all the header dependencies in one place and will allow us
to avoid races when more libraries which need these headers are
introduced. I observed issues with the xen-foreign/tmp.size file
getting deleted in parallel with another process trying to use it.

The mini-os links are already created in the
mk-headers-$(XEN_TARGET_ARCH) target so the other places which do so
are redundant, in the case of polarssl and vtpmmgr indirectly through
their eventual dependency on newlib which in turn depends on
mk-headers-$(XEN_TARGET_ARCH).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Cc: samuel.thibault@ens-lyon.org
9 years agotools: allow configure time choice of libexec subdirectory.
Ian Campbell [Wed, 16 Dec 2015 15:06:35 +0000 (15:06 +0000)]
tools: allow configure time choice of libexec subdirectory.

Currently we hardcode various paths such as $libexec/xen/{bin,boot},
however some downstreams (notably Debian) would like instead to
install things into $libexec/xen-X.Y/{bin,boot} as part of allowing
multiple versions of the tools packages to be installed.

Since this currently involves patching configure its a bit fiddly,
provide a configure option for the leaf dir instead, name it
--with-libexec-leaf-dir similar to the existing
--with-sysconfig-leaf-dir.

Rather than have the determination of the full path in both configure
and config/Paths.mk.in move it into configure only. Also for
consistency move the other LIBEXEC_* to configure, even though they
are only substituted into Paths.mk.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: 805508@bugs.debian.org
[ ijc -- removed stray ` ]

9 years agox86/vmx: Fix injection of #DB traps following XSA-156
Andrew Cooper [Mon, 4 Jan 2016 09:59:38 +0000 (09:59 +0000)]
x86/vmx: Fix injection of #DB traps following XSA-156

Most #DB exceptions are traps rather than faults, meaning that the instruction
pointer in the exception frame points after the instruction rather than at it.

However, VMX intercepts all have fault semantics, even when intercepting a
trap.  Re-injecting an intercepted trap as a fault causes an infinite loop in
the guest, by re-executing the same trapping instruction repeatedly.  This
breaks debugging inside the guest.

Introduce a helper which copies VM_EXIT_INTR_INTO to VM_ENTRY_INTR_INFO, and
use it to mirror the intercepted interrupt back to the guest.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
9 years agolibxl: Fix doc comment ref to DOMAIN_DEATH
Ian Jackson [Mon, 4 Jan 2016 15:13:14 +0000 (15:13 +0000)]
libxl: Fix doc comment ref to DOMAIN_DEATH

The doc comment for libxl_evdisable_domain_death mistakenly referred
to DOMAIN_DESTROY but the event type name is actually DOMAIN_DEATH.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
9 years agoQEMU_TAG update
Ian Jackson [Mon, 4 Jan 2016 15:35:25 +0000 (15:35 +0000)]
QEMU_TAG update

9 years agoIOMMU: unhide messages useful for diagnostics
Jan Beulich [Tue, 22 Dec 2015 09:12:14 +0000 (10:12 +0100)]
IOMMU: unhide messages useful for diagnostics

Undue use of dprintk() lead to many messages useful in diagnosing
issues in the field now being hidden in non-debug (i.e. production)
builds. Re-surface them.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
9 years agoVT-d: unhide messages needed for diagnosing firmware issues
Jan Beulich [Tue, 22 Dec 2015 09:11:44 +0000 (10:11 +0100)]
VT-d: unhide messages needed for diagnosing firmware issues

Undue use of dprintk() lead to many messages useful in diagnosing
issues in the field now being hidden in non-debug (i.e. production)
builds. Re-surface them, namely when init-time only and/or already
guarded by iommu_{verbose,debug} conditionals. Switch from using
iommu_verbose to iommu_debug in a couple of runtime cases.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Feng Wu <feng.wu@intel.com>
9 years agox86/mmuext: unify okay/rc error handling in do_mmuext_op()
Andrew Cooper [Tue, 22 Dec 2015 09:10:44 +0000 (10:10 +0100)]
x86/mmuext: unify okay/rc error handling in do_mmuext_op()

c/s 506db90 "x86/HVM: merge HVM and PVH hypercall tables" introduced a path
whereby 'okay' was used uninitialised, with broke compilation on CentOS 7.

Splitting the error handling like this is fragile and unnecessary.  Drop the
okay variable entirely and just use rc directly, substituting rc = -EINVAL/0
for okay = 0/1.

In addition, two error messages are updated to print rc, and some stray
whitespace is dropped.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Make setting of rc happen consistently after MEM_LOG(), if that is being
used.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
9 years agoget-fields.sh: use printf for POSIX compat
Alex Xu [Mon, 21 Dec 2015 16:11:17 +0000 (17:11 +0100)]
get-fields.sh: use printf for POSIX compat

xen/tools/get-fields.sh used echo -n which is not POSIX compatible and
breaks building with dash (shell). Change it to use printf %s which is
usable everywhere.

Signed-off-by: Alex Xu <alex_y_xu@yahoo.ca>
9 years agoarm: add missing newlines to printk()s
Jan Beulich [Mon, 21 Dec 2015 16:10:09 +0000 (17:10 +0100)]
arm: add missing newlines to printk()s

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>