Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2728100ybp; Thu, 10 Oct 2019 11:39:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAQebXCXvdcd3ifX/HNWqNvLu4y2DiVyiPuMlG3vdgGzOqBnaVk5eOlmUZiBfNH5qZv3dI X-Received: by 2002:a05:6402:88d:: with SMTP id e13mr9368432edy.246.1570732780190; Thu, 10 Oct 2019 11:39:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570732780; cv=none; d=google.com; s=arc-20160816; b=iXipIG0UMMJtFh2glfUmQ5FmqVcPpygIWZot+q4FLezr1JPRoFhk9FH/2DS0jC7kTe VbLt1QUYXPDUnyf9niyZE3GtTbuIyzF2B3G+I1qdT0zUn6Q4l2fYXp3i9VS++sm5h/Hc HtFSpWjqCtg+2DMds0BS8wO70JCrmX7iQVCM/0Hknyun45Gy+KXoIq1liSRVt6EjmbzY Pgyhm0uFH1YwQIkMUPcJZ0IVxi1JRxJC2yrWN3smsiC+w8ccVk0hQWNepXb0lJ5s+psK tei4ITpvtgp23Xo+xNvVRqH792iol08nCg6SXNbv55hwokyYrPncEmF6n+495bKeQnma v6MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uUzRX7Xh7byk+MCJLYcIVyEy+EENOl4g6KMABWycDWw=; b=kvVZdWxY1tHL9J0FPmz8ZYWMzM6HO/oStU9q88mILn9cPEcPtlgRsdqF+kd1EQHDO0 i+ZO/HlvVJ3ouh64xLfgfhvnOhpsxxYud2LpTnHKy9AFVrmxY8EQGgRJdjAqepaQtb8p J0frF6VHr8MFzq4HB7LlgUHwmTQ8Ya6qlwCY9gA6ulfyHbGducLJVHSpbxaoV8eeFyxV xEtMYpKe469Amt8QigQElAF4WF0JPYkdfc/bEgDv+XrcIOqiz7+f2fHBH8/z3JRx8Zon cSLHNxt1yO7AgOzhrA2JUEf4stRnOOvYuSrp8wais2kEA4zjTe0/cLr7OMwiHqQ1Bm+P pvCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZQ6PxwUt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id os6si3538632ejb.224.2019.10.10.11.39.16; Thu, 10 Oct 2019 11:39:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZQ6PxwUt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726680AbfJJSiN (ORCPT + 99 others); Thu, 10 Oct 2019 14:38:13 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:36368 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbfJJSiM (ORCPT ); Thu, 10 Oct 2019 14:38:12 -0400 Received: by mail-io1-f68.google.com with SMTP id b136so16011122iof.3 for ; Thu, 10 Oct 2019 11:38:11 -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=uUzRX7Xh7byk+MCJLYcIVyEy+EENOl4g6KMABWycDWw=; b=ZQ6PxwUt7uDnexDJkq9OENRzTCFskAngHyXDBZksax3F+PGRBGH8FR1A6RJapyEQ55 /zzucfJ05Y9z2hjpZyqzThIvKaXCo7NfK/mdARhJfTS2Z1kk3fh+fAgRvxEYh+Hfn0xb CgRg0yjdWxEEOFfba4LnL9gOFEwaksq23hjZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uUzRX7Xh7byk+MCJLYcIVyEy+EENOl4g6KMABWycDWw=; b=Oz5yo32hPiH035hExEw/EJVJ+7ZZBazZZ/hmwYucv5nXba1VBZdetsHpF12wp2iKz3 IH5iz0zJhEUrJpHohCnN+2LpCD6/adeVUoS2s6R8kdrRMZDy2tpbRZyuoVQF/60E7moa DwKEWN5EKl4yBu3vlMVIGwA+2fb1GIsHDt7S5WiNY5KjR4ITqWx5+XAaucaM4Jsx2CBv 5z+BzzhdqlyRwK0Sg0OqnsJmpkMGXY6XWxvkU4h6H26e9kX2a874JjNutRHwi2EuOvPF yp0ITfhgfz/JVfVlsD3YfOBlAgXllXLZaWDqI4/5UOTY1ZvgUgq00lj1SjCKOKWYslCH CgBQ== X-Gm-Message-State: APjAAAUAhIydIb75VTmhgfJ/W/fj7K17jtJM5vnMA8BpH9+Lm8oor/p+ 1s0my7hOIr3zWhFImbDlXrml1EvrPIn26EWL9BIVdw== X-Received: by 2002:a02:c4cd:: with SMTP id h13mr12796842jaj.142.1570732690810; Thu, 10 Oct 2019 11:38:10 -0700 (PDT) MIME-Version: 1.0 References: <20191008115342.28483-1-patrick.rudolph@9elements.com> <20191008115342.28483-2-patrick.rudolph@9elements.com> <5d9d120b.1c69fb81.b6201.1477@mx.google.com> <6cfca8c34ccd51f12b4418e9a74d8961e32077ed.camel@9elements.com> <5d9f3b9f.1c69fb81.62109.325d@mx.google.com> In-Reply-To: <5d9f3b9f.1c69fb81.62109.325d@mx.google.com> From: Julius Werner Date: Thu, 10 Oct 2019 11:37:58 -0700 Message-ID: Subject: Re: [PATCH 2/2] firmware: coreboot: Export active CBFS partition To: Stephen Boyd Cc: Julius Werner , Patrick Rudolph , LKML , Greg Kroah-Hartman , Ben Zhang , Duncan Laurie , Thomas Gleixner , Samuel Holland Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > I'll expose the coreboot tables using a sysfs driver, which then can be > > used by coreboot tools instead of accessing /dev/mem. As it holds the > > FMAP and "boot media params" that's all I need for now. > > > > The downside is that the userspace tools need to be keep in sync with > > the binary interface the coreboot tables are providing. Well, in the other version the kernel needs to be kept in sync instead. No matter where you do the parsing, something needs to be kept in sync. I think userspace would be easier, especially if we would host a small userspace library in the coreboot repository that other tools could just link. > I'd rather we export this information in sysfs via some coreboot_fmap > class and then make the "boot media params" another property of one of > the fmap devices. Then userspace can search through all the fmap devices > and find the "boot media params" one. Is anything else needed? Okay, this is the fundamental question we need to answer first... do you really think it's better to add a separate interface for each of these, Stephen? The coreboot table[1] currently contains 49 entries with all sorts of random firmware information, and most of these will never be interesting to the kernel. Do we want to establish a pattern where we add a new sysfs interface for each of them whenever someone has a use case for reading it from userspace? I think this might be a good point to implement a generic interface to read any coreboot table entry from userspace instead, and say that if the kernel doesn't need the information in a specific entry itself, it shouldn't need to know how to parse it. [1] https://review.coreboot.org/cgit/coreboot.git/tree/src/commonlib/include/commonlib/coreboot_tables.h