From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mx.groups.io with SMTP id smtpd.web09.8041.1665417934435319933 for ; Mon, 10 Oct 2022 09:05:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=H4BOyEVj; spf=pass (domain: ventanamicro.com, ip: 209.85.214.181, mailfrom: sunilvl@ventanamicro.com) Received: by mail-pl1-f181.google.com with SMTP id z20so10753953plb.10 for ; Mon, 10 Oct 2022 09:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ua0l5tAyRii01H4pQSujufj2jcLax6j3lQ+nJpUbcaY=; b=H4BOyEVjtWji/e3SmDk42pRCk3zvJOHPku+0Ui+O6ew1UzfsRtBWTNHP624qt9TPZ7 +gJQ+D74KP5AzIRdQZhy/jc4lS68dEl5UMnftsVDEzzM/1+zbJMnXVPHR9UC7GfUUNuc BZdzCGbSnHuje8rRQCD2oiJpTq3+Xmgnv/P+bz/t1RqdYlynSKdUb1DIjT8I7hf1ha17 gZlU5J9uh0sB7ymzCLGmgax2zj7E/yy2D7+gR8VkHkw1Wb5e9qIrlZ37CGSPlqY92EUf R7mX5rx7oDQkaVql4OHcEIyWxTO4ux2rpqM4Jz+s34+zLsI0tDh3fD99hXzsQWkzNIbA PCCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ua0l5tAyRii01H4pQSujufj2jcLax6j3lQ+nJpUbcaY=; b=W7DFaiH9q3BYPfMkVDRbFp2eaIE1nTXlQOcNxRUJz5WeF0omtHUg4Yxpy0S69croHL mMW8Z7pb/Exp+YmtCHCig7XtU7w8KDCy/2ACQ/zArnhoe1mXu6/ypet7Jq1zyXryxddb v3t92tT7Cat4nfhYclNFvk9twhoH5qhEULzRFBCv24TvAfQFQfVPUP8xEhye6hqi00/9 FcZcfGck+h24cx+bjjHcaSoE7Cipz0aPjtJH2DhojLMtbh3gMOhAcjG7LcMSd6dsOCdQ lfuHdfkRoNcxOoMtXUqzFD9gvmtzN4dSG0AXIKn8LwlcwbdRFSHWF0/weB494iXEVHYr lNLQ== X-Gm-Message-State: ACrzQf1z8MXM84cB2kKxoYV1PwsGPN+eIotGFnhJCPD607KxQvsErLFY 1R41UtJayRhgnkXWoOsKNgX/gw== X-Google-Smtp-Source: AMsMyM6h2ELgD14NN8btBy86N5ZtuFTAN4Zd1ZuyUO2uDh6ekpzuI/f5Wqka59SKh5MOs7vmY1mQlQ== X-Received: by 2002:a17:90b:314b:b0:203:41c:2dbb with SMTP id ip11-20020a17090b314b00b00203041c2dbbmr21386043pjb.18.1665417933978; Mon, 10 Oct 2022 09:05:33 -0700 (PDT) Return-Path: Received: from sunil-laptop ([49.206.13.138]) by smtp.gmail.com with ESMTPSA id n9-20020a170902d2c900b0017da2798025sm6859239plc.295.2022.10.10.09.05.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 09:05:33 -0700 (PDT) Date: Mon, 10 Oct 2022 21:35:28 +0530 From: "Sunil V L" To: Ard Biesheuvel Cc: devel@edk2.groups.io, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: Re: [edk2-staging/RiscV64QemuVirt PATCH 26/29] OvmfPkg: Add generic Qemu NOR flash DXE driver Message-ID: References: <20221010101202.1146624-1-sunilvl@ventanamicro.com> <20221010101202.1146624-27-sunilvl@ventanamicro.com> MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Oct 10, 2022 at 05:29:15PM +0200, Ard Biesheuvel wrote: > 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. Great. Let me rework these patches then. > > But you haven't answered my question regarding how your version was simplified. > Oh sorry. I forgot to modify the commit message but what I really meant was removing the code which depends upon PcdNorFlashCheckBlockLocked for virtual platforms. I thought it is useful only for real platforms and qemu doesn't emulate it. Let me know if I am wrong. Since the driver is copied for OVMF, I didn't want to add the PCD unnecessarily. > 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. I was not looking at optimizing it at this point of time. Thanks Sunil