Commit Graph
27133 Commits
Author SHA1 Message Date
Dario Faggioli 16f3499417 libxl: add LIBXL_HAVE_<foo> for outstanding_pages and outstanding_memkb
Commits d0782481  ("xl: export 'outstanding_pages' value from xcinfo")
and bec8f17e ("xen: Remove the XENMEM_get_oustanding_pages and provide
the data via xc_phys_info") added these two fields in libxl_physinfo
and in libxl_dominfo, respectively, but did not include the needed
LIBXL_HAVE_<foo> runes. Adding them.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-06-12 10:11:27 +01:00
Daniel De Graaf b61b893d20 flask/policy: device model stubdom fixes
This fixes framebuffer support for device model stubdoms after 3f28d007
which added the target_hack permission but did not allow the permission
to the stubdom it was created for.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-06-12 10:09:15 +01:00
Jan Beulich 613659da9b io/ring.h: drop unused and broken *_RING_ATTACH() macros
Initializing r*_prod_pvt and r*_cons from independent shared ring
fields is broken, as other macros in this header rely on them being
coupled. Furthermore using the backend variant would also imply a
security vulnerability.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-06-12 10:07:48 +02:00
Jan Beulich a63c57093b io/ring.h: new macro to detect whether there are too many requests on the ring
Backends may need to protect themselves against an insane number of
produced requests stored by a frontend, in case they iterate over
requests until reaching the req_prod value. There can't be more
requests on the ring than the difference between produced requests
and produced (but possibly not yet published) responses.

This is a more strict alternative to a patch previously posted by
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-06-12 10:07:20 +02:00
Roger Pau Monné f8e8fd56bd x86/HVM: fix initialization of wallclock time for PVHVM on migration
Call update_domain_wallclock_time on hvm_latch_shinfo_size even if
the bitness of the guest has already been set, this fixes the problem
with the wallclock not being set for PVHVM guests on resume from
migration.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Clean up the resulting code and retain the (slightly adjusted) original
comment.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-06-12 10:05:39 +02:00
Zhenguo Wang 6859874b61 x86/HVM: fix x2APIC APIC_ID read emulation
APIC and x2APIC have different format for APIC_ID register. Need
translation.

Signed-off-by: Zhenguo Wang <wangzhenguo@huawei.com>
Signed-off-by: Xiaowei Yang <xiaowei.yang@huawei.com>

Convert code to use switch(), fixing coding style issue at once, and
use GET_xAPIC_ID() on the value read instead of VLAPIC_ID() (reading
the field again).

In the course of this also properly reject both read and writes on the
non-existing MSR corresponding to APIC_ICR2.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-06-11 09:45:55 +02:00
Jan Beulich 44434f3c5e gnttab: drop unused GNTCOPY_can_fail
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
4.3.0-rc4
2013-06-10 14:42:51 +02:00
Jan Beulich ac9e298cb4 Revert "irq: Add extra debugging to help track down why an assertion is failing"
This reverts commits 2ae8b9173f and
98e10364bd.

This was never reported to be hit, and we assume to have taken care of
the problem by excluding legacy IRQs from the IRQ move cleanup logic.

Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-06-10 13:43:03 +02:00
Jan Beulich e430510e5c AMD/IOMMU: revert "SR56x0 Erratum 64 - Reset all head & tail pointers"
The code this patch added is redundant with already present code in
set_iommu_{command_buffer,{event,ppr}_log}_control(). Just switch those
ones from using writel() to writeq() for consistency.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
2013-06-05 10:05:49 +02:00
Roger Pau Monné 32c864a35e x86/vtsc: update vcpu_time in hvm_set_guest_time
When using a vtsc, hvm_set_guest_time changes hvm_vcpu.stime_offset,
which is used in the vcpu time structure to calculate the
tsc_timestamp, so after updating stime_offset we need to propagate the
change to vcpu_time in order for the guest to get the right time if
using the PV clock.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-06-05 10:03:08 +02:00
Jan Beulich 10b2b21a24 x86: fix XCR0 handling
- both VMX and SVM ignored the ECX input to XSETBV
- both SVM and VMX used the full 64-bit RAX when calculating the input
  mask to XSETBV
- faults on XSETBV did not get recovered from

Also consolidate the handling for PV and HVM into a single function,
and make the per-CPU variable "xcr0" static to xstate.c.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-06-04 17:25:41 +02:00
Jan Beulich 10f9691500 x86: preserve FPU selectors for 32-bit guest code
Doing {,F}X{SAVE,RSTOR} unconditionally with 64-bit operand size leads
to the selector values associated with the last instruction/data
pointers getting lost. This, besides being inconsistent and not
compatible with native hardware behavior especially for 32-bit guests,
leads to bug checks in 32-bit Windows when running with "Driver
verifier" (see e.g. http://support.microsoft.com/kb/244617).

In a first try I made the code figure out the current guest mode, but
that has the disadvantage of only taking care of the issue when the
guest executes in the mode for which the state currently is (i.e.
namely not in the case of a 64-bit guest running a 32-bit application,
but being in kernle [64-bit] mode).

The solution presented here is to conditionally execute an auxiliary
FNSTENV and use the selectors from there.

In either case the determined word size gets stored in the last byte
of the FPU/SSE save area, which is available for software use (and I
verified is being cleared to zero by all versions of Xen, i.e. will not
present a problem when migrating guests from older to newer hosts), and
evaluated for determining the operand size {,F}XRSTOR is to be issued
with.

Note that I did check whether using a second FXSAVE or a partial second
XSAVE would be faster than FNSTENV - neither on my Westmere (FXSAVE)
nor on my Romley (XSAVE) they are.

I was really tempted to use branches into the middle of instructions
(i.e. past the REX64 prefixes) here, as that would have allowed to
collapse the otherwise identical fault recovery blocks. I stayed away
from doing so just because I expect others to dislike such slightly
subtle/tricky code.

Reported-by: Ben Guthro <Benjamin.Guthro@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-06-04 17:23:11 +02:00
Jan Beulich 365c95f7de x86/xsave: properly check guest input to XSETBV
Other than the HVM emulation path, the PV case so far failed to check
that YMM state requires SSE state to be enabled, allowing for a #GP to
occur upon passing the inputs to XSETBV inside the hypervisor.

This is CVE-2013-2078 / XSA-54.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2013-06-04 09:29:07 +02:00
Jan Beulich c6ae65db36 x86/xsave: recover from faults on XRSTOR
Just like FXRSTOR, XRSTOR can raise #GP if bad content is being passed
to it in the memory block (i.e. aspects not under the control of the
hypervisor, other than e.g. proper alignment of the block).

Also correct the comment explaining why FXRSTOR needs exception
recovery code to not wrongly state that this can only be a result of
the control tools passing a bad image.

This is CVE-2013-2077 / XSA-53.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2013-06-04 09:27:58 +02:00
Jan Beulich 8dcf9f0113 x86/xsave: fix information leak on AMD CPUs
Just like for FXSAVE/FXRSTOR, XSAVE/XRSTOR also don't save/restore the
last instruction and operand pointers as well as the last opcode if
there's no pending unmasked exception (see CVE-2006-1056 and commit
9747:4d667a139318).

