Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2994025rwb; Sun, 20 Nov 2022 05:35:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6sWFgFi3E/z49kpC007n/QJReZO5nNYtncpUOh1Xcmic0XKEGtk2GRMqxTP+B7eTNmGE4+ X-Received: by 2002:a17:902:e849:b0:188:ff96:a7df with SMTP id t9-20020a170902e84900b00188ff96a7dfmr7830077plg.38.1668951320905; Sun, 20 Nov 2022 05:35:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668951320; cv=none; d=google.com; s=arc-20160816; b=h90iXXXqeTFOKEPGnMlW1fe5P1IG2Ti2cx3MbULRxaPuucpQ1wktQ7vzP4AJS1fcyX C2Z8QHuzzyQiO5FQL+zSAv65SFhp1p4rQWQ+Xx51BY/Uav844Im0p8SCqPZMTAA8dB9Z ojyx8zIe7y1c5vzR8G3/ddE1ZOgBKF07oyINNQD6y5HnOihKoakRAo4e8X+X/SjhtnRn 1TA/bSLiqDYL93pRoi/PFy4wDmjv5XUKhlr95iHSYDE+ZA234gcEq2pVAAquuG8A93Dt 7xTr/Y25l93FlsJmfNXhicYfW2wu4i/AK7G067IPcN9xRUlPfNJ8LYqCOVdqv42F12t1 2/sg== 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=mujM8XcZPtYkQ3B4FgSH2rYtTxc0/C3MRTBTnMu6dmk=; b=H3W6yPsSd45QWhKQ9ANObe+8twXgwlq9DUR4paAfxStuthT9I5moMjEnDD9WY6NnDg DvCD0XQdTlk1oGoL6WSmdHTlOy6ILKczihwVWIeijODa0R/9F5tgDFcgtYW4Q8Eo7KTN VCrcbpm3PUiEHE11PlQ7dfW/RxCabvf9KGFjQBmhNTQtta3fMbJdnEjqAzf8oCDXuqXl hRDbp6pFj/sBRXGIc2ZX1lvOErIqxlxvc6tIGtb6WO0FJrkui3HEoY2JXhr/DwoodFc1 u5fLZBvpldCWsAzsi63q8NmUzHgq2oXrV3r+AF1HLVSYBmjZwNhr/fraJs3X8r37B8VG R8Gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=r6atztG5; 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 i9-20020a170902c94900b00186827cc5e9si9389983pla.562.2022.11.20.05.35.02; Sun, 20 Nov 2022 05:35:20 -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=r6atztG5; 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 S229837AbiKTNdH (ORCPT + 92 others); Sun, 20 Nov 2022 08:33:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiKTNci (ORCPT ); Sun, 20 Nov 2022 08:32:38 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 148FDB34; Sun, 20 Nov 2022 05:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1668951127; bh=mujM8XcZPtYkQ3B4FgSH2rYtTxc0/C3MRTBTnMu6dmk=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=r6atztG5AplYF5bQD8RKXwicx5nJmkkIFzrgrPiuRAzsXzCV1UMMR5W9dZ52u8Hkr hIpr4O74UVkvPK7em3I8gD6yb8MVMSZqFZDggHLnT8NTnPSKAULdlIWDGy+v4M6BnF wS1kdeopMIsLS7B4SMinLcGw+zV+JdIDnKGtdwpjCjaacHaInm/kyjMOOq3XI+FWOL Al5hrkmXhVVGF8KZ/GO23d0eib56rTvnqdYEkGF5AOoAb6FQzl7akXpNCFIztEd490 55K1Qf0TDQSbYj7PvAU9VTpZDBfm8EnUfZ6OwS/6ByudeOVAJwFWxzs074jifXqdMq I4fQidtqfvD+w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from Venus.speedport.ip ([84.162.7.17]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MXGrE-1oQLAv31VG-00Yf9l; Sun, 20 Nov 2022 14:32:07 +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 v10 09/14] tpm, tpm: Implement usage counter for locality Date: Sun, 20 Nov 2022 14:31:29 +0100 Message-Id: <20221120133134.28926-10-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221120133134.28926-1-LinoSanfilippo@gmx.de> References: <20221120133134.28926-1-LinoSanfilippo@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:a0lGO7ZgpoqQrWS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ej9q8N90HxUQkJK4Ha3ObYqYhQoiEe5wdueyUuIYNV70BFrqwJHgDwKk7mCPQDHmEW2b/Pj olvuW2KtJCjSHqy/t0bF77AenUa6tpxbPZ1stePqthlPj3ogZ2b4OPjrlEUC+shmxNswinUqb 4w87sw== 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 ZWFkLXNhZmV0eSBvZiB0aGUgY291bnRlciB3aGlja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