From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752798AbbJENNm (ORCPT ); Mon, 5 Oct 2015 09:13:42 -0400 Received: from SMTP.ANDREW.CMU.EDU ([128.2.105.204]:45122 "EHLO smtp.andrew.cmu.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752190AbbJENNl (ORCPT ); Mon, 5 Oct 2015 09:13:41 -0400 Date: Mon, 5 Oct 2015 09:13:22 -0400 From: "Gabriel L. Somlo" To: Peter Maydell Cc: Mark Rutland , gregkh@linuxfoundation.org, paul@pwsan.com, Kumar Gala , Will Deacon , agross@codeaurora.org, zajec5@gmail.com, Hanjun Guo , Catalin Marinas , "linux-api@vger.kernel.org" , lkml - Kernel Mailing List , kernelnewbies@kernelnewbies.org, Matt Fleming , Laszlo Ersek , Jordan Justen , "Michael S. Tsirkin" , Leif Lindholm , Ard Biesheuvel , Paolo Bonzini , Gerd Hoffmann , QEMU Developers Subject: Re: [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device Message-ID: <20151005131322.GH1977@HEDWIG.INI.CMU.EDU> References: <1443914889-9619-1-git-send-email-somlo@cmu.edu> <20151005100035.GA19064@leverpostej> <20151005124042.GF1977@HEDWIG.INI.CMU.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.23 (2014-03-12) X-PMX-Version: 6.0.3.2322014, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2015.10.5.130316 X-SMTP-Spam-Clean: 8% ( MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1700_1799 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, FROM_EDU_TLD 0, NO_URI_HTTPS 0, REFERENCES 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CT 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __HAS_FROM 0, __HAS_MSGID 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0) X-SMTP-Spam-Score: 8% Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 05, 2015 at 01:50:47PM +0100, Peter Maydell wrote: > On 5 October 2015 at 13:40, Gabriel L. Somlo wrote: > > In addition, Michael's comment earlier in the thread suggests that > > even my current acpi version isn't sufficiently "orthodox" w.r.t. > > ACPI, and I should be providing the hardware access routine as > > an ACPI/AML routine, to avoid race conditions with the rest of ACPI, > > and for encapsulation. I.e. it's even rude to use the fw_cfg node's > > ACPI _CRS method (the part where I'd be treating it like a DT stand-in > > only to query fw_cfg's hardware specifics). > > If you want to try to support "firmware might also be reading > fw_cfg at the same time as the kernel" this is a (painful) > problem regardless of how the kernel figures out whether a > fw_cfg device is present. I had assumed that one of the design > assumptions of this series was that firmware would only > read the fw_cfg before booting the guest kernel and never touch > it afterwards. If it might touch it later then letting the > guest kernel also mess with fw_cfg seems like a really bad idea. I don't know of any case where firmware and kernel might race each other to access fw_cfg. The issue AFAICT is whether it's safe (future-proof) to rely on parsing _CRS for the fw_cfg i/o access information, or whether such logic could be rendered obsolete by potential future updates to fw_cfg's _CRS. If I "outsource" the fw_cfg_dump_blob_by_key() functionality entirely to an ACPI method, my kernel driver won't have to worry about keeping up with said future updates. On the down-side, that means the kernel driver will be ACPI or nothing (but I'm OK with that, at my curent level of understanding :) Thanks, --Gabriel