Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755114AbbHJTPM (ORCPT ); Mon, 10 Aug 2015 15:15:12 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:46287 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755070AbbHJTPJ (ORCPT ); Mon, 10 Aug 2015 15:15:09 -0400 Date: Mon, 10 Aug 2015 12:15:09 -0700 From: Greg KH To: "Gabriel L. Somlo" Cc: ralf@linux-mips.org, zajec5@gmail.com, paul@pwsan.com, galak@codeaurora.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, matt.fleming@intel.com, x86@kernel.org, linux-efi@vger.kernel.org, qemu-devel@nongnu.org, lersek@redhat.com, jordan.l.justen@intel.com, gleb@cloudius-systems.com, pbonzini@redhat.com, kraxel@redhat.com, eblake@redhat.com, rjones@redhat.com, kernelnewbies@kernelnewbies.org Subject: Re: [PATCH 1/3] firmware: introduce sysfs driver for QEMU's fw_cfg device Message-ID: <20150810191509.GA7264@kroah.com> References: <3b039351aba44759627fa77a0003dad685a9f21d.1439220623.git.somlo@cmu.edu> <20150810183054.GA18817@kroah.com> <20150810190222.GN31816@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150810190222.GN31816@HEDWIG.INI.CMU.EDU> User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1571 Lines: 33 On Mon, Aug 10, 2015 at 03:02:22PM -0400, Gabriel L. Somlo wrote: > Mainly, qemu's fw_cfg is a read-only "device", so one wouldn't ever > care to try writing anything to it. /sys/firmware/... feels like a fit > because fw_cfg contains binary blobs originally meant to be used by > the bios (it's how SeaBIOS and OVMF pull smbios and acpi tables out of > the host and set them up in guest memory before booting the guest kernel, > as one of the many examples). > > The most similar example (and the existing driver I used as an example > during implementation) is dmi-sysfs.c, which also exposes all the > metadata for each smbios table as numeric (or string) read-only attributes, > and has a "raw" attribute which allows dumping each table in its > entirety. Same thing here -- I want to expose the name, size, and > select key for each blob, but also allow access to the "payload", i.e. > the blob itself. That's great, and you can have these "blobs" be an attribute for a struct device. Just using a "raw" kobject as you are is hard, as you have seen, and messy. Making it a "real" device makes this all much easier and simpler. Now if you want to keep things in /sys/firmware/ that's another issue, and would have to stay as a kobject. so maybe it does need to remain, need to think about that... thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/