From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754531AbbHNTOj (ORCPT ); Fri, 14 Aug 2015 15:14:39 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:34304 "EHLO mail-oi0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbbHNTOh (ORCPT ); Fri, 14 Aug 2015 15:14:37 -0400 MIME-Version: 1.0 In-Reply-To: References: <20150814071500.GA2678@gmail.com> From: Andy Lutomirski Date: Fri, 14 Aug 2015 12:14:17 -0700 Message-ID: Subject: Re: [GIT PULL] x86 fixes To: Linus Torvalds Cc: Ingo Molnar , Juergen Gross , Andy Lutomirski , Linux Kernel Mailing List , Thomas Gleixner , "H. Peter Anvin" , Peter Zijlstra , Brian Gerst , Denys Vlasenko , Andrew Morton Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 14, 2015 at 11:57 AM, Linus Torvalds wrote: > On Fri, Aug 14, 2015 at 11:46 AM, Andy Lutomirski wrote: >> >> I think it's only slightly broken. >> >> This bit: >> >> if ((FPU_CS & 4) != 4) { /* Must be in the LDT */ >> /* Can only handle segmented addressing via the LDT >> for now, and it must be 16 bit */ >> printk("FPU emulator: Unsupported addressing mode\n"); >> math_abort(FPU_info, SIGILL); >> } >> >> code_descriptor = FPU_get_ldt_descriptor(FPU_CS); >> >> is buggy, but no buggier than the old code. > > That code seems fine to me (and explicitly errors out when it's not in > the LDT). FPU_CS is actually the CS selector value. > > So testing that for being in the LDT by checking bit #2, and then > using FPU_get_ldt_descriptor() on it actually seems *correct*. > By "buggy" I meant that it aborted if it was in the GDT but wasn't flat. This'll break if anyone does an emulated FP op on TLS data. --Andy