From owner-freebsd-current@FreeBSD.ORG Thu Jun 17 19:44:58 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0FEBD16A4CE for ; Thu, 17 Jun 2004 19:44:58 +0000 (GMT) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7181A43D1D for ; Thu, 17 Jun 2004 19:44:57 +0000 (GMT) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2657.72) id ; Thu, 17 Jun 2004 15:44:17 -0400 Message-ID: From: Don Bowman To: 'Julian Elischer' , Don Bowman Date: Thu, 17 Jun 2004 15:44:16 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain; charset="iso-8859-1" cc: "'current@freebsd.org'" Subject: RE: STI, HLT in acpi_cpu_idle_c1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Thu, 17 Jun 2004 19:44:58 -0000 From: Julian Elischer [mailto:julian@elischer.org] > On Thu, 17 Jun 2004, Don Bowman wrote: > > > > > in the intel instruction manual, the effect > > of STI is that interrupts are enabled > > *after* the next instruction. > > > > ie: > > > > sti > > ret > > ... > > > > the return is still run with interrupts disabled > > (if they were prior to the STI). > > > > In acpi_cpu_idle_c1, it does: > > > > sti > > hlt > > > > shouldn't there be a NOP in there so that interrupts > > are guaranteed on? > > I think your reading of it is right.. > but I also think that if it was ALWAYS right we'd see processors > go idle and never wake up again.... > Since this doesn't seem to happen, maybe ther eis a bug in > the emulator? My theory is there are two code paths to get there, 1 with interrupts enabled, and one without. The 'STI' seems to be there as a form of protection for the 2nd case. I'm adding the nop and restarting the test. The emulator is correct, in the normal case it shows interrupts enabled on entry to that function.