From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web09.7633.1665415770738190099 for ; Mon, 10 Oct 2022 08:29:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PaCipjW/; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) 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 2988660F99 for ; Mon, 10 Oct 2022 15:29:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F75BC433B5 for ; Mon, 10 Oct 2022 15:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665415769; bh=xu29yZEH+l/dv8cwCRLrXx9vCd6FS9NYUf4IB/Gii7w=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PaCipjW/b93tRqoJDObTc13Y+z2dbPQSTCl2FsoR9HosNHzwu7AECKlhC0+rmezBk lAEjIwKk8I9DWlLYC+mYEphtzysuNVEuQBz4rNcLysF8gJnivjPVqZaaVEUpABjwoL +oW8o1pxoK+LpzVrdhFL1bqm2WOSiayE2EQlxNNQ4VrfzZ4q9IXqpcbvck+9rabEHS CUfHcM7U78wa/MBcBrMNs1G326rmCy/lH3xoF8aXcmxX3OcDZhCuSaI7a5JefmwYRO TcdmLEhdH+Bb0OohEM2HDHKDtABpUimMxhzmk5VfUkh0Y5COjRgAycaAQSePDNTMYD C4hrlyQV2cSuQ== Received: by mail-lf1-f49.google.com with SMTP id f37so17100103lfv.8 for ; Mon, 10 Oct 2022 08:29:29 -0700 (PDT) X-Gm-Message-State: ACrzQf3Pm27inzwyYe3xJm6F0D52Kh94v9hHGD7rutEkTHW1B1F8DRLs Rc+p3DmfYCQtnMrN/yDoiL28LkmzKbPZopsp3uk= X-Google-Smtp-Source: AMsMyM6Efu8ziGNwU6qXhWs2VyiRoYiGYv8PvnIgU89iHvJaBusYPdUgYs5QaF+Hos6euC0LlddePkdQOgt74NK6v0c= X-Received: by 2002:ac2:4c47:0:b0:4a2:c07b:4b62 with SMTP id o7-20020ac24c47000000b004a2c07b4b62mr4395210lfk.426.1665415767497; Mon, 10 Oct 2022 08:29:27 -0700 (PDT) MIME-Version: 1.0 References: <20221010101202.1146624-1-sunilvl@ventanamicro.com> <20221010101202.1146624-27-sunilvl@ventanamicro.com> In-Reply-To: From: "Ard Biesheuvel" Date: Mon, 10 Oct 2022 17:29:15 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-staging/RiscV64QemuVirt PATCH 26/29] OvmfPkg: Add generic Qemu NOR flash DXE driver To: Sunil V L Cc: devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Content-Type: text/plain; charset="UTF-8" On Mon, 10 Oct 2022 at 17:19, Sunil V L wrote: > > On Mon, Oct 10, 2022 at 12:39:21PM +0200, Ard Biesheuvel wrote: > > On Mon, 10 Oct 2022 at 12:13, Sunil V L wrote: > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076 > > > > > > RISC-V needs NorFlashDxe driver for qemu virt machine. The > > > ArmPlatformPkg has this driver but migrating it to generic > > > package like MdeModulePkg introduces circular dependencies. > > > So, add a simplified version of the NorFlashDxe driver in > > > OvmfPkg. > > > > > > > So what is the difference between this simplified version and the old > > version? And it is backed in QEMU by the same NOR flash emulation, > > shouldn't we use this driver for ArmVirtQemu as well? > > I agree. If we can break the dependency on EmbeddedPkg due to > NvVarStoreFormattedLib, then we can migrate to MdeModulePkg and all > consumers can use the same driver which would be the best solution IMO. > > Could you please let me know why NvVarStoreFormattedLib is added > in EmbeddedPkg instead of MdePkg or MdeModulePkg? Is it only for > non-server class platforms? I don't see it doing much so not sure > its use case. > I think that library as well as the definition of gEdkiiNvVarStoreFormattedGuid should be moved to MdeModulePkg. Then, we can look at moving NorFlashDxe in there as well. But you haven't answered my question regarding how your version was simplified. Note that there is some room for improvement in that driver in relation to execution under KVM: switching between programming mode and array mode involves setting up/tearing down the KVM memslot, and currently, the driver is far from optimized when it comes to minimizing the number of transitions between read mode and write mode.