public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel][PATCH v1 0/2] MdeModulePkg: Add Volatile Keyword to NvmExpress Passthru CQs and SQs
@ 2023-04-19 23:41 Oliver Smith-Denny
  2023-04-19 23:41 ` [edk2-devel][PATCH v1 1/2] Add the volatile keyword to NvmExpressDxe's " Oliver Smith-Denny
  2023-04-19 23:41 ` [edk2-devel][PATCH v1 2/2] Add volatile keyword to NvmExpressPei's " Oliver Smith-Denny
  0 siblings, 2 replies; 8+ messages in thread
From: Oliver Smith-Denny @ 2023-04-19 23:41 UTC (permalink / raw)
  To: devel
  Cc: Hao A Wu, Ray Ni, Jian J Wang, Liming Gao, Michael Kubacki,
	Sean Brogan

NVMe CQs and SQs are hardware queues mapped to EFI memory.
In the NVMExpress Passthru implementations in PEI and DXE,
it has been observed that NVMe CQs and SQs are not marked
volatile, meaning the compiler has significant leeway
to optimize accesses to these structures.

This led to an issue where the passthru driver waited
for a timeout period for an NVMe CQ to mark that it was
finished with a transaction, but the compiler had
optimized away the read to the actual HW mapped memory,
so the transaction had completed but the timeout continued.

Marking the CQs as volatile fixes this issue as the reads
happen to the actual HW. There may be similiar issues with
NVMe SQs, so this patch also marks them as volatile to
reflect they are HW resources.

Personal GitHub PR: https://github.com/tianocore/edk2/pull/4289
Github branch: https://github.com/os-d/edk2/tree/osde/volatile_cq_v1

Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>

Oliver Smith-Denny (2):
  Add the volatile keyword to NvmExpressDxe's Passthru CQs and SQs.
  Add volatile keyword to NvmExpressPei's Passthru CQs and SQs.

 MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c    | 10 +++++-----
 MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.39.2


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-04-27  1:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-19 23:41 [edk2-devel][PATCH v1 0/2] MdeModulePkg: Add Volatile Keyword to NvmExpress Passthru CQs and SQs Oliver Smith-Denny
2023-04-19 23:41 ` [edk2-devel][PATCH v1 1/2] Add the volatile keyword to NvmExpressDxe's " Oliver Smith-Denny
2023-04-20  0:48   ` Ni, Ray
2023-04-20 15:48     ` [edk2-devel] [PATCH " Oliver Smith-Denny
2023-04-26  6:32       ` Wu, Hao A
2023-04-26 21:06         ` Oliver Smith-Denny
2023-04-27  1:27           ` Wu, Hao A
2023-04-19 23:41 ` [edk2-devel][PATCH v1 2/2] Add volatile keyword to NvmExpressPei's " Oliver Smith-Denny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox