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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08203C433F5 for ; Tue, 4 Oct 2022 11:40:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229590AbiJDLkI (ORCPT ); Tue, 4 Oct 2022 07:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiJDLkE (ORCPT ); Tue, 4 Oct 2022 07:40:04 -0400 Received: from zero.eik.bme.hu (zero.eik.bme.hu [152.66.115.2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 806DD2C13D for ; Tue, 4 Oct 2022 04:39:57 -0700 (PDT) Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 7177274632C; Tue, 4 Oct 2022 13:39:52 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 0601274632B; Tue, 4 Oct 2022 13:39:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 03082746307; Tue, 4 Oct 2022 13:39:52 +0200 (CEST) Date: Tue, 4 Oct 2022 13:39:51 +0200 (CEST) From: BALATON Zoltan To: "Jason A. Donenfeld" cc: Peter Maydell , =?ISO-8859-15?Q?Philippe_Mathieu-Daud=E9?= , qemu-devel@nongnu.org, Jiaxun Yang , Aurelien Jarno , kvm-devel , Laurent Vivier , =?ISO-8859-15?Q?Daniel_P=2E_Berrang=E9?= Subject: Re: [PATCH v2] mips/malta: pass RNG seed to to kernel via env var In-Reply-To: Message-ID: References: <20221003103627.947985-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 4 Oct 2022, Jason A. Donenfeld wrote: > On Tue, Oct 4, 2022 at 1:03 PM Peter Maydell wrote: >> What I'm asking, I guess, is why you're messing with this board >> model at all if you haven't added this functionality to u-boot. >> This is just an emulation of an ancient bit of MIPS hardware, which >> nobody really cares about very much I hope. > > I think most people emulating MIPS would disagree. This is basically a > reference platform for most intents and purposes. As I mentioned, this > involves `-kernel` -- the thing that's used when you explicitly opt-in > to not using a bootloader, so when you sign up for QEMU arranging the > kernel image and its environment. Neglecting to pass an RNG seed would > be a grave mistake. > >> I'm not saying this is a bad patch -- I'm just saying that >> QEMU should not be in the business of defining bootloader-to-kernel >> interfaces if it can avoid it, so usually the expectation is >> that we are just implementing interfaces that are already >> defined, documented and implemented by a real bootloader and kernel. > > Except that's not really the way things have ever worked here. The > kernel now has the "rngseed" env var functionality, which is useful > for a variety of scenarios -- kexec, firmware, and *most importantly* > for QEMU. Don't block progress here. > >> -kernel generally means "emulate the platform's boot loader" > > And here, a platform bootloader could pass this, just as is the case > with m68k's BI_RNG_SEED or x86's setup_data RNG SEED or device tree's > rng-seed or EFI's LINUX_EFI_RANDOM_SEED_TABLE_GUID or MIPS' "rngseed" > fw environment variable. These are important facilities to have. > Bootloaders and hypervisors alike must implement them. *Do not block > progress here.* Cool dowm. Peter does not want to block progress here. What he said was that the malta is (or should be) emulating a real piece of hardware so adding some stuff to it which is not on that real hardware may not be preferred. If you want to experiment with generic mips hardware maybe you need a virt board instead that is free from such restrictions to emulate a real hardware. Some archs already have such board and there seems to be loongson3-virt but no generic mips virt machine yet. Defining and implementing such board may be more than you want to do for this but maybe that would be a better way to go. Regards, BALATON Zoltan