Commit Graph
24430 Commits
Author SHA1 Message Date
Lasse Collin 9bc32f2d7d Decompressors: fix header validation in unlzma.c
From: Lasse Collin <lasse.collin@tukaani.org>

Validation of header.pos calls error() but doesn't make the function
return to indicate an error to the caller.  Instead the decoding is
attempted with invalid header.pos.  This fixes it.

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 14:32:03 +01:00
Lasse Collin b9f2ce10ef Decompressors: remove unused function from unlzma.c
From: Lasse Collin <lasse.collin@tukaani.org>

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 14:31:38 +01:00
Phillip Lougher 072eb7aba6 bzip2: Add missing checks for malloc returning NULL
From: Phillip Lougher <phillip@lougher.demon.co.uk>

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 14:30:36 +01:00
Lasse Collin 8901ea9184 Decompressors: get rid of set_error_fn() macro
From: Lasse Collin <lasse.collin@tukaani.org>

set_error_fn() is a useless complication. Only unlzma.c had some use
for it and that was easy to change too.

This also gets rid of the static function pointer "error".

Signed-off-by: Lasse Collin <lasse.collin@tukaani.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 14:29:21 +01:00
Jan Beulich 3d4e3e903e multicall: don't ignore failure from __copy_to_guest() upon preemption
At once adjust perf counter updates to also count calls from here even
if a guest memory access failed.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-11 14:27:41 +01:00
Jan Beulich 62a359f77b x86/amd-ucode: further turn down verbosity
Turn up the log level on various (mostly debug-only) messages.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-11 14:26:48 +01:00
Jan Beulich 349cfdbfe6 x86: quiesce cpuidle code
So far these messages got pointlessly (as the code in other places
assumes symmetric configuration) emitted once per CPU. Hide the debug
one behind opt_cpu_info, and issue the info one just once (if the code
gets adjusted to support assymtric configurations, this would need to
be revisited, but ideally without producing per-CPU messages again).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-11 14:25:16 +01:00
Wei Wang c13c2d2a0d amd iommu: Introduce iommu_has_cap() function
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:06:01 +01:00
Wei Wang 05498eaf28 amd iommu: Compress hyper-transport flags into a single byte
These flags are single bit, no need to be saved as integers.
Add 3 inline helpers to make single bit access easier.
Introduce iommu_has_ht_flag and set_iommu_ht_flags

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:05:14 +01:00
Wei Wang c909d60949 amd iommu: Disable debug output for early DTE update
Some systems may have IVHD device entries that cover large device id range.
Having those entries displayed will take very long time to boot.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:04:41 +01:00
Wei Wang 6757a17b2a amd iommu: Simplify IVHD device flag handling
These bits are aligned to corresponding fields in device table entry. They
can be updated by a single device entry write.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:04:10 +01:00
Wei Wang 756273ab10 amd iommu: Cleanup iommu pci capabilites detection
* Define new structure to represent capability block.
* Remove unnecessary read for unused information.
* Add sanity check into get_iommu_capabilities.
* iommu capability offset is 16 bit not 8 bit, fix that.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:03:21 +01:00
Wei Wang ce56a70bd7 amd iommu: Use pci access function to detect msi capabilities
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 12:01:55 +01:00
Jean Guyader f4038d2b7c Hypercall continuation cancelation in compat mode for XENMEM_get/set_pod_target
If copy_to_guest failed in the compat code after a continuation as been
done in the native code we need to cancel it so we won't reexecute the
hypercall but return from the hypercall with the appropriate error.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-11 10:14:22 +01:00
Jan Beulich e448617ff9 x86/IRQ: eliminate irq_vector[]
The vector is already being tracked in struct irq_desc's arch.vector
member, so there's no real need for a second place where this to get
stored. The only caveat is that legacy vectors (used for interrupts
handled through the 8259) must be special cased to not prevent non-
legacy vectors from being assigned.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-11 09:47:40 +01:00
Tim Deegan c05b1a4186 x86/mm: Refactor p2m get_entry accessor
Move the main query accessor to the p2m outside of an inline and into the
p2m code itself. This will allow for p2m internal locking to be added
to the accessor later.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-11-10 11:12:35 +00:00
Tim Deegan 94d9bf1a38 x86/mm: Enforce ordering constraints for the page alloc lock in the PoD code
The page alloc lock is sometimes used in the PoD code, with an
explicit expectation of ordering. Use our ordering constructs in the
mm layer to enforce this.

