763b78040d
config handling stack overflow CVE-2015-3259-xsa137.patch - Upstream patches from Jan 558bfaa0-x86-traps-avoid-using-current-too-early.patch 5592a116-nested-EPT-fix-the-handling-of-nested-EPT.patch 559b9dd6-x86-p2m-ept-don-t-unmap-in-use-EPT-pagetable.patch 559bdde5-pull-in-latest-linux-earlycpio.patch - Upstream patches from Jan pending review 552d0fd2-x86-hvm-don-t-include-asm-spinlock-h.patch 552d0fe8-x86-mtrr-include-asm-atomic.h.patch 552d293b-x86-vMSI-X-honor-all-mask-requests.patch 552d2966-x86-vMSI-X-add-valid-bits-for-read-acceleration.patch 554c7aee-x86-provide-arch_fetch_and_add.patch 554c7b00-arm-provide-arch_fetch_and_add.patch 55534b0a-x86-provide-add_sized.patch 55534b25-arm-provide-add_sized.patch 5555a4f8-use-ticket-locks-for-spin-locks.patch 5555a5b9-x86-arm-remove-asm-spinlock-h.patch 5555a8ec-introduce-non-contiguous-allocation.patch 55795a52-x86-vMSI-X-support-qword-MMIO-access.patch 557eb55f-gnttab-per-active-entry-locking.patch 557eb5b6-gnttab-introduce-maptrack-lock.patch 557eb620-gnttab-make-the-grant-table-lock-a-read-write-lock.patch 557ffab8-evtchn-factor-out-freeing-an-event-channel.patch 5582bf43-evtchn-simplify-port_is_valid.patch 5582bf81-evtchn-remove-the-locking-when-unmasking-an-event-channel.patch 5583d9c5-x86-MSI-X-cleanup.patch 5583da09-x86-MSI-track-host-and-guest-masking-separately.patch 5583da64-gnttab-use-per-VCPU-maptrack-free-lists.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=369
87 lines
3.3 KiB
Diff
87 lines
3.3 KiB
Diff
# Commit 5a9899ddc42040e139233a6b1f0f65f3b65eda6d
|
|
# Date 2015-06-15 13:23:34 +0200
|
|
# Author David Vrabel <david.vrabel@citrix.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
gnttab: introduce maptrack lock
|
|
|
|
Split grant table lock into two separate locks. One to protect
|
|
maptrack free list (maptrack_lock) and one for everything else (lock).
|
|
|
|
Based on a patch originally by Matt Wilson <msw@amazon.com>.
|
|
|
|
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
|
|
Reviewed-by: Jan Beulich <jbeulich@suse.com>
|
|
|
|
--- sle12sp1.orig/docs/misc/grant-tables.txt 2015-07-08 13:49:42.000000000 +0200
|
|
+++ sle12sp1/docs/misc/grant-tables.txt 2015-07-08 13:49:46.000000000 +0200
|
|
@@ -87,6 +87,7 @@ is complete.
|
|
inconsistent grant table state such as current
|
|
version, partially initialized active table pages,
|
|
etc.
|
|
+ grant_table->maptrack_lock : spinlock used to protect the maptrack free list
|
|
active_grant_entry->lock : spinlock used to serialize modifications to
|
|
active entries
|
|
|
|
@@ -94,6 +95,9 @@ is complete.
|
|
that access members of struct grant_table must acquire the lock
|
|
around critical sections.
|
|
|
|
+ The maptrack free list is protected by its own spinlock. The maptrack
|
|
+ lock may be locked while holding the grant table lock.
|
|
+
|
|
Active entries are obtained by calling active_entry_acquire(gt, ref).
|
|
This function returns a pointer to the active entry after locking its
|
|
spinlock. The caller must hold the grant table lock for the gt in
|
|
--- sle12sp1.orig/xen/common/grant_table.c 2015-07-08 13:49:42.000000000 +0200
|
|
+++ sle12sp1/xen/common/grant_table.c 2015-07-08 13:49:46.000000000 +0200
|
|
@@ -288,10 +288,10 @@ static inline void
|
|
put_maptrack_handle(
|
|
struct grant_table *t, int handle)
|
|
{
|
|
- spin_lock(&t->lock);
|
|
+ spin_lock(&t->maptrack_lock);
|
|
maptrack_entry(t, handle).ref = t->maptrack_head;
|
|
t->maptrack_head = handle;
|
|
- spin_unlock(&t->lock);
|
|
+ spin_unlock(&t->maptrack_lock);
|
|
}
|
|
|
|
static inline int
|
|
@@ -303,7 +303,7 @@ get_maptrack_handle(
|
|
struct grant_mapping *new_mt;
|
|
unsigned int new_mt_limit, nr_frames;
|
|
|
|
- spin_lock(&lgt->lock);
|
|
+ spin_lock(&lgt->maptrack_lock);
|
|
|
|
while ( unlikely((handle = __get_maptrack_handle(lgt)) == -1) )
|
|
{
|
|
@@ -332,7 +332,7 @@ get_maptrack_handle(
|
|
nr_frames + 1);
|
|
}
|
|
|
|
- spin_unlock(&lgt->lock);
|
|
+ spin_unlock(&lgt->maptrack_lock);
|
|
|
|
return handle;
|
|
}
|
|
@@ -2874,6 +2874,7 @@ grant_table_create(
|
|
|
|
/* Simple stuff. */
|
|
spin_lock_init(&t->lock);
|
|
+ spin_lock_init(&t->maptrack_lock);
|
|
t->nr_grant_frames = INITIAL_NR_GRANT_FRAMES;
|
|
|
|
/* Active grant table. */
|
|
--- sle12sp1.orig/xen/include/xen/grant_table.h 2015-01-14 18:44:18.000000000 +0100
|
|
+++ sle12sp1/xen/include/xen/grant_table.h 2015-07-08 13:49:46.000000000 +0200
|
|
@@ -82,6 +82,8 @@ struct grant_table {
|
|
struct grant_mapping **maptrack;
|
|
unsigned int maptrack_head;
|
|
unsigned int maptrack_limit;
|
|
+ /* Lock protecting the maptrack page list, head, and limit */
|
|
+ spinlock_t maptrack_lock;
|
|
/* Lock protecting updates to active and shared grant tables. */
|
|
spinlock_t lock;
|
|
/* The defined versions are 1 and 2. Set to 0 if we don't know
|