From owner-svn-src-head@freebsd.org Thu Jan 23 01:21:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84EAF22531A; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4834Gh2xWrz3JkX; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6048C6A75; Thu, 23 Jan 2020 01:21:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00N1L0b8024023; Thu, 23 Jan 2020 01:21:00 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00N1L06o024017; Thu, 23 Jan 2020 01:21:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202001230121.00N1L06o024017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Thu, 23 Jan 2020 01:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357003 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 357003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jan 2020 01:21:00 -0000 Author: glebius Date: Thu Jan 23 01:20:59 2020 New Revision: 357003 URL: https://svnweb.freebsd.org/changeset/base/357003 Log: Add ie_hflags to struct intr_event, which accumulates flags from all handlers on this event. For now handle only IH_ENTROPY in that manner. Modified: head/sys/kern/kern_intr.c head/sys/sys/interrupt.h Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Wed Jan 22 23:28:42 2020 (r357002) +++ head/sys/kern/kern_intr.c Thu Jan 23 01:20:59 2020 (r357003) @@ -190,7 +190,7 @@ intr_event_update(struct intr_event *ie) /* Start off with no entropy and just the name of the event. */ mtx_assert(&ie->ie_lock, MA_OWNED); strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname)); - ie->ie_flags &= ~IE_ENTROPY; + ie->ie_hflags = 0; missed = 0; space = 1; @@ -203,8 +203,7 @@ intr_event_update(struct intr_event *ie) space = 0; } else missed++; - if (ih->ih_flags & IH_ENTROPY) - ie->ie_flags |= IE_ENTROPY; + ie->ie_hflags |= ih->ih_flags; } /* @@ -958,7 +957,7 @@ intr_event_schedule_thread(struct intr_event *ie) * If any of the handlers for this ithread claim to be good * sources of entropy, then gather some. */ - if (ie->ie_flags & IE_ENTROPY) { + if (ie->ie_hflags & IH_ENTROPY) { entropy.event = (uintptr_t)ie; entropy.td = ctd; random_harvest_queue(&entropy, sizeof(entropy), RANDOM_INTERRUPT); @@ -1492,18 +1491,12 @@ db_dump_intr_event(struct intr_event *ie, int handlers db_printf("(pid %d)", it->it_thread->td_proc->p_pid); else db_printf("(no thread)"); - if ((ie->ie_flags & (IE_SOFT | IE_ENTROPY | IE_ADDING_THREAD)) != 0 || + if ((ie->ie_flags & (IE_SOFT | IE_ADDING_THREAD)) != 0 || (it != NULL && it->it_need)) { db_printf(" {"); comma = 0; if (ie->ie_flags & IE_SOFT) { db_printf("SOFT"); - comma = 1; - } - if (ie->ie_flags & IE_ENTROPY) { - if (comma) - db_printf(", "); - db_printf("ENTROPY"); comma = 1; } if (ie->ie_flags & IE_ADDING_THREAD) { Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Wed Jan 22 23:28:42 2020 (r357002) +++ head/sys/sys/interrupt.h Thu Jan 23 01:20:59 2020 (r357003) @@ -118,6 +118,7 @@ struct intr_event { void (*ie_post_filter)(void *); int (*ie_assign_cpu)(void *, int); int ie_flags; + int ie_hflags; /* Cumulative flags of all handlers. */ int ie_count; /* Loop counter. */ int ie_warncnt; /* Rate-check interrupt storm warns. */ struct timeval ie_warntm; @@ -129,7 +130,6 @@ struct intr_event { /* Interrupt event flags kept in ie_flags. */ #define IE_SOFT 0x000001 /* Software interrupt. */ -#define IE_ENTROPY 0x000002 /* Interrupt is an entropy source. */ #define IE_ADDING_THREAD 0x000004 /* Currently building an ithread. */ /* Flags to pass to sched_swi. */