Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1120063lqd; Thu, 25 Apr 2024 06:40:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBatORlFLba6MwgyB0Soqxb+Mbp2uYsrkSKYx1T22SB8u6hoOYa3ycTtSiYeEGesRPchiJ9KWvQBMZjSyqGoTmVMyiAc5rk1XnEgBBXQ== X-Google-Smtp-Source: AGHT+IGTfs66/tviK45jp3SWpSo2cKSmIMaopyAUkW8Q0tXaDJ1L+VYN/HauejKnvF7scJv6DRIC X-Received: by 2002:a05:6358:5b13:b0:184:fdc:2590 with SMTP id h19-20020a0563585b1300b001840fdc2590mr7353516rwf.20.1714052426689; Thu, 25 Apr 2024 06:40:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714052426; cv=pass; d=google.com; s=arc-20160816; b=r38EVDSL7Q+n1sPVg4ejiRweHmSuxk0HutU5fUR3f6H8c/ajDrPBDfLA+sPiOGkTwj +NGgsUjm/8fvjZBF3rd2vgGTgAxNOFkGFusz/Ko+Rt8eNckAs0S7GIiMl6Q7Z31EZviv /Ew8wckJIgAiAcSDTNjNlmvP/Wmg/uJAgjxVA4fgsZhCGIt8n1+dNaiKV1MRO+CfAAoi 9U1NYulG6uKEWb1wOMp9PPUFg3tydFmz2XpIcmEk6Q5Vd1A30wy5/NeatgPosH7KktXM CudtT/yd/UajZ+P8xLm2Sd+Q8HFij32Uhfta0F0APL1BdgsXPl87jzm7FKPH3kUlKOg/ 0lqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=/JlTbGEvZjeBzQjrcNbKtq0vGQr6Ke2GnlFuSzRAuGw=; fh=DmevecdkcRvHHwvK4/B8VWXEnFmNN3ZJdzc5Nv2r9J8=; b=cEo8q/ITwtriKVV/UNrwYozg1hxoqqdnCn+DjcqLbbmDK5HL4uperBVZ86jx7TF6VQ gOnCBtMXsJZfsi6JC6Lw0YeM43wbAQ0uAFT7Txvytl6yNRIk3rvMzSQsVitoOu7e52OF KNY9wPFwshCg8So7HmW8QwgZfFLFtlOs/vg/jUJCXB3/4A9G07H94kG725Q4uxIeV9SJ 1hKvBY2dgTGwxyoUJFDOryc3JXSW+L4//ZzxIp8kvFuMMJFvqa5wYeoXRTJc9NjTxB9I 9nfvpIZQx1aYZpdjQp3FA+dq3UTTAKHRZ31xb4uSfOzQEVY3WJf3AWDJVce5GjoKpJSu HJmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=0pointer.de); spf=pass (google.com: domain of linux-kernel+bounces-158613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158613-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id l5-20020a1fd405000000b004d406833c10si2808132vkg.106.2024.04.25.06.40.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 06:40:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-158613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=0pointer.de); spf=pass (google.com: domain of linux-kernel+bounces-158613-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-158613-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 64BEF1C210F8 for ; Thu, 25 Apr 2024 13:40:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3818A149C41; Thu, 25 Apr 2024 13:40:09 +0000 (UTC) Received: from gardel.0pointer.net (gardel.0pointer.net [85.214.157.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98C3084FC9; Thu, 25 Apr 2024 13:40:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.214.157.71 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714052408; cv=none; b=J8B9nvdWp43L+hDWVQLTz7/WS359VdQrwts49b323fm5v3T+wdVtM9kTSatvujEedTcvgb7DnG5e8uSSh9MARAgfJQHyEM3hceTfQv7Wwz+a/Bg0Sdb9NpY0R12UEPQ3eyVrOKJX+fC2eoxxZ8jXZWQbNzGE/gObJGldK9IHUHY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714052408; c=relaxed/simple; bh=6OjdQUER9XqbuZoiy6XBVKaC/+ezP3m6B3AQ4bYYUas=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WTts7WTYzz1LGVcvV9zLZB6w5G6mhddJ8kXlOcNKJ23YGMq9u3rcq3757lrDn18oviOoP5hlUzsK5dERLQco44Gd2K4JhJNjqkCDvAyhCBFa9WBUcoKrksfWsajr2Z5AWYbemd1/emjHNSOlQKDoVgZ4dYktRLVPYrDi2KsNZDs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0pointer.de; spf=pass smtp.mailfrom=0pointer.de; arc=none smtp.client-ip=85.214.157.71 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=0pointer.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=0pointer.de Received: from gardel-login.0pointer.net (gardel-mail [IPv6:2a01:238:43ed:c300:10c3:bcf3:3266:da74]) by gardel.0pointer.net (Postfix) with ESMTP id 3FE88E80EF4; Thu, 25 Apr 2024 15:40:02 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id 845C2160029; Thu, 25 Apr 2024 15:40:00 +0200 (CEST) Date: Thu, 25 Apr 2024 15:40:00 +0200 From: Lennart Poettering To: James Bottomley Cc: Ard Biesheuvel , Ilias Apalodimas , Mikko Rapeli , linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org Subject: Re: [PATCH] efi: expose TPM event log to userspace via sysfs Message-ID: References: <6e751959b9056884c1b9d3ba23e303d1737d8763.camel@HansenPartnership.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Do, 25.04.24 09:24, James Bottomley (James.Bottomley@HansenPartnership.com) wrote: > On Thu, 2024-04-25 at 11:58 +0200, Lennart Poettering wrote: > [...] > > General purpose distros typically don't build all TPM drivers into > > the kernel, but ship some in the initrd instead. Then, udev is > > responsible for iterating all buses/devices and auto-loading the > > necessary drivers. Each loaded bus driver might make more devices > > available for which more drivers then need to be loaded, and so on. > > Some of the busses are "slow" in the sense that we don't really know > > a precise time when we know that all devices have now shown up, there > > might always be slow devices that haven't popped up yet. Iterating > > through the entire tree of devices in sysfs is often quite slow in > > itself too, it's one of the most time consuming parts of the boot in > > fact. This all is done asynchronously hence: we > > enumerate/trigger/kmod all devices as quickly as we can, but we > > continue doing other stuff at the same time. > > So let me make a suggestion that you can use now. Since all you > currently care about is the EFI/ACPI device, there is always a single > sysfs entry that corresponds to that (so you shouldn't need the log > entry as an indicator): > > /sys/bus/acpi/devices/MSFT0101\:00 > > That link (or a kobject uevent if you prefer to look for that) will > always appear regardless of whether a driver has attached or not. When > the driver actually attaches, a driver/ directory will appear where the > link points. > > The device link is added when the acpi scan is initiated as a > subsys_initcall, which is before all the filesystem initcalls, so it > should run before the initrd is mounted. > > Is this enough for now and we can think about a more generic indicator > that all drivers have been probed later? That would only work on ACPI though, but on ACPI we already have a check that works? Or to say this differently: how is that different/better from the check that already exists in systemd, which looks for /sys/firmware/acpi/tables/TPM2? Lennart -- Lennart Poettering, Berlin