Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1242772rwb; Tue, 4 Oct 2022 18:18:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4HIYG/JFhGUUuCRWEcR0+5/KNsqpChYf99wPo+sDfvfOM1TLJpYjaYE6yg8WHzaFklYbau X-Received: by 2002:a17:902:bf46:b0:179:eba5:90ba with SMTP id u6-20020a170902bf4600b00179eba590bamr29794750pls.16.1664932719814; Tue, 04 Oct 2022 18:18:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664932719; cv=none; d=google.com; s=arc-20160816; b=WwMaSG+jDTn2Tj6K0obYOB0FR7oMK3/4WPf8S9FlbCttBeJZiMexA2equuVqpPyWL7 KZ10z5pVzBeO/UTe5k3Ygo/pYIbG7ib/gCiLPBE+WuwBc+KpXKOa9N7l1lgiysQACg9e SI/MnmaomPticF8A2Gq0/f6z1tH7TwbGPkkbNUXzSoeXBYgdSLCGORSb+3eofmqhpSFs slhik7d5s7/fO3+mu/8WhnVmmXd2B9A1TBVdIgWIb5mgYRYbwC3jqvjo7HJFyqlEDXG2 v/8QuiHV7ABf6anz7pv7eAdAP6teg24Hp/iy7y6nO5eWdEWVg0ndPOhG+w0+PVifvsFc n1Pg== 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=vTtrZ5c58j0WZSj98SnKiN3CQ0KpqQiGa+HkG23eQ24=; b=YUG7oroICYBGyhGFYy1pGxMHuxweDIISea0ZnII3IwGM4I0dTTvzBbVtaBO7JIbzn1 d7eqBvZJoe53RI0Z8m3jYWNerKo1GFIHcmzJqRP6WvCTY5qGCrn2CM9e36theM46Qfem En08Lf1MWcu1xoBIZsnfr92grsgiCZGeswjk2ZVsfmAiQ0YpMiTx6oe0npbi2ubc6nJ2 Xz+IeqKfbOkHCEH7oLvS5jAPAT2lcUfESjFmLnpNWRBOBPrm8tP4q6eAYyag/0OCx2xg 6vSFURVMCGjOoeDuk608b9jJXuTc5TtDW/HN0BVzFlAQw1ey5hULXrQBjAbo9ijWz49G FX2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Bg9O0Hbm; 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 m22-20020a056a00081600b00527d4769260si14862673pfk.332.2022.10.04.18.18.25; Tue, 04 Oct 2022 18:18:39 -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=Bg9O0Hbm; 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 S229500AbiJEBKT (ORCPT + 99 others); Tue, 4 Oct 2022 21:10:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiJEBKR (ORCPT ); Tue, 4 Oct 2022 21:10:17 -0400 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FB0E6DF8D for ; Tue, 4 Oct 2022 18:10:14 -0700 (PDT) Received: by mail-wm1-x331.google.com with SMTP id r3-20020a05600c35c300b003b4b5f6c6bdso228870wmq.2 for ; Tue, 04 Oct 2022 18:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=vTtrZ5c58j0WZSj98SnKiN3CQ0KpqQiGa+HkG23eQ24=; b=Bg9O0HbmZ3imZTMmU16zgGU++dJLyfLlKUwtU1VSK+lHxLt8i0S/oghO8TQZuLZvb0 UvAebMScWcN1GmILBzE2lPewB43O78oxQhjxZseelYzXslgsR/eHsHu6AIr4vsvF+w5j Zx0WLg5qqOf4orI6DdgtgEi/YmGmmY1igH2/s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=vTtrZ5c58j0WZSj98SnKiN3CQ0KpqQiGa+HkG23eQ24=; b=FJMXD0A2o9yUTzlgmOvqctvkH7BYTwk2KHIIl+QcaeqQry4dGXAgN3RPQRsQkY5rbQ 0pb8N442bAySucci8ohdWXj94qiVXX353zT4D4Z7opDB8F3ieZGv4ofjztLJc5LQZSo1 cOd1TgNInesy3ipKrGWdbH5yz1hJnxODRxQHEhTmtkK/MzcolMHsAaHHJN498WvJuICE lIBbiDn/q0kXxiDXZmwaruVTP0EnpVRrQuG5N/M0vrN4o5ScIrzw+BBvn+nGRA2S6omt YlqQsiRhJp08yiNfmpa/kaxNB1YTheCPkqh6Ne89wMnRJ9dUWAQzbmmwl7Ihib4U+q17 DAZg== X-Gm-Message-State: ACrzQf0+VXA+vdn/qTVGPq1MsWJU7YTKwu04oimCdZpH0p2ynGOu9npj kvJkw4soAQRBdAl3DhWrqaDv2bAzsaJl3jwBPoNsrQ== X-Received: by 2002:a05:600c:5490:b0:3b4:8db0:54d7 with SMTP id iv16-20020a05600c549000b003b48db054d7mr1579961wmb.62.1664932212925; Tue, 04 Oct 2022 18:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20221004003811.4075765-1-jrosenth@chromium.org> In-Reply-To: From: Julius Werner Date: Tue, 4 Oct 2022 18:10:01 -0700 Message-ID: Subject: Re: [PATCH v12] firmware: google: Implement cbmem in sysfs driver To: Jack Rosenthal Cc: Greg KH , LKML , chrome-platform@lists.linux.dev, Stephen Boyd , Tzung-Bi Shih , Guenter Roeck , Julius Werner Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.3 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=no 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 > > Then how does the kernel know what to print out? Why not add such a > > reference somewhere? > > The kernel really doesn't need to know the list of possible ids: it > simply reads what coreboot gives it from the coreboot tables and proxies > that on up to sysfs nodes. > > In an earlier version of this patch > (https://lore.kernel.org/chrome-platform/CAODwPW-JzXXsEANaS+6n695YqriAQ0j0LXm31R2u1OP3MhX9Uw@mail.gmail.com/T/#u), > I actually had this list so that the directory names were human-readable > instead of using the 32-bit CBMEM id, but Julius didn't like it citing > that we'd have to keep the kernel tree and the coreboot tree in sync. > > I'm fine with either solution ... just want to make all parties happy > here =) There is quite a long list of possible IDs (79 at the current count), many of them are just coreboot-internal implementation details for specific platforms that are really not interesting to the running OS after we're done booting, and new ones get added all the time. I don't think there's any practical value in trying to maintain a corresponding list in the kernel, it would just be unnecessary bloat and a maintenance nightmare to keep in sync. This whole driver is supposed to be a thin bridge between coreboot and coreboot-specific userspace tools. Those tools will know about the specific meaning of individual IDs and the data format of their contents, and they are much easier to keep updated and in sync with new coreboot releases than the kernel itself. So the whole goal of the design is to leave all those details to the userspace tools and have the kernel involved as little as possible, just passing the raw information through without being involved in its interpretation.