Tim Deegan [Tue, 13 Mar 2012 15:10:58 +0000 (15:10 +0000)]
arm: new hook for late MMU setup on secondary CPUs
The boot CPU turns on W^X in setup_pagetables(). Do the same for other
CPUs after they boot. If we go to per-CPU pagetables, this is where
that will happen.
Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Tue, 13 Mar 2012 15:10:56 +0000 (15:10 +0000)]
arm: Boot secondary CPUs into C
Secondary CPUs come up directly onto the stack of the appropriate idle
vcpu; the boot CPU starts on a statically allocated stack and switches
over to the idle vcpu's one once the idle domain has been built.
Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Tue, 13 Mar 2012 15:10:53 +0000 (15:10 +0000)]
arm: More SMP bringup
Bring non-boot CPUs up as far as running on the relocated pagetables,
one at a time, before the non-relocated copy of Xen gets reused for
general memory pools.
Don't yet bring them up into C; that will happen later when stacks are
allocated.
Signed-off-by: Tim Deegan <tim@xen.org> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Thu, 8 Mar 2012 16:40:05 +0000 (16:40 +0000)]
Use a reserved pfn in the guest address space to store mem event rings
This solves a long-standing issue in which the pages backing these rings were
pages belonging to dom0 user-space processes. Thus, if the process would die
unexpectedly, Xen would keep posting events to a page now belonging to some
other process.
We update all API-consumers in tree (xenpaging and xen-access).
This is an API/ABI change, so please speak up if it breaks your accumptions.
The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
Tim Deegan [Thu, 8 Mar 2012 16:40:05 +0000 (16:40 +0000)]
Tools: Remove shared page from mem_event/access/paging interfaces
Don't use the superfluous shared page, return the event channel directly as
part of the domctl struct, instead.
In-tree consumers (xenpaging, xen-access) updated. This is an ABI/API change,
so please voice any concerns.
Known pending issues:
- pager could die and its ring page could be used by some other process, yet
Xen retains the mapping to it.
- use a saner interface for the paging_load buffer.
This change also affects the x86/mm bits in the hypervisor that process the
mem_event setup domctl.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Olaf Hering <olaf@aepfle.de> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
Eric Chanudet [Thu, 8 Mar 2012 16:04:32 +0000 (17:04 +0100)]
XENPF_set_processor_pminfo XEN_PM_CX overflows states array
Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states
array in "struct acpi_processor_power" to exceed its limit.
The array used to be reset (by function cpuidle_init_cpu()) for each
hypercall. The patch puts it back that way and adds an assertion to
make it clear in case that happens again.
Signed-off-by: Eric Chanudet <eric.chanudet@eu.citrix.com>
- convert assertion to printk() & bail
- eliminate struct acpi_processor_cx's valid member (not read anymore)
- further adjustments to one-time-only vs each-time operations in
cpuidle_init_cpu()
- don't use ACPI_STATE_Cn as array index anymore
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Thu, 8 Mar 2012 16:02:57 +0000 (17:02 +0100)]
oprofile: don't pass around redundant, easily derived arguments
Passing both a struct vcpu pointer and the corresponding struct domain
one is simply pointless, especially when intermediate functions just
forward it without themselves making use of the already obtained value.
Also constify a few function parameters.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Andrew Cooper [Thu, 8 Mar 2012 09:23:27 +0000 (09:23 +0000)]
NMI: Command line parameter for watchdog timeout
Introduce a command parameter to set the watchtog timeout. Manually
specifying "watchdog_timeout=<seconds>" on the command line will also
turn the watchdog on. For consistency, move opt_watchdog into nmi.c
along with opt_watchdog_timeout.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
George Dunlap [Thu, 8 Mar 2012 09:17:21 +0000 (09:17 +0000)]
svm: Fake out the Bus Unit Config MSR on revF AMD CPUs
Win2k8 x64 reads this MSR on revF chips, where it wasn't publically
available; it uses a magic constant in %rdi as a password, which we
don't have in rdmsr_safe(). Since we'll ignore the later writes, just
use a plausible value here (the reset value from rev10h chips) if the
real CPU didn't provide one.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
George Dunlap [Thu, 8 Mar 2012 09:16:09 +0000 (09:16 +0000)]
x86: Add more specific logging for get_page_from_l1e failures
This patch should clarify which of the two possible reasons cause the
messages
of the form "(XEN) mm.c:908:d1 Error getting mfn 29b2b (pfn 5555555555555555)
from L1 entry 0000000029b2b067 for l1e_owner=1, pg_owner=1".
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 7 Mar 2012 10:50:31 +0000 (11:50 +0100)]
provide a single, common implementation for get_order_from_{bytes,pages}()
All three per-architecture implementations were identical, and I cannot
see how future architectures would need any sort of customization here
(the only per-architecture aspect here is the actual PAGE_SHIFT value).
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
George Dunlap [Wed, 7 Mar 2012 07:43:02 +0000 (07:43 +0000)]
build: Don't remove user-supplied xen-version during make clean
xen/Makefile is designed to allow the user to supply a file named
xen/xen-include to change the format of xen version strings.
Unfortunately, "make clean" removes xen/xen*, which will remove this
file.
Make the clean process more targeted.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Boris Ostrovsky [Wed, 7 Mar 2012 07:30:30 +0000 (07:30 +0000)]
x86: Use deep C states for off-lined CPUs
Currently when a core is taken off-line it is placed in C1 state
(unless MONITOR/MWAIT is used). This patch allows a core to go to
deeper C states resulting in significantly higher power savings.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Tue, 6 Mar 2012 15:43:01 +0000 (16:43 +0100)]
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0
32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.
Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.
Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Boris Ostrovsky [Tue, 6 Mar 2012 14:51:33 +0000 (15:51 +0100)]
x86: Use deep C states for off-lined CPUs
Currently when a core is taken off-line it is placed in C1 state (unless
MONITOR/MWAIT is used). This patch allows a core to go to deeper C states
resulting in significantly higher power savings.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com> Committed-by: Jan Beulich <jbeulich@suse.com>
You can use `kernel' and `ramdisk' to specify the relative path of
boot kernel and ramdisk. `xenpvnetboot' will join them with the
location to find the boot kernel and ramdisk, e.g.:
If only `--location' is specified and `kernel' and `ramdisk' are not
specified, `xenpvnetboot' will search the following places for boot
images from the location::
('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
George Dunlap [Thu, 1 Mar 2012 18:22:01 +0000 (18:22 +0000)]
libxl: Implement libxl_sched_credit_param_[gs]et
Implement functions to set credit scheduler global parameters.
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Introduce an empty implementation of the arch specific ARM functions in
xc_core_arm.c and xc_core_arm.h; define barriers on ARM.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <ian.jackson.citrix.com> Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Yongjie Ren [Thu, 1 Mar 2012 17:23:51 +0000 (17:23 +0000)]
tools: fix python version checking issue
Even if python version is 2.4.3 which is newer than the required
version 2.3, the configure script still raises a version issue. I
tested my patch with python 2.6.6 and 2.4.3. It will fix a syntax
error like the following.
checking for python version >= 2.3 ... Traceback (most recent call last):
File "<string>", line 1, in ?
TypeError: 'str' object is not callable
no
configure: error: Python 2.4.3 is too old, minimum required version is 2.3
Signed-off-by: Yongjie Ren <yongjie.ren@intel.com> Acked-by: Roger Pau Monne <roger.pau@entel.upc.edu> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Thu, 1 Mar 2012 16:59:33 +0000 (16:59 +0000)]
build: autoconf: fix libdir detection
If user specifies a libdir it is used, if no libdir is specified
configure checks if $exec_prefix/lib64 is a directory and uses that,
if not lib is used.
$prefix is set by passing the command line option or by default when
calling AC_OUTPUT, but since AC_OUTPUT is called at the end, this is
not really helpful, so we have to set $exec_prefix manually to the
correct value, either $prefix if different than NONE or
$ac_default_prefix.
Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 1 Mar 2012 16:51:39 +0000 (16:51 +0000)]
docs: xen-headers: Remove hard tabs
Remove hard tabs from the Perl script.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Ian Jackson [Thu, 1 Mar 2012 16:51:39 +0000 (16:51 +0000)]
docs: xen-headers: Annotate typedefs
Parse (some) typedef statements. (Make type names links to the
underlying struct if there is one, rather than to just the typedef.)
Also, exclude the new arch-arm headers.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com> Cc: Ian Campbell <Ian.Campbell@citrix.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
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>
Roger Pau Monne [Thu, 1 Mar 2012 16:41:15 +0000 (16:41 +0000)]
build: autoconf: remove python xml check
Remove the xml module check from autoconf and move it to xend init
script (in a later patch), since it's a run time dependency.
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>
When a low memory threshold on the Xen heap is reached, we fire a
global dom0 virq. If someone's listening, they can free up some more
memory.
The low threshold is configurable via the command line token
'low_mem_virq_limit", and defaults to 64MiB. If the user specifies
zero via the command line, the virq is disabled.
We define a new virq VIRQ_ENOMEM. Potential listeners include
squeezed, xenballoond, or anything else that can be fired through
xencommons.
We error-check the low mem virq against initial available heap (after
dom0 allocation), to avoid firing immediately.
Virq issuing is controlled by a hysteresis algorithm: when memory dips
below a threshold, the virq is issued and the next virq will fire when
memory shrinks another order of magnitude. The virq will not fire
again in the current "band" until memory grows over the next higher
order of magnitude.
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Committed-by: Keir Fraser <keir@xen.org>
Wei Liu [Thu, 1 Mar 2012 16:37:18 +0000 (16:37 +0000)]
Grant table: fix a bug when grant copying a previous grant mapped page.
In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref. Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.
See changeset 22994:299ed79acecf for more information.
Signed-off-by: Wei Liu <wei.liu2@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
Wei Wang [Thu, 1 Mar 2012 16:35:54 +0000 (16:35 +0000)]
amd iommu: Introduce a new lock for event and ppr logging
iommu->lock is used with irq disabled, so it cannot be used to protect
ppr log. Otherwise, after c/s 24770, get_gfn will trigger a BUG() if
called by parse_ppr_log_entry(). This patch adds an additional lock to
protect ppr and event pointers in iommu_read_log().
signed-off-by: Wei Wang <wei.wang2@amd.com> Committed-by: Keir Fraser <keir@xen.org>
Annie Li [Thu, 1 Mar 2012 16:29:59 +0000 (16:29 +0000)]
hvm: correct RTC time offset update error due to tm->tm_year
tm->tm_year in rtc.c is year number offsetting from 1900. So it is
necessary to add the offset 1900 when calling mktime funtion in
Xen. Otherwise, the calculation result of mktime is incorrect.
Signed-off-by: Annie Li <annie.li@oracle.com> Committed-by: Keir Fraser <keir@xen.org>
Roger Pau Monne [Thu, 1 Mar 2012 16:19:29 +0000 (16:19 +0000)]
build: autoconf: remove ip check
ip is a run-time dependency, and it is not needed to build Xen tools.
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>
Ian Campbell [Thu, 1 Mar 2012 16:03:21 +0000 (16:03 +0000)]
hcall: markup the event channel hypercalls to improve generated docs
As part of this I looked through the relevant chapter from interfaces.tex (from
4.1, deleted in unstable) to ensure no critical information was missing.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
With changeset 24364:0964341efd65 an event channel based notification of
new responses in the ringbuffer is implemented. This makes the memevent
interface obsolete. Currently a call to p2m_mem_paging_resume() is
triggered twice by xenpaging, once per memevent and once per even
channel. In practice this double call does not lead to issues because
p2m_mem_paging_resume() processes only available events.
xenpaging used the event channel notification since the beginning, but
it was a no-op until changeset mentioned above. This change removes the
unneeded XENMEM_paging_op_resume functionality. Pagers are notified via
an event channel of new requests, and now they are required to notify
the hypervisor about their responses also with an event channel.
Signed-off-by: Olaf Hering <olaf@aepfle.de> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Daniel De Graaf [Thu, 1 Mar 2012 15:22:09 +0000 (15:22 +0000)]
build: remove hypervisor-only configuration from tools/configure
When adding autoconf support, the configuration options for XSM and
FLASK_ENABLE were incorrectly removed from Config.mk and added to the
tools configuration. Since these are hypervisor configuration options,
they should not depend on running tools configuration.
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
David Vrabel [Thu, 1 Mar 2012 15:18:08 +0000 (15:18 +0000)]
libxc: add MMIO hole size parameter to xc_hvm_build()
Add a parameter for the MMIO hole size when building a HVM domain.
This is useful for specifying a larger than normal MMIO hole to ensure
that no PCIe device's MMIO region overlaps with RAM in a guest's
physical address space. This is needed on certain systems with PCIe
switches with a broken ACS capability. On these systems, if a device
downstream of the switch attempts a DMA to a guest physical address
that overlaps with the MMIO region of another downstream device, then
the switch routes the transfer directly to the device and the read or
write never hits RAM.
Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
David Vrabel [Thu, 1 Mar 2012 15:16:22 +0000 (15:16 +0000)]
libxc: pass arguments to xc_hvm_build() in a structure
To allow new parameters to be added to the xc_hvm_build*() family of
functions, pass them in a structure. Make the other variants fill in
the structure and call xc_hvm_build() (except for xc_hvm_build_mem()
which had no users and is removed).
The units of the mem_size and mem_target arguments are in bytes (not
MiB like the old functions).
Signed-off-by: David Vrabel <david.vrabel@citrix.com> Acked-by: George Dunlap <george.dunlap@eu.citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 1 Mar 2012 12:26:15 +0000 (12:26 +0000)]
libxl: add libxl_domain_build_info_init_type
Use instead of parameterising libxl_domain_build_info_init. This allows callers
to initialise a libxl_domain_build_info but not to commit to a particular type
later on (e.g. after they've parsed the domain config)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 1 Mar 2012 12:26:15 +0000 (12:26 +0000)]
libxl: switch device model selection over to libxl_defbool
This allows it to be set via the _init/_setdefault methods.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[since last v -- ERROR_INVAL on stubdomains + !traditional qemu]
Ian Campbell [Thu, 1 Mar 2012 12:26:14 +0000 (12:26 +0000)]
libxl: make libxl_device_console internal
consoles are not directly exposed to users of the library and there are no API
functions for manipluating them (only the console_exec function). Rather than
commit to a particular API now make the type internal.
When a user does come along it is much easier to add a completely new API
rather than to fix an existing broken one. It's easier to do this in a manner
which users of the library can cope with in a compatible way e.g. adding a new
API is easier to check for with ./configure.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 1 Mar 2012 12:26:14 +0000 (12:26 +0000)]
libxl: drop 8M slack for PV guests.
This serves no purpose. It relates to the old 8M to "account for backend
allocations" which we used to add. This leaves a bit of unpopulated space in
the Pseudo-physical address space which can be used by backends when mapping
foreign memory. However 8M is not representative of that any more and modern
kernels do not operate in this way anyway.
I suspect an argument could be made for removing this from the libxl API
altogether but instead lets just set the overhead to 0.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>