While the FXSR solution sits in the save path, I prefer to have this in
the restore path because there the handling is simpler (namely in the
context of the pending changes to properly save the selector values for
32-bit guest code).

Also this is using FFREE instead of EMMS, as it doesn't seem unlikely
that in the future we may see CPUs with x87 and SSE/AVX but no MMX
support. The goal here anyway is just to avoid an FPU stack overflow.
I would have preferred to use FFREEP instead of FFREE (freeing two
stack slots at once), but AMD doesn't document that instruction.

This is CVE-2013-2076 / XSA-52.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
2013-06-04 09:26:54 +02:00
Aravindh Puthiyaparambil 5cffb77c40 x86/MCE: disable if MCE banks are not present
When booting Xen on VMware ESX 5.1 and Workstation 9, you hit a GPF
during MCE initialization. The culprit is line 631 in
set_poll_bankmask():
                bitmap_copy(mb->bank_map, mca_allbanks->bank_map, nr_mce_banks);

What is happening is that in mca_cap_init(), nr_mce_banks is being set
to 0. This causes the allocation of bank_map to be set to
ZERO_BLOCK_PTR which is the return value for zero-size allocation by
xzalloc_array()/_xmalloc(). This results in the bitmap_copy() to fail
disastrously. The following patch fixes this issue.

Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christoph Egger <chegger@amazon.de>
2013-06-03 15:42:46 +02:00
Christoph Egger b14fed7151 tools/libxl: fix array subscript has type 'char'
Signed-off-by: Christoph Egger <chegger@amazon.de>
2013-05-31 12:46:33 +01:00
Stefan Bader a67e2dac9f blkif.h: Document the physical-sector-size extension
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2013-05-31 13:43:30 +02:00
Boris Ostrovsky 75a92f551a Currently only a few Intel models have VPMU workaround turned on. It
appears, however, that this issue exists on more models than what is
covered by check_pmc_quirk(). Since we don't know exactly which cpus
are affected we should turn this workaround on for all family 6
processors.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Sort-of-Acked-by: "Auld, Will" <will.auld@intel.com>
2013-05-31 10:06:11 +02:00
Jan Beulich 71fc4da130 Revert "x86: debugging code for platform timer wrap problem"
This reverts commit bd9be94eb2.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2013-05-31 08:40:03 +02:00
Jan Beulich 43427e65cc x86: fix ordering of operations in destroy_irq()
The fix for XSA-36, switching the default of vector map management to
be per-device, exposed more readily a problem with the cleanup of these
vector maps: dynamic_irq_cleanup() clearing desc->arch.used_vectors
keeps the subsequently invoked clear_irq_vector() from clearing the
bits for both the in-use and a possibly still outstanding old vector.

