From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::42d; helo=mail-wr1-x42d.google.com; envelope-from=galla.rao80@gmail.com; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1E892211B6C12 for ; Thu, 17 Jan 2019 10:26:48 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id j2so12198012wrw.1 for ; Thu, 17 Jan 2019 10:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G1azKx5HO5pyQyEtc9ifAWUBv85qgglr3FTm5h09pc8=; b=F70yroxACwHvYWuC+54modNr2+KcnjZuiceleaxD/xUXKC3oErwEOc+yumddq4MWBi 2NmTauD5O55YfAHBkRKoc8OxqYhCyUevkGCZ0RHb1f1IGhEzYsfFmC7ND6ub37k/IRNS T+jo0ZCKRraFzBomo3OXiLnmqkXv7wDxlJXVfOoomUr857o7C5vBj4Yb1ox4xsEE6pFS LNACnxHZtgO5FHVse3piJT6O3470k7/qxk2D7mtdOPPcdxPMz1s4ylgzsVC1C5YQ58Eb W/kgldW30W4aHiPCyQzPhI9aYimVrBWiBzQwstM2ylJIsVKm4pIJ1KBuaHA4h5zf0bQH 492A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G1azKx5HO5pyQyEtc9ifAWUBv85qgglr3FTm5h09pc8=; b=e8Bd6HsbuhlEnaOe9aabi2cgCBeM2zbXwNuDrZ8JsuS9YeFGMll4sKhquIlk9EXoIY 69FvYMdsNkTHeOd/XulTpgHntUtIMw5Jf9m19g5TEhLFzC3UHecS5iJxpxeDlOb1xat4 6AJKqBve13QdYV1iYUyYqESTJXjgUejyq0a/DUUeRVLYDYV9/q+75SGAY9BotGhdNYro m2Wu2VzLlL8CevexIEkim0f86eXXPUE41KD4YRhgYMrIM6rkKkqWizEqIsajWVxe62dd y+6+qz80w5hLovQ2ZtH4mPS1C+euhPCe3mo43cEmWrEzdshHjlN2PGQf/74UXF01EBqO 8GFw== X-Gm-Message-State: AJcUukcW/3aT/Qlkk1lFtTsuNiKTrq/9N3ZeHi+tFjA2fEWteKyOxy1Z eLPWI5X+bLZmALT/fPKFxEZC8WEf/4u6g+VJn70= X-Google-Smtp-Source: ALg8bN6GQLYvt+BYndmFuk2e56eluei4uZxzqU7Hsg0mse6J43s8mXpg8tHgz8ohfmLMfr2QpWG5QmO6wsx4HVHjL1k= X-Received: by 2002:a5d:68c3:: with SMTP id p3mr13565523wrw.34.1547749606425; Thu, 17 Jan 2019 10:26:46 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: galla rao Date: Thu, 17 Jan 2019 18:26:35 +0000 Message-ID: To: Andrew Fish Cc: edk2-devel@lists.01.org X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: Query on Variable Services X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jan 2019 18:26:48 -0000 Content-Type: text/plain; charset="UTF-8" Thanks Andrew! SPI driver has failed the call to, in the log i could see the failure Status = gDS->SetMemorySpaceAttributes ( BaseAddress, Length, GcdDescriptor.Attributes | EFI_MEMORY_RUNTIME ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_WARN, "Variable driver failed to add EFI_MEMORY_RUNTIME attribute to Flash.\n")); } if this call has failed SetVirtualAddress would not be useful for Virtual Address conversion for this region I believe Best Regards Ranga On Thu, Jan 17, 2019 at 5:55 PM Andrew Fish wrote: > Galla, > > The PCD value usually get set as the result of the build. > > EFI_MEMORY_RUNTIME attribute is used to request a virtual mapping from the > OS. When the variable services are called from the OS the run in a virtual > address space provided by the OS. Thus trying to access 0xFFE00000 would > page fault. > > You can run the memmap command from the EFI Shell and see if bit 63 is > set. If your SPI controller is a memory mapped hardware device you may also > need to map the SPI register via EFI_MEMORY_RUNTIME. The SPI driver also > needs to deal with the SetVirtualAddress map event to convert its pointers > over to the new OS provided virtual memory space. > > Thanks, > > Andrew Fish > > > > On Jan 17, 2019, at 9:23 AM, galla rao wrote: > > > > Hi All, > > > > Have a question for Variable services > > > > Given PCD's are initialized > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase | > 0xFFE00000 > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase | > > 0xFFE3E000 > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase | > > 0xFFE40000 > > > > Do i need to make these regions as *EFI_MEMORY_RUNTIME *through > > *gDS->SetMemorySpaceAttributes* > > > > SPI Flash writes within BIOS works good! > > > > *when trying to change BootOrder from efibootmgr, the failure is seen* > > > > It would be useful if someone has faced this issue earlier and can > respond > > kindly. > > > > Best Regards > > Galla > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > >