From owner-freebsd-net@FreeBSD.ORG Tue Nov 22 18:26:26 2011 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FE8F1065674 for ; Tue, 22 Nov 2011 18:26:26 +0000 (UTC) (envelope-from onemda@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0C0438FC0C for ; Tue, 22 Nov 2011 18:26:25 +0000 (UTC) Received: by vcbfl10 with SMTP id fl10so794777vcb.13 for ; Tue, 22 Nov 2011 10:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=dyA1h8WldVtcNwy9l0PtMjoOSezJOlOVabFv+kHh7I8=; b=LODM2cfVC5FtPxyHFBgBgC6hOqUvwV7byC3tN+ZzYfqFLq27fULkLq8qskudWq/mPp Z9MHcE8/nujLuCQ7dhlKvSXuUi3qqVcoP0PMm5FbsSDpv/9LCiQU9LU3T4dnVERSroMY egZuWlRclrNoyI3rrRKkFNiWY7b4DLqyYWCOA= MIME-Version: 1.0 Received: by 10.52.29.207 with SMTP id m15mr21462824vdh.100.1321986384757; Tue, 22 Nov 2011 10:26:24 -0800 (PST) Received: by 10.52.187.102 with HTTP; Tue, 22 Nov 2011 10:26:24 -0800 (PST) In-Reply-To: <20111122093357.GJ50300@deviant.kiev.zoral.com.ua> References: <20111122093357.GJ50300@deviant.kiev.zoral.com.ua> Date: Tue, 22 Nov 2011 18:26:24 +0000 Message-ID: From: "Paul B. Mahol" To: Kostik Belousov Content-Type: text/plain; charset=ISO-8859-1 Cc: net Subject: Re: [PATCH] ndis: safe fpu on amd64 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Nov 2011 18:26:26 -0000 On 11/22/11, Kostik Belousov wrote: > On Mon, Nov 21, 2011 at 03:49:16PM +0000, Paul B. Mahol wrote: >> Hi, >> >> This patch should fix panic on amd64 when using ndis with drivers >> which make use of fpu registers. > Do not allocate fpu_kern_ctx on stack. Its size is 528 bytes on amd64 right > now, and potentially can grow after AVX support is finished. So I need to introduce locks and allocate fpu_kern_ctx per CPU because otherwise memory leaks are possible.