Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2041932ybh; Fri, 17 Jul 2020 07:58:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgC3teeS8fZcnhEsfeXxTLVOP5RSYONd7EiVCGSMJ23oGheF8/4EnobTF0m1Z/kfw4EVpM X-Received: by 2002:a17:906:fa13:: with SMTP id lo19mr8866326ejb.213.1594997935490; Fri, 17 Jul 2020 07:58:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594997935; cv=none; d=google.com; s=arc-20160816; b=q6eJv5xL4Gl1FO9YOvHtu9DIT1+6D2RCF+2QQqyoWNSzQEzfVdMvD9uMTuTU2ICsm1 Xs9Oe4dcr6f7TH7eS4I9Dd3k1gncfGmTyCTvhlkOIGjl0TAbYN7XGQsRkMWqJUUaWa3B ooufoYFuL3BPOsGh7zi8UK/G/vvwGQMIfP0EfeUkbbqEtPrDVyiVyGtWZNObh52Y/bQh KXEVx39AaJFEcqCy9rehoGRwR8ko5y3CdvOfz5PrvKO5Y0OL0ujotj19vOSeppZx2bBd n2pt/5M/GrqLAZ78fGm8N6sjHcs9R9UtolLB5bgF/gIObR+e1wbU4kW206ATms12EO96 HD5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jhxOm6TcRHQLRBddxKmO7EjsTs7dZ1hvqZYFad/Gp18=; b=LYiDbuXC4Comq/ntoVSwyfKRucA4lNAfo8t82cq1Yr7ha78haUfnm6adORmVH/xmmy vbZ9UFnAuzXpdtvhYdQ+ShgvHCd0/R+IiA3m0XWGuruL3Cn8isufRiCpwfH2rTDT3GWp vtAmH6SKPjgVFd3oqzEHvG/1KUWb0P7Gk+cC4vfAxYZHSmtTW0Au7iQ8EUOdpF3dSR7A Hp7x0xp3/vTMgRU/fyVs98HIYT/2/slc/xFAsPDar1ixRqR7ULEsuvWMk6sTAVvVGOEp BCRWAHtEMG1P2znZyn5JaCPgE0QtNPhB+9sY2o6u7/FkpMCIqkNY5ilUF/Mj7pF88nYT ORUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iXpESSD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si5704727edl.596.2020.07.17.07.58.31; Fri, 17 Jul 2020 07:58:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iXpESSD3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgGQO5z (ORCPT + 99 others); Fri, 17 Jul 2020 10:57:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:33282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726204AbgGQO5z (ORCPT ); Fri, 17 Jul 2020 10:57:55 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0EBF20775; Fri, 17 Jul 2020 14:57:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594997874; bh=iL1jI76lyN8hGCPilHF3T5xrNu549gmKglLqS+FY4/g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iXpESSD3PzKwEUtwZdE4+G1uKDQZX2PWMKTCHe8apWU9AWE21809e2wj8uk/i1NRl 5bmid5/LJSA5Wk3eAsRkG5zTzlTyimIisMoH05sb1bwBkSDQ+RgkyzBScK+DU7ZgYi /9AXZuxsdi0oUe+kqbRnjEdLXe+8HdVxh5LzhdSA= Date: Fri, 17 Jul 2020 16:57:46 +0200 From: Greg Kroah-Hartman To: Daniel Gutson Cc: Arnd Bergmann , Derek Kiernan , Tudor Ambarus , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Mika Westerberg , Mauro Carvalho Chehab , "linux-kernel@vger.kernel.org" , Richard Hughes , Alex Bazhaniuk Subject: Re: [PATCH] [PATCH] Firmware security information in SYSFS Message-ID: <20200717145746.GB3008378@kroah.com> References: <20200716223627.253936-1-daniel.gutson@eclypsium.com> <20200717062841.GA3238569@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 17, 2020 at 11:46:39AM -0300, Daniel Gutson wrote: > On Fri, Jul 17, 2020 at 11:41 AM Arnd Bergmann wrote: > > > On Fri, Jul 17, 2020 at 8:28 AM Greg Kroah-Hartman > > wrote: > > > > > > On Thu, Jul 16, 2020 at 07:36:27PM -0300, Daniel Gutson wrote: > > > > +What: /sys/kernel/firmware-security/bioswe > > > > > > Ick, I stopped reading right here. > > > > > > No, this is not where this belongs. > > > > > > We already have /sys/firmware/, right? And firmware-specific > > > subdirectories below that. > > > > > > We also have /sys/devices/system/ and I think that would be a much > > > better place for this, as it is easier to work with a real 'struct > > > device' than a "raw" kobject any day. Bonus is you get full support of > > > userspace libraries when you do that, unlike when dealing with kobjects. > > > > > > Also, this really is a _SPECIFIC_ type of firmware that supports these > > > features, right? Why not call that out too? This is not generic by any > > > means. > > > > As I suggested in my previous review, I wouldn't worry too much about > > the user interface at the start, but instead first work out how the > > hardware > > support fits in with the existing drivers and once that looks fine decide > > on how to export it to user space. > > > > I agree the /sys/kernel/firmware-security/bioswe sounds like the wrong > > place, but I'm not sure if adding any other new directory in sysfs is > > much better. I think the most promising would be to have it on the > > sysfs directory for the device it refers to, > > > My idea is to have all the firmware security information together in the > same place; this information comes from many devices. > This initial patch involves the SPI Controller, and I don't want to add > more stuff until there > is a consensus. > So, do you have a suggestion where to put this information? > /sys/devices/system/firmware-security? > /sys/firmware/security? > other? > > Please advise. It's fun to focus on things like this, as it's the most visible part, but are you sure the "talk to the hardware" part is working properly? If so, great, it should be a "class", as that way it is independent of any hardware type, right? Classes show how devices talk to userspace in a common way (input, tty, led, block, etc.) So why is this any different from that? But worry about the other part first please. And if you ever find yourself using a "raw" kobject, you know you have done something wrong :) thanks, greg k-h