Fix this by folding dynamic_irq_cleanup() into destroy_irq(), which was
its only caller, deferring the clearing of the vector map pointer until
after clear_irq_vector().

Once at it, also defer resetting of desc->handler until after the loop
around smp_mb() checking for IRQ_INPROGRESS to be clear, fixing a
(mostly theoretical) issue with the intercation with do_IRQ(): If we
don't defer the pointer reset, do_IRQ() could, for non-guest IRQs, call
->ack() and ->end() with different ->handler pointers, potentially
leading to an IRQ remaining un-acked. The issue is mostly theoretical
because non-guest IRQs are subject to destroy_irq() only on (boot time)
error paths.

As to the changed locking: Invoking clear_irq_vector() with desc->lock
held is okay because vector_lock already nests inside desc->lock (proven
by set_desc_affinity(), which takes vector_lock and gets called from
various desc->handler->ack implementations, getting invoked with
desc->lock held).

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
2013-05-31 08:35:22 +02:00
Julien Grall 7476f47882 arm: Fix after 54353cae09 "xen/arm: check string format for early_printk"
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 21:50:35 +01:00
Ian Campbell 1adef1732f xenballoond: remove as it is now obsolete + unsupported code
Dan, the author, states:
> this code is five years old, is distro dependent, and is now
> completely unsupported.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2013-05-30 10:02:04 +01:00
George Dunlap 5479961ab5 libxl: Remove qxl support for the 4.3 release
The qxl drivers for Windows and Linux end up calling instructions
that cannot be used for MMIO at the moment.  Just for the 4.3 release,
remove qxl support.

This patch should be reverted as soon as the 4.4 development window opens.

The issue in question:

(XEN) emulate.c:88:d18 bad mmio size 16
(XEN) io.c:201:d18 MMIO emulation failed @ 0033:7fd2de390430: f3 0f 6f
19 41 83 e8 403

The instruction in question is "movdqu (%rcx),%xmm3".  Xen knows how
to emulate it, but unfortunately %xmm3 is 16 bytes long, and the interface
between Xen and qemu at the moment would appear to only allow MMIO accesses
of 8 bytes.

It's too late in the release cycle to find a fix or a workaround.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:35:34 +01:00
Anthony PERARD 9da6085504 libxl: Fix qemu-xen command line for vcpus numbers.
On the qemu-xen command line, the number of vcpus initially online and
the number of maximum available vcpus are inverted.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:34:56 +01:00
George Dunlap ffa27970bc xl: Update example xl.conf with correct name for default script option
We've changed the config option from "vifscript" to "vif.default.script".  This
was changed in the manpage but not in the example xl.conf.

Also move the option down to be with the other vif options.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:34:11 +01:00
Frediano Ziglio 8789dfb557 gcov: update documentation on coverage.
Fix some spelling.
Add documentation for new xencov_split utility.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:31:05 +01:00
Frediano Ziglio cc1eca5194 gcov: Add script to split coverage informations.
Split coverage informations extracted from xencov utility.
This script accept coverage blob either as file or from input and extract
into files compatible with gcc format (gcda).

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:30:18 +01:00
George Dunlap 9fa437d084 libxl: use Linux-compatible names for sse4 cpuid features
Linux uses sse4_1 and sse4_2, but at the moment libxl uses '.' instead
of '_'.  This makes it confusing for people looking in Linux's /proc/cpuinfo
to disable features.

