From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.3478.1670598160786405060 for ; Fri, 09 Dec 2022 07:02:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fwDoRL/C; spf=pass (domain: redhat.com, ip: 170.10.129.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670598159; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Y1pPvLf2wP2wir0zDMd+Q5MazzXT5D/qFlNplBEYiR0=; b=fwDoRL/Cu+naGoe+VOIOvKTBfwnIM+NQx/5hQ90bJm+cLG12/AWnbPGMPGUzl/b+mobRlj RMSxegxqjr942M96NmbbF1fcz2/SwrFZxy8yFpblkJzSSSqL+Ol/35aEQlldXh6WMuXcbp x6zhzIsEOX6dXuZj4kNHmO3QwytP3yI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-523-6WBYEumcOrmtjs51trEPhA-1; Fri, 09 Dec 2022 10:02:36 -0500 X-MC-Unique: 6WBYEumcOrmtjs51trEPhA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3D96E29ABA2B; Fri, 9 Dec 2022 15:02:36 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDCCA40C2065; Fri, 9 Dec 2022 15:02:35 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B822318009A6; Fri, 9 Dec 2022 16:02:27 +0100 (CET) Date: Fri, 9 Dec 2022 16:02:27 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io, mcb30@ipxe.org Cc: Laszlo Ersek , Paolo Bonzini , Ard Biesheuvel Subject: Re: [edk2-devel] [PATCH 2/3] OvmfPkg: Add library to handle TPL from within nested interrupt handlers Message-ID: <20221209150227.wns5mhtcfismxtgd@sirius.home.kraxel.org> References: <01020184f66682f9-7696e0c5-f2f6-43e0-962f-38f1d5af4859-000000@eu-west-1.amazonses.com> MIME-Version: 1.0 In-Reply-To: <01020184f66682f9-7696e0c5-f2f6-43e0-962f-38f1d5af4859-000000@eu-west-1.amazonses.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, [ Cc'ing ard ] > Add the Nested Interrupt TPL Library (NestedInterruptTplLib) to > provide helper functions that can be used by nested interrupt handlers > in place of RaiseTPL()/RestoreTPL(). So, in a nutshell this makes inner interrupt handler only run callbacks with a priority higher than the priority of the outer interrupt handler. Anything with equal or lower priority is deferred to the outer handler. That way we never nest at the same priority, which in turn limits nesting to the number of different priorities in use. Correct? The idea looks sane to me and I couldn't spot any logic errors in this. take care, Gerd