From owner-freebsd-current@FreeBSD.ORG Sat Mar 1 02:00:58 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5A700AA; Sat, 1 Mar 2014 02:00:58 +0000 (UTC) Received: from mail-qa0-x22c.google.com (mail-qa0-x22c.google.com [IPv6:2607:f8b0:400d:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EA21B117E; Sat, 1 Mar 2014 02:00:57 +0000 (UTC) Received: by mail-qa0-f44.google.com with SMTP id f11so1434715qae.17 for ; Fri, 28 Feb 2014 18:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=3DAoUwiBzc1y9XhtAxNBwRBbTOsU99x+1KPMoG3bTEE=; b=u+hTw9PwPnVjQaYgRotNfsi1JnAeHS8kHftj9x9/0ufF2K5dsxaP1ceMfv1Sfdykhu eYihezhdiiRewdNYS8SrLx2n/AXCUgjFyiXCmETOZBiS0aexnEMM439ZMAqxd1hsERHZ 3j8wNcPi1TiqExUXM1cIG0inFS/mykGKOxUtr2V3eKY6fJwaQGgs72A/Q8VLyAXZzTuu xldVnp2f0kjKi36jnUpXUVoHsHp4r5DNfx87Dd6A8DOZUELg5ne/ITeckub0A9DC6CLx IbORBkCuPFdSUWEHCHdiqV/3ssSbtGqUYCAmOeK+6GZDa6jVHy8AIn9GrdRWhYfA0KJi lrrg== MIME-Version: 1.0 X-Received: by 10.140.26.240 with SMTP id 103mr7821849qgv.92.1393639257101; Fri, 28 Feb 2014 18:00:57 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.224.16.10 with HTTP; Fri, 28 Feb 2014 18:00:57 -0800 (PST) In-Reply-To: References: <201402281608.30515.jhb@freebsd.org> Date: Fri, 28 Feb 2014 18:00:57 -0800 X-Google-Sender-Auth: Exv69tsWWh2ogHohNwn-Rb6Jok4 Message-ID: Subject: Re: signal 8 (floating point exception) upon resume From: Adrian Chadd To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-current , "freebsd-mobile@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 02:00:58 -0000 On 28 February 2014 15:35, Adrian Chadd wrote: > ... how'd this ever work in the past then? > .. and I've submitted it as a PR: kern/187152 Thanks, -a > > -a > > > On 28 February 2014 13:08, John Baldwin wrote: >> On Friday, February 28, 2014 1:15:45 pm Adrian Chadd wrote: >>> Hi, >>> >>> On my i386 -HEAD laptops (running -HEAD as of last night, but it's >>> been a problem for a while) I occasionally hit a point where I get an >>> FPE on _all_ processes upon resume. >>> >>> I can still do a clean shutdown through the power-button method, but I >>> can't do anything else. >>> >>> Has anyone seen this before? Does anyone have an inkling of an idea >>> why I'd be getting FPE's for things like ps and sh? >> >> I'm guessing fpcurthread is stale. We should probably be flushing >> the FPU state on suspend and starting off without any FPU state on >> resume. >> >> Ah, see this bit here in x86/acpica/acpi_wakeup.c: >> >> >> int >> acpi_sleep_machdep(struct acpi_softc *sc, int state) >> { >> ... >> if (savectx(susppcbs[0])) { >> #ifdef __amd64__ >> ctx_fpusave(susppcbs[0]->pcb_fpususpend); >> #endif >> ... >> } >> >> Looks like you need to implement ctx_fpusave() for i386. kib@ did it as part >> of the AVX work, but I wonder if you can just steal the amd64 ctx_fpusave() >> and have it call npxsave() instead of fpxsave()? Not sure if you'd need it to >> be in asm as it is on amd64 or if you can do this in C. >> >> -- >> John Baldwin