Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp1080115imn; Tue, 26 Jul 2022 18:05:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1taVIZMPd5sb9LRU1Bkp7nSYSG5m/p80rTwb6+tDWdlpCv4428pPNLR52Xg/CCzIk6i7E5g X-Received: by 2002:a17:906:6a21:b0:72f:2174:16e6 with SMTP id qw33-20020a1709066a2100b0072f217416e6mr15224949ejc.177.1658883931670; Tue, 26 Jul 2022 18:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658883931; cv=none; d=google.com; s=arc-20160816; b=Bc6wTd8GV1sMXUGPZO9/dQLEU6aRBaFJRgbx+Mtpz5JVb/+hx+I02pTm3UYC4L5qee I+OB5+FwwjIar8nC7gAxL5lNd2aQN6GTMoBH3RTLCx8jh6nyChMK/VKxzXI0UCIBay0D lcen9rjsF1y4IQsfd/fnpbWq9J2vdnzX47Mdn7hsRVBhzPTzs7KU8YpUkl3nkHCuXpR+ 0o++LrfWuPzfD/0HnXfP8/kXobfNm/1vYV5bDvEw13sWS0sg3TCYyt3SB3FbGVeu3lzp tfOdul1j5hRM8YigZQXn60QV446qa2gthI+18qGloioujUhewxM5JeVmbH6K8TL2JiPc 3o3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8Yw+cKl53wNMcfpI/MRnxnx1KIbCu6LC2VYr7vldE9s=; b=H7UsiKPtnjR7Z11TxwyrT2f7Is9hAkQOaxn15BzOmqw1AWSUqSe2w7apeXj28AGip+ 2fWu5ZT4l+Qsh0QYmXyRAQZU+Ry1NE74hkuk12JIL8YZSJ8gMcai6Lq1SkO6YkswWbdf P4gHrjkUKVwrySFKnfO1Lh3NdUn00MGKOewmOnYRl6ksmcgjrc4HBEJraZ7f09Pc0Cdq KR92XXLnEIYCJBAYb35b/qkOxAmJ44E0KcuLqNXdvnXpl5i3pmSoCGuJXbI1iKU4E2NH sH/zQohDjB7ZZq2tsbw2R31BhLJaY4IirVSgMR/qQbp4/sO0DLFjLKXQP4inexb4mU0u wl3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CVhRJgIA; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lx14-20020a170906af0e00b0072eef713a27si13566033ejb.965.2022.07.26.18.05.03; Tue, 26 Jul 2022 18:05:31 -0700 (PDT) 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=@chromium.org header.s=google header.b=CVhRJgIA; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240053AbiG0A07 (ORCPT + 99 others); Tue, 26 Jul 2022 20:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbiG0A05 (ORCPT ); Tue, 26 Jul 2022 20:26:57 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3368D3A4B4 for ; Tue, 26 Jul 2022 17:26:55 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id h9so22210685wrm.0 for ; Tue, 26 Jul 2022 17:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Yw+cKl53wNMcfpI/MRnxnx1KIbCu6LC2VYr7vldE9s=; b=CVhRJgIAzdoOMqq25qQOjSnIvOpcLPVX/EzmFfAuCwGD+WxjLsVqIVbSivJUmCeg9K uDL5NHcMveoTbyzfKZiOpaVm3GHrYYVKta16Kq0iNbmbOyxHnHELviJrDmbiI0gA6E17 4yA+JrC7NIaCDqbggmsf246K96Z+LCAZIYXOE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Yw+cKl53wNMcfpI/MRnxnx1KIbCu6LC2VYr7vldE9s=; b=6oyfUBrbHazwqd5LZvSvdXyLZJJUY3lceE68G96MWr7RRNShDo9BWNihxZE0MJNVZz rDYV4MEw/7TmhQBArnQphga5Zr8B8z30BKii/A1m8hKv1U/oRe2bsdvQI1GHS2nkVDWG hvntO1CY3qDrkTDK/7qTppfp6SW21CCqmaty/sjB9DL54oHe9FSaQy7B1dpyoNZwtD4Z JMFwqkC1sIe7AFYPfP04KR0UyQ340/0h5GVfzQIQkFXtQ2tw4E4q48JGvbbMbwkR5blS Ab9EdmhDl/X6eOcOtAIIr4XZ0DcG++u7Dg9eGiy4P4wzLEXdn979cpahCiA+cl6WnRCt +H1A== X-Gm-Message-State: AJIora/0KmomX2UDs3mcJtsm1nOq1GwheZM+ulTG6heC/YEx7VG+urSY /gNU1F/H0NwWvMkxvQeEZ3argO3AiXOC3B4VKCz5hg== X-Received: by 2002:adf:ee8f:0:b0:21e:529e:fa3b with SMTP id b15-20020adfee8f000000b0021e529efa3bmr11946186wro.207.1658881613377; Tue, 26 Jul 2022 17:26:53 -0700 (PDT) MIME-Version: 1.0 References: <20220726235115.1184532-1-jrosenth@chromium.org> In-Reply-To: <20220726235115.1184532-1-jrosenth@chromium.org> From: Julius Werner Date: Tue, 26 Jul 2022 17:26:41 -0700 Message-ID: Subject: Re: [PATCH] firmware: google: Implement vboot workbuf in sysfs To: Jack Rosenthal Cc: LKML , chrome-platform@lists.linux.dev, Stephen Boyd , Guenter Roeck , Julius Werner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_SPF_WL 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 Sorry, this wasn't quite what I meant. I think we should definitely not hardcode any details about the vboot data structure layout here. It's already enough of a pain to keep crossystem in sync with different data structure versions, we absolutely don't want to have to keep updating that in the kernel as well. I assume that the reason you went that route seems to have been mostly that the lb_cbmem_ref coreboot table entry has no size field, so you had to infer the size from within the data structure. Thankfully, we don't need to use lb_cbmem_ref for this, that's somewhat of a legacy entry type that we're trying to phase out where it's no longer needed for backwards-compatibility anyway (and in fact I think we should be okay to remove the vboot entry there nowadays). We also have lb_cbmem_entry (see https://review.coreboot.org/plugins/gitiles/coreboot/+/refs/heads/master/src/lib/imd_cbmem.c#222) that exports info about every area in CBMEM, with address, size and CBMEM ID. The vboot workbuffer is CBMEM ID 0x78007343. I think we should just add a general driver for lb_cbmem_entry tags here, that uses the "id" as (part of) the device name and contains node to read/write the raw bytes of the buffer. Then crossystem can easily find the right one for vboot, and the infrastructure may also come in handy for other uses (or debugging) in the future.