From owner-freebsd-mips@FreeBSD.ORG Thu Sep 29 07:19:51 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25D57106564A for ; Thu, 29 Sep 2011 07:19:51 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id BA1768FC12 for ; Thu, 29 Sep 2011 07:19:50 +0000 (UTC) Received: by wyj26 with SMTP id 26so138550wyj.13 for ; Thu, 29 Sep 2011 00:19:49 -0700 (PDT) Received: by 10.227.179.76 with SMTP id bp12mr3306090wbb.82.1317278982062; Wed, 28 Sep 2011 23:49:42 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.58.139 with HTTP; Wed, 28 Sep 2011 23:49:22 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Wed, 28 Sep 2011 23:49:22 -0700 X-Google-Sender-Auth: PocXnke5HSDmt0D2ydAJ8-tahRA Message-ID: To: "Jayachandran C." Content-Type: text/plain; charset=UTF-8 Cc: freebsd-mips@freebsd.org Subject: Re: eventtimer issue on mips: temporary workaround X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Sep 2011 07:19:51 -0000 On Wed, Sep 28, 2011 at 23:41, Jayachandran C. wrote: > the amd implementation seems to be using the STI instruction to enable > interrupts - but I'm not able to see how to avoid this race condition > on platforms which does not have a similar instruction. If I'm understanding right, that's much of the thrust of the problem. I mean, we can check whether a non-masked interrupt was asserted before doing the wait, but there's still a window between that and the wait. It sounds like we need a conditional wait instruction, which is to say it sounds like the code does need a rethink for MIPS (although why "wait" wouldn't return immediately if there's a non-masked interrupt asserted is beyond me.) But I'm still somewhat confused by the original post, so may be missing the mark on that.