Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1224971pxb; Sun, 21 Feb 2021 17:00:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwHrqz09HCguAvWqyq/BDBIy9EOsyJVzX+fZLDIvW6l1PbzLxJ27idGHj0Fq0fa615CkBl X-Received: by 2002:a17:906:2892:: with SMTP id o18mr18333671ejd.220.1613955641405; Sun, 21 Feb 2021 17:00:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613955641; cv=none; d=google.com; s=arc-20160816; b=mFukPDEZk3c5XMTRV35yEOtSMyx7suUfM1inSj7+e2twUUbg1FgjZ1KFFxxY5sBAli aO2jBzKFzi+Y3juA1B+aX/3HcUBgH6Em9UrW+ucfs2cuQrPhWhokYVlzUCRvAHcaOL4a 46o98jF3hDoz2hzU30sgc7Ay7O2FKD3odRui6Rzl3B7pcIQWOgR32a56Ocj7q2ofBWbj qFEij76cRPHVFelYkg+kW0huQ063MvA0hwaLtOpgc6ipV+sEJWbUwY8dV63ApUNA2JA/ i+xB4Pazrx3u7BbXh5V/ovJaufHlKEAy+jk43xz/9S20woZnay4NQQnvXJIaKSEkSsdX DPSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=raxmEqgFjdAo+jQGqbN3VuOrXQCpysxFMHCswCu1iZk=; b=RSRK7AJFZRq2sTwBmN4rloBePCaW6L7eu5IazL5Kc6gfmapc2dOlZQ2SbAm1A8Sv8U uDWuPgAp95xabtwJtcwbRGi8I5KGLCDGKWYHXJizmp11eVsBhAw+0gHwy3YL+oetkNi/ DVMJyBtfMLx/TqyGYFhgFyEnNX0DXVhNv2D52LkC2AQsfqxzSjanAvn34SH5rLdPz/2I Eu1c/TMdIndAElM7ETtbCDIUBStYiFE4s0yOwMUl+2atSUxpQlknxYSWAtof22vYmC+N ctiRgfJyx2YFZnqAqsRLhoYXAiZG/VL4Xvd0bikV2OPQcMXCJbDFbPSWO39HobD0M+pC lwTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=FncSkhj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o5si10995377ejm.1.2021.02.21.17.00.18; Sun, 21 Feb 2021 17:00:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=FncSkhj3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230113AbhBVA7L (ORCPT + 99 others); Sun, 21 Feb 2021 19:59:11 -0500 Received: from mout.gmx.net ([212.227.17.21]:49239 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229895AbhBVA6s (ORCPT ); Sun, 21 Feb 2021 19:58:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613955422; bh=raxmEqgFjdAo+jQGqbN3VuOrXQCpysxFMHCswCu1iZk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=FncSkhj3h5e4tu3mOO388jd8PsOkI1C/KA4s9Ur2uRZbkGzJxnDU+lTSa8PiOln4e sh/4r7iBx3oyvzLCQBBDspbd+WNIkz7eCu/UinWgmg6nZIOGUoyekGBSNgyssW6rSV DkV/01xGTptd/aLFofUf3R9lwQ8tP0GyaB7n92ew= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from Venus.fritz.box ([78.42.220.31]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MBlxM-1l8XUQ0t5Q-00CAxq; Mon, 22 Feb 2021 01:57:02 +0100 From: Lino Sanfilippo To: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca Cc: stefanb@linux.vnet.ibm.com, James.Bottomley@hansenpartnership.com, jsnitsel@redhat.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, LinoSanfilippo@gmx.de Subject: [PATCH 3/4] tpm: Fix test for interrupts Date: Mon, 22 Feb 2021 01:56:33 +0100 Message-Id: <1613955394-13152-4-git-send-email-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1613955394-13152-1-git-send-email-LinoSanfilippo@gmx.de> References: <1613955394-13152-1-git-send-email-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:vEAC1DF/1pC0qzv81mTXhHQqYZ0DMHU6qLKyKcBqrOXaqAI9ecp GSDoT+3YNNdkMMIk7laGq/hshNJzqiuab2K+1xXp1qu3tZfy5Q2+AB3tr5JNplEpTcqFEk6 H1NrIiZp4JStofzOynxnVHUO1GIK7fbbV+6qGiRQzxxYIuXKrSlYTWEzdjclw/goL4Ca8Ri wkLOfgc+dQNlK/teBA8bg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:qfh5PAdE74E=:t78pCeqFTwogBUZ31mzd/P Zwuf+3jWy8j7gPHSafdpkXoCTKDo/+LCtDm9AYvid6Ka0mZSnp5AVOzVLkiHElWqiiJBpNAuB yt9i2ib/su29J/Q++B6HDbFrlV/s3FJsx1lrBFGuN4mHRVcKcrdGC9Sn3oCbCiEUSNYLWQQ1r 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