From: Juergen Gross <jgross@suse.com>
To: billm@melbpc.org.au, luto@amacapital.net, linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>
Subject: [PATCH] x86: correct fpu emulation access to ldt
Date: Tue, 4 Aug 2015 17:02:40 +0200 [thread overview]
Message-ID: <1438700560-1778-1-git-send-email-jgross@suse.com> (raw)
Commit 14805442532c ("x86/ldt: Make modify_ldt synchronous") introduced
a new struct ldt_struct anchored at mm->context.ldt.
Adapt the x86 fpu emulation to use that new structure.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/math-emu/fpu_entry.c | 1 +
arch/x86/math-emu/fpu_system.h | 2 +-
arch/x86/math-emu/get_address.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c
index f37e84a..97820c24 100644
--- a/arch/x86/math-emu/fpu_entry.c
+++ b/arch/x86/math-emu/fpu_entry.c
@@ -30,6 +30,7 @@
#include <asm/uaccess.h>
#include <asm/traps.h>
#include <asm/desc.h>
+#include <asm/mmu_context.h>
#include <asm/user.h>
#include <asm/fpu/internal.h>
diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h
index 9ccecb6..7c7af3a 100644
--- a/arch/x86/math-emu/fpu_system.h
+++ b/arch/x86/math-emu/fpu_system.h
@@ -18,7 +18,7 @@
/* s is always from a cpu register, and the cpu does bounds checking
* during register load --> no further bounds checks needed */
-#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3])
+#define LDT_DESCRIPTOR(s) (current->mm->context.ldt->entries[(s) >> 3])
#define SEG_D_SIZE(x) ((x).b & (3 << 21))
#define SEG_G_BIT(x) ((x).b & (1 << 23))
#define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1)
diff --git a/arch/x86/math-emu/get_address.c b/arch/x86/math-emu/get_address.c
index 6ef5e99..4f83d09 100644
--- a/arch/x86/math-emu/get_address.c
+++ b/arch/x86/math-emu/get_address.c
@@ -21,6 +21,7 @@
#include <asm/uaccess.h>
#include <asm/desc.h>
+#include <asm/mmu_context.h>
#include "fpu_system.h"
#include "exception.h"
--
2.1.4
next reply other threads:[~2015-08-04 15:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-04 15:02 Juergen Gross [this message]
2015-08-04 18:01 ` Andy Lutomirski
2015-08-05 9:11 ` Juergen Gross
2015-08-05 18:24 ` Andy Lutomirski
2015-08-06 3:35 ` Juergen Gross
2015-08-06 4:38 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1438700560-1778-1-git-send-email-jgross@suse.com \
--to=jgross@suse.com \
--cc=billm@melbpc.org.au \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®