From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934724AbbHDPCs (ORCPT ); Tue, 4 Aug 2015 11:02:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:33604 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932473AbbHDPCq (ORCPT ); Tue, 4 Aug 2015 11:02:46 -0400 From: Juergen Gross To: billm@melbpc.org.au, luto@amacapital.net, linux-kernel@vger.kernel.org Cc: Juergen Gross Subject: [PATCH] x86: correct fpu emulation access to ldt Date: Tue, 4 Aug 2015 17:02:40 +0200 Message-Id: <1438700560-1778-1-git-send-email-jgross@suse.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 #include #include +#include #include #include 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 #include +#include #include "fpu_system.h" #include "exception.h" -- 2.1.4