]> xenbits.xensource.com Git - xen.git/log
xen.git
13 years agoxenpaging: clear page content after evict
Olaf Hering [Tue, 11 Oct 2011 09:46:28 +0000 (10:46 +0100)]
xenpaging: clear page content after evict

If the guest happens to read from the gfn while xenpaging is in the process of
evicting the page, the guest may read zeros instead of actual data.
Also if eviction fails the page content will be corrupted and xenpaging wont
attempt to restore the page.

Remove page scrubbing from pager and do it after successful eviction.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agotools/check: check for yajl (needed by libxl)
Ian Campbell [Mon, 10 Oct 2011 15:49:48 +0000 (16:49 +0100)]
tools/check: check for yajl (needed by libxl)

We need precisely version 1 so check for .so.1. In the future we should handle
yajl v2 as well.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agotools/ocaml: Small improvement to the ocaml xenctrl library
Jon Ludlam [Mon, 10 Oct 2011 15:41:17 +0000 (16:41 +0100)]
tools/ocaml: Small improvement to the ocaml xenctrl library

Add a new field 'max_nr_cpus' to the physinfo type in the ocaml xc bindings

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
13 years agotools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one

The bit bugs are in ocaml vcpu affinity calls, and the off-by-one
error is in the ocaml console ring code

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
13 years agotools/ocaml: Remove log library from tools/ocaml/libs
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Remove log library from tools/ocaml/libs

The only user was oxenstored, which has had the relevant bits
merged in.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
13 years agotools/ocaml: Remove the uuid library
Jon Ludlam [Mon, 10 Oct 2011 15:41:16 +0000 (16:41 +0100)]
tools/ocaml: Remove the uuid library

The library was only minimally used, and was really rather redundant.

Signed-off-by: Zheng Li <zheng.li@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
13 years agotools/ocaml: Add a missing dependency to the xenctrl ocaml package
Jon Ludlam [Mon, 10 Oct 2011 15:38:08 +0000 (16:38 +0100)]
tools/ocaml: Add a missing dependency to the xenctrl ocaml package

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
13 years agotools/ocaml: Rename the ocaml libraries
Jon Ludlam [Mon, 10 Oct 2011 15:37:07 +0000 (16:37 +0100)]
tools/ocaml: Rename the ocaml libraries

ocamlfind does not support namespaces, so to avoid
name clashes the module names have become longer.
Additionally, the xenstore and xenbus subdirs, which
contain several modules each, have been packed into
toplevel Xenstore and Xenbus modules.

xb becomes xenbus, xc becomes xenctrl, xl becomes xenlight,
xs becomes xenstore, eventchn becomes xeneventchn and
mmap becomes xenmmap.

[ Patch modified from that submitted, to update the .hgignore, and to
  cope with intervening changes to mmap_stubs.c -iwj ]

Signed-off-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: correctly parse disk "backendtype" field
Daniel De Graaf [Mon, 10 Oct 2011 10:21:51 +0000 (11:21 +0100)]
libxl: correctly parse disk "backendtype" field

The expression for backendtype was missing a comma.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agox86/AMD: Remove AMD_ERRATUM_400 definition
Boris Ostrovsky [Mon, 10 Oct 2011 08:09:17 +0000 (10:09 +0200)]
x86/AMD: Remove AMD_ERRATUM_400 definition

AMD_ERRATUM_400 was used to determine whether the processor supports
Always Running APIC Counter (ARAT) feature in init_amd(). Now that
ARAT support is based solely on family number this macro is no longer
needed.

Keep it in comments section as an example in case we ever need to use
it for somethnig else.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
13 years agopassthrough: update bus2bridge mapping as PCI devices get added/removed
Jan Beulich [Mon, 10 Oct 2011 07:21:32 +0000 (09:21 +0200)]
passthrough: update bus2bridge mapping as PCI devices get added/removed

This deals with two limitations at once: On device removal, the
mapping did not get updated so far at all, and hotplugged devices as
well as such not discoverable by Xen's initial bus scan (including the
case where a non-zero PCI segment wasn't accessible during Xen boot,
but became accessible after Dom0 validated access information against
ACPI data) wouldn't cause updates to the mapping either.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Kay, Allen M" <allen.m.kay@intel.com>
13 years agoAdjust 23931:6a9466e1753d.
Jan Beulich [Fri, 7 Oct 2011 15:57:07 +0000 (17:57 +0200)]
Adjust 23931:6a9466e1753d.

Committed a stale patch - this was missing from what was actually acked.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoVT-d: don't reject possibly valid DRHD or RMRR
Jan Beulich [Fri, 7 Oct 2011 15:50:50 +0000 (17:50 +0200)]
VT-d: don't reject possibly valid DRHD or RMRR

If a non-zero PCI segment isn't accessible during Xen boot (because
firmware decided to not enter the necessary MMIO space into the E820
table), devices referred to on those segments through DRHD or RMRR
structures should not be rejected just because the devices can't be
found.

This is in line with what is being done in at least one other case
already: Systems with more than one PCI segment (usually high end
ones) are assumed to have valid firmware provided data, while systems
with just segment 0 continue to have their firmware tables validated.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Kay, Allen M" <allen.m.kay@intel.com>
13 years agotools/check: remove check_logging
Olaf Hering [Fri, 7 Oct 2011 13:33:15 +0000 (14:33 +0100)]
tools/check: remove check_logging

Remove tools/check/check_logging.  Python 2.3 is the minimal required
python version so the checked function is available anyway.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agotools/check: update python version check
Olaf Hering [Fri, 7 Oct 2011 13:32:36 +0000 (14:32 +0100)]
tools/check: update python version check

Python 2.3 is the minimal version according to the README.
Adjust check script.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibvchan: remove erroneously-committed libvchan-node[12]; add them to .hgignore
Ian Jackson [Fri, 7 Oct 2011 09:47:04 +0000 (10:47 +0100)]
libvchan: remove erroneously-committed libvchan-node[12]; add them to .hgignore

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoConfig.mk: error out on non-absolute $(XEN_ROOT)
Ian Campbell [Fri, 7 Oct 2011 08:35:31 +0000 (09:35 +0100)]
Config.mk: error out on non-absolute $(XEN_ROOT)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agotools/libfsimage: Avoid relative XEN_ROOT specification
Juergen Gross [Fri, 7 Oct 2011 08:35:12 +0000 (09:35 +0100)]
tools/libfsimage: Avoid relative XEN_ROOT specification

XEN_ROOT must be set to an absolute path to avoid out of the tree
references

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agox86/AMD: Do not enable ARAT feature on AMD processors below family 0x12
Boris Ostrovsky [Fri, 7 Oct 2011 08:32:15 +0000 (10:32 +0200)]
x86/AMD: Do not enable ARAT feature on AMD processors below family 0x12

Determining whether an AMD processor is affected by erratum 400 may
have some corner cases and handling these cases is somewhat complicated.
In the interest of simplicity we won't claim ARAT support on processor
families below 0x12.

Mirrors Linux commit e9cdd343a5e42c43bcda01e609fa23089e026470

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
13 years agolibvchan: interdomain communications library
Daniel De Graaf [Thu, 6 Oct 2011 18:44:40 +0000 (19:44 +0100)]
libvchan: interdomain communications library

This library implements a bidirectional communication interface between
applications in different domains, similar to unix sockets. Data can be
sent using the byte-oriented libvchan_read/libvchan_write or the
packet-oriented libvchan_recv/libvchan_send.

Channel setup is done using a client-server model; domain IDs and a port
number must be negotiated prior to initialization. The server allocates
memory for the shared pages and determines the sizes of the
communication rings (which may span multiple pages, although the default
places rings and control within a single page).

With properly sized rings, testing has shown that this interface
provides speed comparable to pipes within a single Linux domain; it is
significantly faster than network-based communication.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxc: add xc_gntshr_* functions
Daniel De Graaf [Thu, 6 Oct 2011 18:38:01 +0000 (19:38 +0100)]
libxc: add xc_gntshr_* functions

These functions and the xc_gntshr device (/dev/xen/gntalloc on linux)
allow applications to create pages shared with other domains.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxc: add xc_gnttab_map_grant_ref_notify
Daniel De Graaf [Thu, 6 Oct 2011 18:28:53 +0000 (19:28 +0100)]
libxc: add xc_gnttab_map_grant_ref_notify

Normally, when a userspace process mapping a grant crashes, the domain
providing the reference receives no indication that its peer has
crashed, possibly leading to unexpected freezes or timeouts. This
function provides a notification of the unmap by signalling an event
channel and/or clearing a specific byte in the page.

This also unifies the 3 very similar grant-mapping osdep interfaces into
a single function instead of introducing yet another minor variation.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agotools build: link to specific library version (libxs, libxl, xenstore, xenstat)
Roger Pau Monne [Thu, 6 Oct 2011 18:11:51 +0000 (19:11 +0100)]
tools build: link to specific library version (libxs, libxl, xenstore, xenstat)

To avoid linking to unexpected copies (eg wrong versions) of xen
libraries, explicitly pass the linker the library file to link to.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: fix libxl_mac_to_device_nic
Ian Campbell [Thu, 6 Oct 2011 17:50:22 +0000 (18:50 +0100)]
libxl: fix libxl_mac_to_device_nic

I think I broke this back in 22041:4c9ef5ec9146, using i as both the inner and
outer loop iterator.

I've added libxl__compare_macs which helps keep things clean.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: add and use parse_mac helper function
Ian Campbell [Thu, 6 Oct 2011 17:49:41 +0000 (18:49 +0100)]
libxl: add and use parse_mac helper function

rather than open coding a bunch it a bunch of times.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoQEMU_TAG update
Ian Jackson [Thu, 6 Oct 2011 17:43:03 +0000 (18:43 +0100)]
QEMU_TAG update

13 years agotools: ocaml: Change GET_C_STRUCT to Intf_val to follow common naming scheme
Zheng Li [Thu, 6 Oct 2011 16:47:05 +0000 (17:47 +0100)]
tools: ocaml: Change GET_C_STRUCT to Intf_val to follow common naming scheme

Change GET_C_STRUCT to Intf_val to follow the common naming scheme of
OCaml macros, and for better readability.

Signed-off-by: Zheng Li <dev@zheng.li>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agotools: ocaml: Fix invalid memory access in OCaml mmap library
Zheng Li [Thu, 6 Oct 2011 16:45:43 +0000 (17:45 +0100)]
tools: ocaml: Fix invalid memory access in OCaml mmap library

Fix invalid memory access in OCaml mmap library (to play nicely with the GC)

This was a bug reported by Roberto Di Cosmo. When he tried to reuse
the mmap library for his own project, Mmap.read occasionally got
different result when reading from the same map. This turned out to be
a bug in the binding, where a C pointer was created pointing to a
OCaml value, and the OCaml value was subsequently moved around by the
GC after memory allocation and hence invalidated the C pointer. This
patch removes the indirection of C pointer and uses OCaml macro to
access values directly.

Only Mmap.read function had this problem. The other functions, despite
having the same code style, didn't have memory allocation involved
hence wouldn't intrigue such an error. I've changed all of them to the
safer style for future proof. Directly casting OCaml value's *data
block* (rather than the value itself) as a C pointer is not a common
practice either, but I'll leave it as it is.

The bug hadn't occured on XenServer because XenServer didn't make use
of the Mmap.read function (except in one place for debugging). In
XenServer, most mmap operations were going through another pair of
separately implemented functions (Xs_ring.read/write).

Signed-off-by: Zheng Li <dev@zheng.li>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: create pci backend only when there are pci devices.
Roger Pau Monne [Thu, 6 Oct 2011 16:26:18 +0000 (17:26 +0100)]
libxl: create pci backend only when there are pci devices.

Creating empty pci entries made Linux DomUs under NetBSD Dom0 wait a very long time for devices to initialize during kernel boot.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxenbackendd: fix incorrect usage of pidfile
Roger Pau Monne [Thu, 6 Oct 2011 16:24:36 +0000 (17:24 +0100)]
xenbackendd: fix incorrect usage of pidfile

Fix xenbackendd ignoring the pidfile passed through the command line.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: wrap help output if command name is too long
Ian Campbell [Thu, 6 Oct 2011 16:18:38 +0000 (17:18 +0100)]
xl: wrap help output if command name is too long

Without this in the "xl help" line for pci-list-assignable-devices the command
name merges with the first word of the help. Since the bash completion support
parses "xl help" this leads to "pci-list-assignable-devicesList" being
presented as an option instead of the correct command name.

We also need to filter out lines which start with more than one space in the
bash completion support to stop "List" appearing as a possible command name
after the change to wrap it.

Doesn't address the fact that some help text overflows 80 columns.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: probe disk backend type in libxl_device_disk_add
Ian Campbell [Thu, 6 Oct 2011 15:19:46 +0000 (16:19 +0100)]
libxl: probe disk backend type in libxl_device_disk_add

Without this "xl block-attach" does not work. On create do_domain_create already
catches this.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxlu: correctly parse disk "backendtype" field
Ian Campbell [Thu, 6 Oct 2011 15:19:03 +0000 (16:19 +0100)]
libxlu: correctly parse disk "backendtype" field

Currently it tries to parse the value from the full "backendtype=FOO" string
but really it needs to parse from the equals.

Before:
# xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
command line: config parsing error in disk specification: unknown value for backendtype: near `backendtype=phy' in `backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b'

After [in new syntax, not yet in this tree -iwj]:
# xl -N block-attach d32-1 backendtype=phy,vdev=xvdb,access=w,target=/dev/VG/debian-x86_32-1b
disk: {
    "backend_domid": 0,
    "pdev_path": "/dev/VG/debian-x86_32-1b",
    "vdev": "xvdb",
    "backend": "phy",
    "format": "raw",
    "script": null,
    "removable": 0,
    "readwrite": 1,
    "is_cdrom": 0
}

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: undo 23728:548b2826293e whitespace cleanup to autogenerated file
Ian Campbell [Thu, 6 Oct 2011 15:15:33 +0000 (16:15 +0100)]
libxl: undo 23728:548b2826293e whitespace cleanup to autogenerated file

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: add comments describing the internal memory allocation helpers
Ian Campbell [Thu, 6 Oct 2011 14:24:34 +0000 (15:24 +0100)]
libxl: add comments describing the internal memory allocation helpers

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agop2m: query/modify p2mt with p2m_lock held
Olaf Hering [Thu, 6 Oct 2011 13:15:43 +0000 (14:15 +0100)]
p2m: query/modify p2mt with p2m_lock held

Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agop2m: use correct p2m_type_t in clear_mmio_p2m_entry
Olaf Hering [Thu, 6 Oct 2011 11:52:18 +0000 (12:52 +0100)]
p2m: use correct p2m_type_t in clear_mmio_p2m_entry

clear_mmio_p2m_entry() should mark the gfn as invalid.
Use proper name instead of numerical value. The currently used value of
zero means p2m_ram_rw.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoxenpaging: remove confusing comment from p2m_mem_paging_populate
Olaf Hering [Thu, 6 Oct 2011 11:33:17 +0000 (12:33 +0100)]
xenpaging: remove confusing comment from p2m_mem_paging_populate

