Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2A10CECAAD8 for ; Wed, 21 Sep 2022 09:17:41 +0000 (UTC) Received: from localhost ([::1]:35060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oavrQ-0000wH-1t for qemu-devel@archiver.kernel.org; Wed, 21 Sep 2022 05:17:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oavmr-0007WO-Ty for qemu-devel@nongnu.org; Wed, 21 Sep 2022 05:12:59 -0400 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]:44338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oavmq-0006I7-5Z for qemu-devel@nongnu.org; Wed, 21 Sep 2022 05:12:57 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 23BD16295D; Wed, 21 Sep 2022 09:12:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD387C433D7; Wed, 21 Sep 2022 09:12:53 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="SFksPcjF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1663751572; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6cdtt/a15aBYz+b1qKhlQuFqm7guUi/dvluBj4Cxd9o=; b=SFksPcjFglZQSBwHGY9SfR/qiTfIXSomp8KqIztJgIIjOM6WrWGejDSRipJtjKpfEvLv4/ ddX1qQCb8lHSh/CrbLUedfVJF9YX8bY+0FBN/NZ2Ze6SA41CEdkMIUzplnvzFmMZ3zqqmO ezZZcKkWmvbdunZlfioo+U7VASRpECg= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 671d3daf (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 21 Sep 2022 09:12:52 +0000 (UTC) Date: Wed, 21 Sep 2022 11:12:49 +0200 From: "Jason A. Donenfeld" To: Paolo Bonzini Cc: qemu-devel@nongnu.org, Gerd Hoffmann , Laurent Vivier , "Michael S . Tsirkin" , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Richard Henderson , Ard Biesheuvel Subject: Re: [PATCH v4 1/2] x86: return modified setup_data only if read as memory, not as file Message-ID: References: <20220913234135.255426-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=2604:1380:4641:c500::1; envelope-from=SRS0=I7lL=ZY=zx2c4.com=Jason@kernel.org; helo=dfw.source.kernel.org X-Spam_score_int: -67 X-Spam_score: -6.8 X-Spam_bar: ------ X-Spam_report: (-6.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, Sep 21, 2022 at 11:04:17AM +0200, Jason A. Donenfeld wrote: > > Also I think it's cleaner if a reset callback puts the value back to > > zero. fw_cfg already has fw_cfg_machine_reset, so perhaps the easiest > > way is to add a FWCfgCallback reset_cb argument to just > > fw_cfg_add_bytes_callback. If I am missing something and it's not > > necessary I can do the cpu_to_le32 change myself or wait for you; in > > any case I'll wait for either your ack or a v5. > > Actually, the idea is for the change to be permanent, since that > represents how the system has actually been booted. Are there > substantial changes possible to the firmware configuration on > fw_cfg_machine_reset() that setting this back how it was would make a > difference? Or do we benefit from having some consistency? Looking at this more, I think your suggestion makes sense. I also have a very straight forward way of implementing it. I'll send a v5 in a minute. Jason