From owner-svn-src-stable@FreeBSD.ORG Wed Feb 27 22:02:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9386395C; Wed, 27 Feb 2013 22:02:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D5DB35C; Wed, 27 Feb 2013 22:02:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1RM2fAg021969; Wed, 27 Feb 2013 22:02:41 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1RM2f6P021968; Wed, 27 Feb 2013 22:02:41 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201302272202.r1RM2f6P021968@svn.freebsd.org> From: John Baldwin Date: Wed, 27 Feb 2013 22:02:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r247423 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2013 22:02:41 -0000 Author: jhb Date: Wed Feb 27 22:02:40 2013 New Revision: 247423 URL: http://svnweb.freebsd.org/changeset/base/247423 Log: MFC 240921: Add optional entropy harvesting for software interrupts in swi_sched() as controlled by kern.random.sys.harvest.swi. SWI harvesting feeds into the interrupt FIFO and each event is estimated as providing a single bit of entropy. Modified: stable/9/sys/kern/kern_intr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_intr.c ============================================================================== --- stable/9/sys/kern/kern_intr.c Wed Feb 27 21:58:06 2013 (r247422) +++ stable/9/sys/kern/kern_intr.c Wed Feb 27 22:02:40 2013 (r247423) @@ -1144,11 +1144,21 @@ swi_sched(void *cookie, int flags) { struct intr_handler *ih = (struct intr_handler *)cookie; struct intr_event *ie = ih->ih_event; + struct intr_entropy entropy; int error; CTR3(KTR_INTR, "swi_sched: %s %s need=%d", ie->ie_name, ih->ih_name, ih->ih_need); + if (harvest.swi) { + CTR2(KTR_INTR, "swi_sched: pid %d (%s) gathering entropy", + curproc->p_pid, curthread->td_name); + entropy.event = (uintptr_t)ih; + entropy.td = curthread; + random_harvest(&entropy, sizeof(entropy), 1, 0, + RANDOM_INTERRUPT); + } + /* * Set ih_need for this handler so that if the ithread is already * running it will execute this handler on the next pass. Otherwise,