Currently there is no way to avoid the double check of the p2mt
because p2m_mem_paging_populate() is called from many places without
the p2m_lock held. Upcoming changes will move the function into
gfn_to_mfn(), so its interface could be changed and the extra
p2m_lock/get_entry can be removed.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoxenpaging: fix locking in p2m_mem_paging functions
Olaf Hering [Thu, 6 Oct 2011 11:33:17 +0000 (12:33 +0100)]
xenpaging: fix locking in p2m_mem_paging functions

As suggested by <hongkaixing@huawei.com>, query and adjust the p2mt
under the p2m_lock to prevent races with PoD.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoxenpaging: use p2m->get_entry() in p2m_mem_paging functions
Olaf Hering [Thu, 6 Oct 2011 11:33:17 +0000 (12:33 +0100)]
xenpaging: use p2m->get_entry() in p2m_mem_paging functions

Use p2m->get_entry() in the p2m_mem_paging functions. This preserves the
p2m_access type when gfn is updated with set_p2m_entry().
Its also a preparation for locking fixes in a subsequent patch.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agouse xzalloc in x86 code
Jan Beulich [Tue, 4 Oct 2011 12:18:30 +0000 (14:18 +0200)]
use xzalloc in x86 code

This includes the removal of a redundant memset() from microcode_amd.c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agouse xzalloc in driver code
Jan Beulich [Tue, 4 Oct 2011 12:17:28 +0000 (14:17 +0200)]
use xzalloc in driver code

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agouse xzalloc in common code
Jan Beulich [Tue, 4 Oct 2011 12:16:32 +0000 (14:16 +0200)]
use xzalloc in common code

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agointroduce xzalloc() & Co
Jan Beulich [Tue, 4 Oct 2011 12:15:26 +0000 (14:15 +0200)]
introduce xzalloc() & Co

Rather than having to match a call to one of the xmalloc() flavors with
a subsequent memset(), introduce a zeroing variant of each of those
flavors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agoAMD-IOMMU: remove dead variable references
Jan Beulich [Tue, 4 Oct 2011 12:11:56 +0000 (14:11 +0200)]
AMD-IOMMU: remove dead variable references

These got orphaned up by recent changes.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
13 years agobuild: fix grep invocation in cc-options
Keir Fraser [Fri, 30 Sep 2011 20:17:47 +0000 (21:17 +0100)]
build: fix grep invocation in cc-options