Add the Linux feature names, keeping the old ones for compatability.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.camppbell@citrix.com>
2013-05-30 09:24:14 +01:00
Andre Przywara b339d34409 arm/early-printk: add Calxeda Midway UART support
With the help of the previous patches add a stanza to
xen/arch/arm/Rules.mk to specify the UART configuration of the
Calxeda Midway machine.
The information has been taken from the Linux kernel's .dts file.
This can be enabled by adding "CONFIG_EARLY_PRINTK=midway" to
Config.mk.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:20:41 +01:00
Andre Przywara 95ac742a2d arm/early-printk: add support for ARM Fastmodel
Though the ARM Fastmodel software emulator mimics a Versatile Express
board, the boot process is different compared to the real hardware,
so the early printk differs slightly. Create a new early-printk
target to model this correctly.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:20:37 +01:00
Andre Przywara 74025300d5 arm/early-printk: move UART base address to Rules.mk
The UART memory mapped base address is currently hardcoded in the
early-printk UART driver, which denies the driver to be used by
two machines with a different mapping.
Move this definition out to xen/arch/arm/Rules.mk, allowing easier
user access and later sharing of the driver.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:20:33 +01:00
Andre Przywara 130645eee3 arm/early-printk: allow skipping of UART init
While it seems obvious to initialize the UART before using it, chances
are that some firmware code or the bootloader already did this.
So it may actually be a good idea to skip the initialization, in fact
this fixes early printk on my TC2 Versatile Express.
So provide an option in xen/arch/arm/Rules.mk to only initialize the
UART when needed.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:20:29 +01:00
Andre Przywara b68346247f arm/early-printk: calculate baud rate divisor from user provided value
For early-printk the used baud rate was hardcoded in the code, using
precalculated divisor values.
Let the calculation of these values be done by the preprocessor and
use a human readable value in xen/arch/arm/Rules.mk to drive this.

Signed-off-by: Andre Przywara <andre.przywara@calxeda.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:20:10 +01:00
Julien Grall 54353cae09 xen/arm: check string format for early_printk
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:15:25 +01:00
Julien Grall cafdceb66e xen/arm: avoid lost characters with early_printk
Introduce the function early_flush to wait until the UART has finished to
transfer the character.
When early printk is enabled, it's possible to loose the last characters if:
    - the UART is initialized by the UART driver
    - Xen hang

This is result to a truncated message. To be sure that the message is fully
transfered by early_printk, add a call to early_flush. This will avoid lost
characters.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:14:48 +01:00
George Dunlap 121dac93af xl: Return an error if an empty file is passed to cd-insert
Two changes:
* Stat the file before calling libxl_cdrom_insert()
* Return an error if anything fails (including libxl_cdrom_insert)

This is in part to work around the fact that the RAW disk type
is used for things that aren't actually files; so we can't call
stat in libxl_device.c:libxl__device_disk_set_backend() because
it may be going over a remote protocol.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:10:51 +01:00
Christoph Egger 1ecd5e015d stubdom: Make stubdom buildsystem consistent with tools buildsystem
Use FETCHER for stubdom, too. This makes stubdom buildsystem
more consistent with tools buildsystem.
Fixes toplevel configure failure if wget is not found
independent if we are going to build stubdom or not.

Signed-off-by: Christoph Egger <chegger@amazon.de>
Reviewed-by: Matt Wilson <msw@amazon.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:07:53 +01:00
Konrad Rzeszutek Wilk d21b46e9b7 xl, e820_host, PV passthrough: Fix guests crashing when memory == maxmem
The code had an obvious bug where it would assume that the balloon
amount would always be _something_ and add an E820_RAM entry at the
end of the E820 array. The added E820_RAM would contain the balloon amount
plus the delta of memory that had to be subtracted b/c of the various
E820 entries. That assumption is certainly true when maxmem != mem,
but if guest config has maxmem = memory that is incorrect (as balloon
value is zero). The end result is that the E820 that is constructed
is missing a swath of "delta" memory and in most cases ends up with
only one E820_RAM entry that is of 512MB size on many Intel systems.

