Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8967629rwb; Thu, 24 Nov 2022 06:31:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf6M2l+8mbK/AnwWctbWFDyPqEF1i/lo6eRvYq1w7FVj7TBq2GgEswiHM5IhFJ6gaGSSqSvF X-Received: by 2002:a17:902:d302:b0:189:6077:5595 with SMTP id b2-20020a170902d30200b0018960775595mr710464plc.84.1669300274637; Thu, 24 Nov 2022 06:31:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669300274; cv=none; d=google.com; s=arc-20160816; b=oTZS29WTZSDbtshX4EsJcnx8Ylh1MUNBr7OsV3LdQnLW/AVJQXnFoMnJLezOauKBUa iuQuebov/QFCHT/52gYt4E4TEEYvrsBKQVvc/leNFyhHld9LDaxdO/2RQDfwNf3BRRpI dOglovtOETsmJRxx2N1tvLgzLjEFcbVhddyqZKr6Ex4A4BT26eT/02ivQDwKfK1kozF0 X5y9W7wgPITNVL4YpU/WcIVCrLWWW4yOMPNFP+AwBNDNy4bsThwVG2njejiwsR/S5ofm mOd0O8SUCVFWBCX1GKpKdvk5ltqR6xpJuSBDQIs1egv2ukckBPXkMYnIaRgU9AfcqG+1 3lJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fv8SjyD4xDuS845+FrgNrBwr4CQVNrdzJ9YRUMiA+TY=; b=mZQxUBpId1Q+1aRh7T1VdX1CQtZTLcRf5iU3BbbML2Ec9cQILdpPVfZE5/UDnRg8LS Njg8137xIpDM9Pzt8dbVQN5klb9mZu2jQqFtGv2RC/OBMb4pKji3XFUaDYRj+25Bcq6I 2OiuuY4FH9juUD7pK3Jd4NwPVMuekb9KJSQyV0cwmJiaNF6yWrEvUPAug+uPlYGKuk0S AGglFPhtWdVBrywVsyzeIZqj1jcKPF9O4JJEjHYdNHRVF6cc8JjzSC+j0ckA6OLfq1ed X8X4Eg8VERaPnPXd4J//XOs+vVM8tlvg4J5sxestaZ0FkqwJ5/484Ppcjhu7CwrrHsmX l71A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=lcI1cZuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx1-20020a17090b4b0100b00213d1d59224si551366pjb.136.2022.11.24.06.31.00; Thu, 24 Nov 2022 06:31:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=lcI1cZuA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbiKXN4p (ORCPT + 86 others); Thu, 24 Nov 2022 08:56:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbiKXN4d (ORCPT ); Thu, 24 Nov 2022 08:56:33 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 424A1ECCD3; Thu, 24 Nov 2022 05:56:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1669298173; bh=fv8SjyD4xDuS845+FrgNrBwr4CQVNrdzJ9YRUMiA+TY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=lcI1cZuAQ5wvaNyZE2ryqYmERayGugVT8v30Rz2tx8ePi7YqKY4DUqScBesUGVBVZ 42EhV05+qTtJK/OfukMidyvXmQf4gt35gtG8y4gJ2maVY25i5sSj+hD6JhZPxZ3e1w ZW2lThEle+prgpPVoBWy4Kt7WB33rTUgDJ5dSuG3gzXDCKHcPHX6PlXHqEUqhDuvXQ PltNzr4PvdPbMOen+7/sv44xrYBjwxs3WB/LH4lQQpt7zo5EKNVOCroVvuYq1KxoBj lJTfCK74SpfqlQo7i/ZyrQrzTw1q5LWN3l86E+BWZ/s/Xwld699aU/W6omESjQSk8W /SIFDqwpd4OAA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from Venus.speedport.ip ([84.162.7.17]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUnA-1pFJp10EAU-00rbly; Thu, 24 Nov 2022 14:56:13 +0100 From: Lino Sanfilippo To: peterhuewe@gmx.de, jarkko@kernel.org, jgg@ziepe.ca Cc: stefanb@linux.vnet.ibm.com, linux@mniewoehner.de, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, jandryuk@gmail.com, pmenzel@molgen.mpg.de, l.sanfilippo@kunbus.com, LinoSanfilippo@gmx.de, lukas@wunner.de, p.rosenberger@kunbus.com Subject: [PATCH v11 09/14] tpm, tpm: Implement usage counter for locality Date: Thu, 24 Nov 2022 14:55:33 +0100 Message-Id: <20221124135538.31020-10-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221124135538.31020-1-LinoSanfilippo@gmx.de> References: <20221124135538.31020-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:EARtN2yQKkakweG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465yYWTwFjdvtpWIFQzWsL/+XBnOr5WdaypUMfyWsPYlnJCuRchOCMjTnkk0P66PEmc XfAS8vwvwRkSHyOhpVSunvj/r6VUb9egniD3tJxEi7YaWg89vBkRshT+vXo8wmNc29Uylxf4v 5Tn7e4RsIF6OykJPDegG7QV6Zak= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RnJvbTogTGlubyBTYW5maWxpcHBvIDxsLnNhbmZpbGlwcG9Aa3VuYnVzLmNvbT4KCkltcGxlbWVu dCBhIHVzYWdlIGNvdW50ZXIgZm9yIHRoZSAoZGVmYXVsdCkgbG9jYWxpdHkgdXNlZCBieSB0aGUg VFBNIFRJUwpkcml2ZXI6ClJlcXVlc3QgdGhlIGxvY2FsaXR5IGZyb20gdGhlIFRQTSBpZiBpdCBo YXMgbm90IGJlZW4gY2xhaW1lZCB5ZXQsIG90aGVyd2lzZQpvbmx5IGluY3JlbWVudCB0aGUgY291 bnRlci4gQWxzbyByZWxlYXNlIHRoZSBsb2NhbGl0eSBpZiB0aGUgY291bnRlciBpcyAwCm90aGVy d2lzZSBvbmx5IGRlY3JlbWVudCB0aGUgY291bnRlci4gU2luY2UgaW4gY2FzZSBvZiBTUEkgdGhl IHJlZ2lzdGVyCmFjY2Vzc2VzIGFyZSBsb2NrZWQgYnkgbWVhbnMgb2YgdGhlIFNQSSBidXMgbXV0 ZXggdXNlIGEgc2xlZXBhYmxlIGxvY2sKKGkuZS4gYWxzbyBhIG11dGV4KSB0byBlbnN1cmUgdGhy ZWFkLXNhZmV0eSBvZiB0aGU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