Currently the build produces lots of
        Usage: grep [OPTION]... PATTERN [FILE]...
        Try `grep --help' for more information.

This is due to the "grep -- $(2)" in cc-options. It seems that the
default of reading stdin is disabled when using "--". I don't know if
this is a bug in grep or how it is supposed to be but we can work
around it by explicitly passing in "-"

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agoX86 MCE: Prevent malicious guest access broken page again
Keir Fraser [Fri, 30 Sep 2011 20:16:43 +0000 (21:16 +0100)]
X86 MCE: Prevent malicious guest access broken page again

To avoid recursive mce.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
13 years agox86,irq: Clean up __clear_irq_vector
Keir Fraser [Fri, 30 Sep 2011 20:15:21 +0000 (21:15 +0100)]
x86,irq: Clean up __clear_irq_vector

Fix and clean up the logic to __clear_irq_vector().

We always need to clear the things related to cfg->vector.

If the IRQ is currently in motion, then we need to also clear
out things related to cfg->old_vector.

This patch reorganizes the function to make the parallels between
the two clean-ups more obvious.

The main functional change here is with cfg->used_vectors; make
sure to clear cfg->vector always (even if !cfg->move_in_progress);
if cfg->move_in_progress, clear cfg->old_vector as well.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
13 years agoIRQ Cleanup: rename nr_ioapic_registers to nr_ioapic_entries
Keir Fraser [Fri, 30 Sep 2011 20:14:34 +0000 (21:14 +0100)]
IRQ Cleanup: rename nr_ioapic_registers to nr_ioapic_entries

The name "nr_ioapic_registers" is wrong and actively misleading.  The
variable holds the number of redirection entries for each apic, which
is two registers fewer than the total number of registers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
13 years agolibxl: libxl_qmp: use of libxl__fd_set_cloexec.
Anthony PERARD [Thu, 29 Sep 2011 15:31:24 +0000 (16:31 +0100)]
libxl: libxl_qmp: use of libxl__fd_set_cloexec.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: Introduce a QMP client
Anthony PERARD [Thu, 29 Sep 2011 15:30:54 +0000 (16:30 +0100)]
libxl: Introduce a QMP client

QMP stands for QEMU Monitor Protocol and it is used to query information
from QEMU or to control QEMU.

This implementation will ask QEMU the list of chardevice and store the
path to serial ports in xenstored. So we will be able to use xl console
with QEMU upstream.

In order to connect to the QMP server, a socket file is created in
/var/run/xen/qmp-libxl-$(domid).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: Introduce JSON parser
Anthony PERARD [Thu, 29 Sep 2011 15:28:24 +0000 (16:28 +0100)]
libxl: Introduce JSON parser

We use the yajl parser, but we need to make a tree from the parse result
to use it outside the parser.

So this patch include json_object struct that is used to hold the JSON
data.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agolibxl: Intruduce libxl__strndup.
Anthony PERARD [Thu, 29 Sep 2011 15:28:23 +0000 (16:28 +0100)]
libxl: Intruduce libxl__strndup.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agolibxl: Introduce libxl__realloc.
Anthony PERARD [Thu, 29 Sep 2011 15:28:22 +0000 (16:28 +0100)]
libxl: Introduce libxl__realloc.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agolibxl: Introduce libxl_internal_types.idl.
Anthony PERARD [Thu, 29 Sep 2011 15:28:22 +0000 (16:28 +0100)]
libxl: Introduce libxl_internal_types.idl.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agolibxl: Add get/set_default_namespace in libxltypes.py.
Anthony PERARD [Thu, 29 Sep 2011 15:28:21 +0000 (16:28 +0100)]
libxl: Add get/set_default_namespace in libxltypes.py.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
13 years agolibxl: Rename libxl.idl to libxl_types.idl.
Anthony PERARD [Thu, 29 Sep 2011 15:28:20 +0000 (16:28 +0100)]
libxl: Rename libxl.idl to libxl_types.idl.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
--HG--
rename : tools/libxl/libxl.idl => tools/libxl/libxl_types.idl

13 years agolibxl: Introduce libxl__fd_set_cloexec
Anthony PERARD [Thu, 29 Sep 2011 15:06:02 +0000 (16:06 +0100)]
libxl: Introduce libxl__fd_set_cloexec

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: fixup command line handling for several commands.
Ian Campbell [Thu, 29 Sep 2011 14:40:34 +0000 (15:40 +0100)]
xl: fixup command line handling for several commands.

def_getopt already checks for a minimum number of arguments for us.

"xl save" simply need to use the correct argument for that value,
contrary to the change I made in 23876:b113d626cfaf

"xl block-list" does not need to check for at least 2 arguments, since
it's already been done by def_getopt.

"xl network-list" would previous accept zero arguments and just print
the table header. Insist on a domain argument.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: Expose number of shared pages
Adin Scannell [Thu, 29 Sep 2011 14:26:04 +0000 (15:26 +0100)]
libxl: Expose number of shared pages

Signed-off-by: Adin Scannell <adin@scannell.ca>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: attempt to cleanup tapdisk processes on disk backend destroy.
Ian Campbell [Wed, 28 Sep 2011 15:42:11 +0000 (16:42 +0100)]
libxl: attempt to cleanup tapdisk processes on disk backend destroy.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: correct allocation size in libxl_list_nics
Ian Campbell [Wed, 28 Sep 2011 15:35:44 +0000 (16:35 +0100)]
libxl: correct allocation size in libxl_list_nics

The function returns a list of libxl_nicinfo not libxl_device_nic.

Causes memory corruption on free.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: correct allocation size in libxl_list_vm
Ian Campbell [Wed, 28 Sep 2011 15:34:00 +0000 (16:34 +0100)]
libxl: correct allocation size in libxl_list_vm

*ptr has type libxl_vminfo not libxl_domid, so correct calloc call.

This the second instance of this bug I've noticed recently, I did a
quick audit of other similar uses of sizeof(...) and all I spotted
were a couple of harmlessly reversed calloc arguments. It's a pretty
strong argument for "foo = ..alloc(sizeof(*foo))" rather than
"alloc(sizeof(foos_type))" though...

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: correctly propagate errors from libxl_domain_destroy
Ian Campbell [Wed, 28 Sep 2011 15:32:31 +0000 (16:32 +0100)]
libxl: correctly propagate errors from libxl_domain_destroy

currently it return success e.g. even if xc_domain_destroy fails.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: fail to parse disk vpath if a disk+part number needed but unavailable
Ian Campbell [Wed, 28 Sep 2011 15:31:11 +0000 (16:31 +0100)]
libxl: fail to parse disk vpath if a disk+part number needed but unavailable

libxl__device_disk_dev_number() can parse a virtpath which is an encoded
unsigned long but does not set *pdisk or *ppartition in that case.

Ideally we would parse the number but for now simply fail to prevent cascading
failures.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: do not try to redo incoming migration on reboot of migrated domain
Ian Campbell [Tue, 27 Sep 2011 17:39:15 +0000 (18:39 +0100)]
libxl: do not try to redo incoming migration on reboot of migrated domain

After a migration, reboot was trying to receive another incoming
migration, instead of restarting the domain it already has.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Andreas Olsowski <andreas.olsowski@leuphana.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agolibxl: make libxl__wait_for_device_model use libxl__spawn_starrting directly
Ian Campbell [Tue, 27 Sep 2011 17:03:11 +0000 (18:03 +0100)]
libxl: make libxl__wait_for_device_model use libxl__spawn_starrting directly

Instead of indirecting via libxl_device_model_starting. This fixes a
segmentation fault using stubdomains where starting->for_spawn is
(validly) NULL because starting a stubdom doesn't need to spawn a
process.

Most callers of libxl__wait_for_device_model already pass NULL for
this variable (because they are not on the starting path) so on
libxl__confirm_device_model_startup needs to change.

Reported-by: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoxl: fixup "xl save" command line handling.
Ian Campbell [Tue, 27 Sep 2011 16:32:16 +0000 (17:32 +0100)]
xl: fixup "xl save" command line handling.

The save file paramter is required so ensure we have enough arguments.

The config filename is optional so do not use argv[optind+3], which
may well happen to be NULL when the paramter is not present but
relying on that is pretty gross.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
13 years agoAMD-IOMMU: fix initialization order (after 23863:9e0259239822)
Jan Beulich [Tue, 27 Sep 2011 15:15:09 +0000 (16:15 +0100)]
AMD-IOMMU: fix initialization order (after 23863:9e0259239822)

That original patch caused alloc_ivrs_mappings() to be called too
early, so things get moved back to where they were, just converting
the single call there to a loop over all IOMMUs.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoxenpaging: track number of paged pages in struct domain
Olaf Hering [Mon, 26 Sep 2011 21:19:42 +0000 (22:19 +0100)]
xenpaging: track number of paged pages in struct domain

The toolstack should know how many pages are paged-out at a given point
in time so it could make smarter decisions about how many pages should
be paged or ballooned.

Add a new member to xen_domctl_getdomaininfo and bump interface version.
Use the new member in xc_dominfo_t.
The SONAME of libxc should be changed if this patch gets applied.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agoAdd save/restore support for viridian APIC assist pfn.
Paul Durrant [Mon, 26 Sep 2011 21:10:21 +0000 (22:10 +0100)]
Add save/restore support for viridian APIC assist pfn.

c/s 17b754cab7b0 introduced a per-VCPU viridian structure to
store the APIC assist pfn. This patch adds support for save and
restore of that value.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
13 years agotools: fix install of lomount
Ian Campbell [Thu, 22 Sep 2011 17:37:06 +0000 (18:37 +0100)]
tools: fix install of lomount

$(BIN) went away in 23124:e3d4c34b14a3.

Also there are no *.so, *.a or *.rpm built in here

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
13 years agox86: ucode-amd: Don't warn when no ucode is available for a CPU revision
Jan Beulich [Thu, 22 Sep 2011 17:35:30 +0000 (18:35 +0100)]
x86: ucode-amd: Don't warn when no ucode is available for a CPU revision

This patch originally comes from the Linus mainline kernel (2.6.33),
find below the patch details:

From: Andreas Herrmann <herrmann.der.user@googlemail.com>

There is no point in warning when there is no ucode available
for a specific CPU revision. Currently the container-file, which
provides the AMD ucode patches for OS load, contains only a few
ucode patches.

It's already clearly indicated by the printed patch_level
whenever new ucode was available and an update happened. So the
warning message is of no help but rather annoying on systems
with many CPUs.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoXZ: Fix incorrect XZ_BUF_ERROR
Jan Beulich [Thu, 22 Sep 2011 17:34:27 +0000 (18:34 +0100)]
XZ: Fix incorrect XZ_BUF_ERROR

From: Lasse Collin <lasse.collin@tukaani.org>

xz_dec_run() could incorrectly return XZ_BUF_ERROR if all of the
following was true:

 - The caller knows how many bytes of output to expect and only
   provides
   that much output space.

 - When the last output bytes are decoded, the caller-provided input
   buffer ends right before the LZMA2 end of payload marker.  So LZMA2
   won't provide more output anymore, but it won't know it yet and
   thus
   won't return XZ_STREAM_END yet.

 - A BCJ filter is in use and it hasn't left any unfiltered bytes in
   the
   temp buffer.  This can happen with any BCJ filter, but in practice
   it's more likely with filters other than the x86 BCJ.

This fixes <https://bugzilla.redhat.com/show_bug.cgi?id=3D735408>
where Squashfs thinks that a valid file system is corrupt.

This also fixes a similar bug in single-call mode where the
uncompressed size of a block using BCJ + LZMA2 was 0 bytes and caller
provided no output space.  Many empty .xz files don't contain any
blocks and thus don't trigger this bug.

This also tweaks a closely related detail: xz_dec_bcj_run() could call
xz_dec_lzma2_run() to decode into temp buffer when it was known to be
useless.  This was harmless although it wasted a minuscule number of
CPU cycles.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoXZ decompressor: Fix decoding of empty LZMA2 streams
Jan Beulich [Thu, 22 Sep 2011 17:33:48 +0000 (18:33 +0100)]
XZ decompressor: Fix decoding of empty LZMA2 streams

From: Lasse Collin <lasse.collin@tukaani.org>

The old code considered valid empty LZMA2 streams to be corrupt.
Note that a typical empty .xz file has no LZMA2 data at all,
and thus most .xz files having no uncompressed data are handled
correctly even without this fix.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoVT-d: fix off-by-one error in RMRR validation
Jan Beulich [Thu, 22 Sep 2011 17:32:34 +0000 (18:32 +0100)]
VT-d: fix off-by-one error in RMRR validation

(base_addr,end_addr) is an inclusive range, and hence there shouldn't
be a subtraction of 1 in the second invocation of page_is_ram_type().
For RMRRs covering a single page that actually resulted in the
immediately preceding page to get checked (which could have resulted
in a false warning).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoVT-d: eliminate a mis-use of pcidevs_lock
Jan Beulich [Thu, 22 Sep 2011 17:31:44 +0000 (18:31 +0100)]
VT-d: eliminate a mis-use of pcidevs_lock

dma_pte_clear_one() shouldn't acquire this global lock for the purpose
of processing a per-domain list. Furthermore the function a few lines
earlier has a comment stating that acquiring pcidevs_lock isn't
necessary here (whether that's really correct is another question).

Use the domain's mappin_lock instead to protect the mapped_rmrrs list.
Fold domain_rmrr_mapped() into its sole caller so that the otherwise
implicit dependency on pcidevs_lock there becomes more obvious (see
the comment there).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agox86: IO-APIC code has no dependency on PCI
Jan Beulich [Thu, 22 Sep 2011 17:31:02 +0000 (18:31 +0100)]
x86: IO-APIC code has no dependency on PCI

The IRQ handling code requires pcidevs_lock to be held only for MSI
interrupts.

As the handling of which was now fully moved into msi.c (i.e. while
applying fine without, the patch needs to be applied after the one
titled "x86: split MSI IRQ chip"), io_apic.c now also doesn't need to
include PCI headers anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: config space accessor adjustments
Jan Beulich [Thu, 22 Sep 2011 17:29:19 +0000 (18:29 +0100)]
PCI multi-seg: config space accessor adjustments

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: Pass-through adjustments
Jan Beulich [Thu, 22 Sep 2011 17:28:38 +0000 (18:28 +0100)]
PCI multi-seg: Pass-through adjustments

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: AMD-IOMMU specific adjustments
Jan Beulich [Thu, 22 Sep 2011 17:28:03 +0000 (18:28 +0100)]
PCI multi-seg: AMD-IOMMU specific adjustments

There are two places here where it is entirely unclear to me where the
necessary PCI segment number should be taken from (as IVMD descriptors
don't have such, only IVHD ones do). AMD confirmed that for the time
being it is acceptable to imply that only segment 0 exists.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: VT-d specific adjustments
Jan Beulich [Thu, 22 Sep 2011 17:27:26 +0000 (18:27 +0100)]
PCI multi-seg: VT-d specific adjustments

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: adjust domctl interface
Jan Beulich [Thu, 22 Sep 2011 17:26:54 +0000 (18:26 +0100)]
PCI multi-seg: adjust domctl interface

Again, a couple of directly related functions at once get adjusted to
account for the segment number.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agox86: split MSI IRQ chip
Jan Beulich [Sat, 17 Sep 2011 23:26:52 +0000 (00:26 +0100)]
x86: split MSI IRQ chip

With the .end() accessor having become optional and noting that
several of the accessors' behavior really depends on the result of
msi_maskable_irq(), the splits the MSI IRQ chip type into two - one
for the maskable ones, and the other for the (MSI only) non-maskable
ones.

At once the implementation of those methods gets moved from io_apic.c
to msi.c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agopass struct irq_desc * to all other IRQ accessors
Jan Beulich [Sat, 17 Sep 2011 23:25:57 +0000 (00:25 +0100)]
pass struct irq_desc * to all other IRQ accessors

This is again because the descriptor is generally more useful (with
the IRQ number being accessible in it if necessary) and going forward
will hopefully allow to remove all direct accesses to the IRQ
descriptor array, in turn making it possible to make this some other,
more efficient data structure.

This additionally makes the .end() accessor optional, noting that in a
number of cases the functions were empty.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agopass struct irq_desc * to set_affinity() IRQ accessors
Jan Beulich [Sat, 17 Sep 2011 23:24:37 +0000 (00:24 +0100)]
pass struct irq_desc * to set_affinity() IRQ accessors

This is because the descriptor is generally more useful (with the IRQ
number being accessible in it if necessary) and going forward will
hopefully allow to remove all direct accesses to the IRQ descriptor
array, in turn making it possible to make this some other, more
efficient data structure.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoconvert more literal uses of cpumask_t to pointers
Jan Beulich [Sat, 17 Sep 2011 23:22:57 +0000 (00:22 +0100)]
convert more literal uses of cpumask_t to pointers

This is particularly relevant as the number of CPUs to be supported
increases (as recently happened for the default thereof).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoMAINTAINERS: Add Jan Beulich for EFI, x86, ACPI.
Keir Fraser [Sat, 17 Sep 2011 23:21:23 +0000 (00:21 +0100)]
MAINTAINERS: Add Jan Beulich for EFI, x86, ACPI.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agoPCI multi-seg: add new physdevop-s
Jan Beulich [Sat, 17 Sep 2011 23:12:19 +0000 (00:12 +0100)]
PCI multi-seg: add new physdevop-s

The new PHYSDEVOP_pci_device_add is intended to be extensible, with a
first extension (to pass the proximity domain of a device) added right
away.

A couple of directly related functions at once get adjusted to account
for the segment number.

Should we deprecate the PHYSDEVOP_manage_pci_* sub-hypercalls?

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoPCI multi-seg: introduce notion of PCI segments
Jan Beulich [Sat, 17 Sep 2011 23:10:03 +0000 (00:10 +0100)]
PCI multi-seg: introduce notion of PCI segments

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoFix PV CPUID virtualization of XSave
Shan Haitao [Sat, 17 Sep 2011 23:01:58 +0000 (00:01 +0100)]
Fix PV CPUID virtualization of XSave

The patch will fix XSave CPUID virtualization for PV guests. The XSave
area size returned by CPUID leaf D is changed dynamically depending on
the XCR0. Tools/libxc only assigns a static value. The fix will adjust
xsave area size during runtime.

Note: This fix is already in HVM cpuid virtualization. And Dom0 is not
affected, either.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
13 years agoClear IRQ_GUEST in irq_desc->status when setting action to NULL.
Igor Mammedov [Sat, 17 Sep 2011 23:00:26 +0000 (00:00 +0100)]
Clear IRQ_GUEST in irq_desc->status when setting action to NULL.

Looking more closely at usage of action field with relation to
IRQ_GUEST flag. It appears that set IRQ_GUEST implies that action
is not NULL. As result it is not safe to set action to NULL and
leave IRQ_GUEST set.

Hence IRQ_GUEST should be cleared in dynamic_irq_cleanup where
action is set to NULL.

An addition remove BUGON at __pirq_guest_unbind that appears to be
bogus and not needed anymore.

Thanks Paolo Bonzini for NACKing previous patch, and pointing at the
correct solution.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reinstate the BUG_ON, but after the action==NULL check. Since we then
go and start interpreting action as an irq_guest_action_t, the BUG_ON
is relevant here.

More generally, the brute-force nature of dynamic_irq_cleanup() looks
a bit worrying. Possibly there should be more integratioin with
pirq_guest_unbind() logic, for cleaning up un-acked EOIs and the like.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agox86/time: verify_tsc_reliability() can be run as a generic initcall.
Keir Fraser [Sat, 17 Sep 2011 15:44:56 +0000 (16:44 +0100)]
x86/time: verify_tsc_reliability() can be run as a generic initcall.

Signed-off-by: Keir Fraser <keir@xen.org>
13 years agox86-64/EFI: 2.0 hypercall extensions
Jan Beulich [Sat, 17 Sep 2011 15:27:36 +0000 (16:27 +0100)]
x86-64/EFI: 2.0 hypercall extensions

Flesh out the interface to EFI 2.0 runtime calls and implement what
can reasonably be without actually having active call paths getting
there (i.e. without actual debugging possible: The capsule interfaces
certainly require an environment where an initial implementation can
actually be tested).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agox86-64/EFI: 2.0 header extensions
Jan Beulich [Sat, 17 Sep 2011 15:27:06 +0000 (16:27 +0100)]
x86-64/EFI: 2.0 header extensions

Updates from gnu-efi 3.0m. UEFI 2.0 runtime services additions taken
from EDK 1.06.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agox86/vmx: don't call __vmxoff() blindly
Jan Beulich [Sat, 17 Sep 2011 15:26:37 +0000 (16:26 +0100)]
x86/vmx: don't call __vmxoff() blindly

If vmx_vcpu_up() failed, __vmxon() would generally not have got
(successfully) executed, and in that case __vmxoff() will #UD.

Additionally, any panic() during early resume (namely the tboot
related one) would cause vmx_cpu_down() to get executed without
vmx_cpu_up() having run before.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agox86/tboot: make resume error messages visible
Jan Beulich [Sat, 17 Sep 2011 15:25:53 +0000 (16:25 +0100)]
x86/tboot: make resume error messages visible

With tboot_s3_resume() running before console_resume(), the error
messages so far printed by it are mostly guaranteed to go into
nirwana.  Latch MACs into a static variable instead, and issue the
messages right before calling panic().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
13 years agoxen: Move tsc reliability check until after CPUs have booted
George Dunlap [Sat, 17 Sep 2011 15:22:54 +0000 (16:22 +0100)]
xen: Move tsc reliability check until after CPUs have booted

AMD CPUs by default enable X86_FEATURE_TSC_RELIABLE, and depend upon a
later check to disable this feature if TSC drift is detected.
Unfortunately, this check is done in time.c:init_xen_time(), which is
done before any secondary CPUs are brought up, and is thus guaranteed
to succed.

This patch moves the check into its own function, and calls it after
cpus are brought up.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
13 years agox86/hvm: Tidy up the viridian code a little and flesh out the APIC
Paul Durrant [Sat, 17 Sep 2011 15:22:13 +0000 (16:22 +0100)]
x86/hvm: Tidy up the viridian code a little and flesh out the APIC
assist MSR handling code.

We don't say we that handle that MSR but Windows assumes it. In
Windows 7 it just wrote to the MSR and we used to handle that
ok. Windows 8 also reads from the MSR so we need to keep a record of
the contents.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
13 years agoxen/xsm: Compile error due to naming clash between XSM and EFI runtime
James Carter [Sat, 17 Sep 2011 15:20:58 +0000 (16:20 +0100)]
xen/xsm: Compile error due to naming clash between XSM and EFI runtime

The problem is that efi_runtime_call is the name of both a function in
xen/arch/x86/efi/runtime.c and a member of the xsm_operations struct
in xen/include/xsm/xsm.h. This causes the macro "#define
efi_runtime_call(x) efi_compat_runtime_call(x)" on line 15 of
xen/arch/x86/x86_64/platform_hypercall.c to cause the above compile
error.

Renaming the XSM struct member fixes the problem.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
Acked-by: Jan Beulich <jbeulich@suse.com>