Reported-by: Christian Holpert <christian@holpert.de>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-30 09:01:24 +01:00
Ian Jackson 41abbadef6 libxc: limit cpu values when setting vcpu affinity
When support for pinning more than 64 cpus was added, check for cpu
out-of-range values was removed. This can lead to subsequent
out-of-bounds cpumap array accesses in case the cpu number is higher
than the actual count.

This patch returns the check.

This is CVE-2013-2072 / XSA-56

Signed-off-by: Petr Matousek <pmatouse@redhat.com>
4.3.0-rc3
2013-05-29 15:49:22 +01:00
Jan Beulich ae5092f420 x86: re-enable VCPUOP_register_vcpu_time_memory_area
By moving the call to update_vcpu_system_time() out of schedule() into
arch-specific context switch code, the original problem of the function
accessing the wrong domain's address space goes away (obvious even from
patch context, as update_runstate_area() does similar copying).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2013-05-27 08:59:38 +02:00
Ian Campbell da3bca931f Merge branch 'staging' of ssh://xenbits.xen.org/home/xen/git/xen into staging 2013-05-23 14:23:32 +01:00
Julien Grall 7312c21dbd drivers/exynos4210: Return -ENOMEM when ioremap has failed
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
2013-05-23 12:55:17 +01:00
Jaeyong Yoo 9f5179a4ec xen/arm: Disable interrupts for the entire duration of the context switch
Not just while saving state. Otherwise there is a race between interrupts
arriving and updating the LR state and gic_restore_state overwriting them with
the saved state.

With this change we no longer need to disable interrupts in gic_restore_state.

Signed-off-by: Jaeyong Yoo <jaeyong.yoo@samsung.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ ijc -- rewrote commit message ]
2013-05-23 12:51:51 +01:00
Eric Shelton 47f71a8ccb x86/EFI: fix boot for pre-UEFI systems
efi/boot.c makes a call to QueryVariableInfo on all systems.  However,
as it is only promised for UEFI 2.0+ systems, pre-UEFI systems can
hang or crash on this call.  The below patch adds a version check, a
technique used in other parts of the Xen EFI codebase.

Signed-off-by: Eric Shelton <eshelton@pobox.com>

Check runtime services version instead of EFI version (while generally
they would be in sync, nothing requires them to be).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2013-05-23 13:08:51 +02:00
Jan Beulich 234c4dde2f x86: fix boot time APIC mode detection
current_cpu_data becomes valid only relatively late in the boot
process, so looking there for a particular feature early in the game
would generally give the appearance of the feature being unavailable.

Getting this wrong means that at kexec time the system would get
returned to xAPIC mode, causing disconnect_bsp_APIC() to try to access
the APIC page, which on systems with x2APIC pre-enabled will never get
set up.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
2013-05-23 13:08:32 +02:00
Ian Murray 13b37b6e08 hotplug/Linux: xendomains compatibility with xl
The xl save file uses a different header string to the xm one. Teach the
xendomains script about it.

Signed-off-by: Ian MURRAY <murrayie@yahoo.co.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- rewrote commit message ]
2013-05-23 11:35:07 +01:00
Julien Grall 0bb8977dca xen/arm: Remove leading +1 when hypervisor compat property is created
When a static array with string is created, the size of this array contains
the \0.

This error was raised with gcc 4.7 because, the local variables are not always
initialized to 0.

Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2013-05-23 11:35:04 +01:00
Wei Liu 9204bc6545 netif: document feature-split-event-channel
This is a new feature to separate TX and RX notification. Document it in
canonical header for future reference.

For reference implementation, please see Xen network driver in Linux kernel.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
2013-05-22 16:44:45 +02:00
Andrew Cooper 6d243308e1 AMD/iommu: SR56x0 Erratum 64 - Reset all head & tail pointers
Reference at time of patch:
http://support.amd.com/us/ChipsetMotherboard_TechDocs/46303.pdf

Erratum 64 states that the head and tail pointers for the Command buffer and
Event log are only reset on a cold boot, not a warm boot.

While the erratum is limited to systems using SR56xx chipsets (such as Family
10h CPUs), resetting the pointers is a sensible action in all cases, including
the PPR log for consistency.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
2013-05-22 15:26:52 +02:00