Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2015-03-05 22:07:58 +0100
committerJiri Kosina <jkosina@suse.cz>2015-03-05 22:07:58 +0100
commit7d96a60937aa38600149ca9e8e73e947d23e525b (patch)
tree734594cf069c45765a4181408ec91a276d0531b7
parent47249383bf008f673c6d31fe51fe6e83c2617b55 (diff)
xen: x86, tls: Interpret an all-zero struct user_desc as
"no segment" (bsc#920250): provide LDT_zero() for Xen
-rw-r--r--patches.xen/xen3-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch35
-rw-r--r--series.conf1
2 files changed, 36 insertions, 0 deletions
diff --git a/patches.xen/xen3-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch b/patches.xen/xen3-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch
new file mode 100644
index 0000000000..1db8826f99
--- /dev/null
+++ b/patches.xen/xen3-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch
@@ -0,0 +1,35 @@
+From: Jiri Kosina <jkosina@suse.cz>
+Subject: xen: x86, tls: Interpret an all-zero struct user_desc as "no segment"
+References: bsc#920250
+Patch-mainline: no
+
+Have LDT_zero() defined for Xen as well, as it's needed by
+patches.arch/02-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch
+
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+
+---
+Index: linux-3.0-SLE11-SP3-fasttrack-bnc920250/arch/x86/include/mach-xen/asm/desc.h
+===================================================================
+--- linux-3.0-SLE11-SP3-fasttrack-bnc920250.orig/arch/x86/include/mach-xen/asm/desc.h 2015-03-05 21:49:40.761104401 +0100
++++ linux-3.0-SLE11-SP3-fasttrack-bnc920250/arch/x86/include/mach-xen/asm/desc.h 2015-03-05 21:49:41.077119820 +0100
+@@ -282,6 +282,19 @@
+ (info)->seg_not_present == 1 && \
+ (info)->useable == 0)
+
++/* Lots of programs expect an all-zero user_desc to mean "no segment at all". */
++static inline bool LDT_zero(const struct user_desc *info)
++{
++ return (info->base_addr == 0 &&
++ info->limit == 0 &&
++ info->contents == 0 &&
++ info->read_exec_only == 0 &&
++ info->seg_32bit == 0 &&
++ info->limit_in_pages == 0 &&
++ info->seg_not_present == 0 &&
++ info->useable == 0);
++}
++
+ #ifdef CONFIG_X86_64
+ #define LDT_empty(info) (_LDT_empty(info) && ((info)->lm == 0))
+ #else
diff --git a/series.conf b/series.conf
index 0a8b8bcf19..a27e2f80bd 100644
--- a/series.conf
+++ b/series.conf
@@ -17249,6 +17249,7 @@
patches.xen/xen3-x86_64-traps-fix-the-espfix64-df-fixup-and-rewrite-it-in-c.patch
patches.xen/xen3-x86_64-traps-stop-using-ist-for-ss.patch
patches.xen/xen3-x86_64-traps-rework-bad_iret.patch
+ patches.xen/xen3-x86-tls-interpret-an-all-zero-struct-user_desc-as-no-segment.patch
# bugfixes and enhancements
patches.xen/xen-hypercall-symbols