The additional book-keeping variables are kept in the arch_domain
sub-struct, as they are x86-specific to the whole domain.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-11-10 11:12:35 +00:00
Tim Deegan 3ceb653eb5 x86/mm: Declare an order-enforcing construct for external locks used in the mm layer
Declare an order-enforcing construct for a lock used in the mm layer
that is not of type mm_lock_t. This is useful whenever the mm layer
takes locks from other subsystems, or locks not implemented as
mm_lock_t.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-11-10 11:12:35 +00:00
Tim Deegan 5865e0c533 x86/mm: Refactor mm-lock ordering constructs
The mm layer has a construct to enforce locks are taken in a pre-
defined order, and thus avert deadlock. Refactor pieces of this
code for later use, no functional changes.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
2011-11-10 11:12:35 +00:00
Ian Campbell 75fb78ef66 add a comment for hypercall_xlat_continuation
The interface of this function is really rather complex and having reverse
engineered it for the N'th time I think it is time to write things down.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-10 10:24:19 +01:00
Jan Beulich ff51b780c3 VMX: extend last branch MSR info to cover newer CPU models #2
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: "Shan, Haitao" <haitao.shan@intel.com>
2011-11-09 10:37:45 +01:00
Jan Beulich e501d9f69b x86/MSI: fix dump_msi() after c/s 24068:6928172f7ded
The function must not blindly take the lock on IRQ descriptors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2011-11-09 10:36:20 +01:00
Jean Guyader 35a5ddf29a xsm: Add support for HVMOP_track_dirty_vram.
Xen try to inforce the xsm policy when a HVMOP_track_dirty_vram
is received (xen/arch/x86/hvm/hvm.c:3637). It was failing because
in flask_hvmcontext, xsm didn't have any case for this operation.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-08 19:41:47 +00:00
Olaf Hering 2b7ee729c5 mem_event: check capabilities only once
It is not required to check the system capabilities during every domctl.
Rearrange the code to check them only once.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-08 19:35:42 +00:00
Olaf Hering 80b73b501b xenpaging: compare domain pointer in p2m_mem_paging_populate
Compare just the domain pointer instead of the domain_id number.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-08 19:35:01 +00:00
Keir Fraser 1186671a0e waitqueue: Double size of x86 shadow stack.
Signed-off-by: Keir Fraser <keir@xen.org>
2011-11-08 19:33:46 +00:00
Jan Beulich 666578d701 x86/cpuidle: clean up hw residencies reading code
Fold redundant code and eliminate pointless casts.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-08 17:30:00 +01:00
Jan Beulich 4779dc810e bump sysctl interface version after c/s 23995:8943a9696358
That c/s made binary incompatible changes to struct pm_cx_stat.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-08 17:29:31 +01:00
Jan Beulich 56a0652b05 x86/IRQ: create_irq() should call assign_irq_vector()
... rather than __assign_irq_vector(), to ensure desc->affinity gets
initialized properly.

This at once eliminates the need to forward-declare the latter function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 17:28:31 +01:00
Jean Guyader a88942bf7e mm: Cleanup, use PAGE_ORDER_4K as page_order instead of "0".
Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
2011-11-08 13:01:41 +00:00
Wei Wang e38a069687 amd iommu: enable ats devices
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-08 11:26:53 +01:00
Wei Wang d1e271f59d amd iommu: add iotlb invalidation command
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-08 11:26:13 +01:00
Wei Wang 67dca204c4 ats: Add new ATS helper functions
Signed-off-by Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-08 11:25:51 +01:00
Wei Wang 3a1ba3c2e7 amd iommu: Fix iommu page size encoding when page order > 0.
Fix io address in invalid all pages command.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-08 11:25:19 +01:00
Wei Wang 83df02ecd3 ats: Move some ats functions to a new directory.
Remove VTD prefix from debug output.
passhrough/x86 holds vendor neutral codes for x86 architecture.

Signed-off-by: Wei Wang <wei.wang2@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
2011-11-08 11:24:11 +01:00
Jan Beulich 4e84a8fad0 eliminate remaining uses of struct irq_cfg
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:37:08 +01:00
Jan Beulich 22bdce1c04 eliminate first_cpu() etc
This includes the conversion from for_each_cpu_mask() to for_each-cpu().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:36:10 +01:00
Jan Beulich fe9ff5a9d5 eliminate cpu_clear()
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:35:12 +01:00
Jan Beulich e82e07391c eliminate cpu_set()
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:34:33 +01:00
Jan Beulich d814eb0255 eliminate cpu_test_xyz()
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:33:02 +01:00
Jan Beulich 8996e45431 eliminate cpus_xyz()
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
2011-11-08 10:31:47 +01:00
Jan Beulich 488355d213 IRQ: move a few more bits into common code
... as they're not really arch-specific.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-07 16:28:26 +01:00
Juergen Gross c3ffb81943 avoid hypervisor panic when printing lock profiling information
When printing lock profiling information via keyhandler in the
hypervisor the system will panic. This patch corrects the problem.

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
2011-11-07 14:37:51 +00:00
Juergen Gross d98feda5c7 Make lock profiling usable again
Using lock profiling (option lock_profile in xen/Rules.mk) resulted in
build errors.
Changes:
- Include public/sysctl.h in spinlock.h when using lock profiling.
- Allocate profile data in an own structure to avoid struct domain
  becoming larger then one page

Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-07 14:36:44 +00:00
Jan Beulich 4e3d89fbfa cpufreq: allocate CPU masks dynamically
struct cpufreq_policy, including a cpumask_t member, gets copied in
cpufreq_limit_change(), cpufreq_add_cpu(), set_cpufreq_gov(), and
set_cpufreq_para(). Make the member a cpumask_var_t, thus reducing the
amount of data needing copying (particularly with large NR_CPUS).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-07 10:29:14 +01:00
Jan Beulich 7b3b6e2648 powernow: don't read never initialized structure member
c/s 20361:51b031b0737e removed the writing of struct
processor_performance's shared_cpu_map member, but the powernow driver
still has code to read it (though presumably that code path can't be
taken on actual hardware supported by the powernow driver). Remove the
use of the field along with the field itself.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
2011-11-07 10:26:23 +01:00
Anthony PERARD 31b39b17c8 libxl: Remove a passthrough device through QMP.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
 tools/libxl/libxl_pci.c |   72 +++++++++++++++++++++++++++++++---------------
 1 files changed, 48 insertions(+), 24 deletions(-)
2011-11-04 15:34:50 +00:00
Anthony PERARD 2396de148a libxl: libxl_qmp: Introduce libxl__qmp_pci_del
To remove a pci passthough device from QEMU (upstream).

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
---
 tools/libxl/libxl_internal.h |    2 ++
 tools/libxl/libxl_qmp.c      |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 0 deletions(-)
2011-11-04 15:34:50 +00:00
Jan Beulich 8d1277c729 x86/IRQ: fix create_irq() after c/s 24068:6928172f7ded
init_one_irq_desc() must be called with interrupts enabled (as it may
call functions from the xmalloc() group). Rather than mis-using
vector_lock to also protect the finding of an unused IRQ, make this
lockless through using cmpxchg(), and obtain the lock only around the
actual assignment of the vector.

Also fold find_unassigned_irq() into its only caller.

It is, btw, questionable whether create_irq() calling
__assign_irq_vector() (rather than assign_irq_vector()) is actually
correct - desc->affinity appears to not get initialized properly in
this case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
2011-11-04 15:55:50 +01:00
Anthony PERARD 66a1a9c38d libxl: Use QMP to insert a passthrough device when using upstream QEMU
Also move the xenstore specific code to a new function and add a
message if sscanf fails.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
2011-11-04 14:24:07 +00:00