From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.27508.1682616987024532303 for ; Thu, 27 Apr 2023 10:36:27 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=GJOtV6yO; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: osde@linux.microsoft.com) Received: from OSD-Desktop.redmond.corp.microsoft.com (unknown [131.107.1.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 80E1221C33E0; Thu, 27 Apr 2023 10:36:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 80E1221C33E0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682616986; bh=duTJ0qjGiJAP+IPdjtt3dAfUoa5BJmi+JyL8a2+iDyg=; h=From:To:Cc:Subject:Date:From; b=GJOtV6yOej8pJx9oMszYAclUxTPuFMVE0OKK4S4tI6GAtQuGndTvfP3k7TTfMiKFH PRq5iZ0FTtfyWicqwFOlUraTSHa7pO+PFCbrBjdETJ+HnmcEyCf2TjmNgMVjHfg1k/ AilntpEWlKVaCtOKdDfHrMT792p1A3fZo08f4vA0= From: "Oliver Smith-Denny" To: devel@edk2.groups.io Cc: Hao A Wu , Ray Ni , Jian J Wang , Liming Gao , Michael Kubacki , Sean Brogan Subject: [edk2-devel][PATCH v2 0/2] Add Volatile Keyword to NvmExpress Passthru CQs Date: Thu, 27 Apr 2023 10:36:20 -0700 Message-Id: <20230427173622.10614-1-osde@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable NVMe CQs are hardware queues mapped to EFI memory. In the NVMExpress Passthru implementations in PEI and DXE, it has been observed that NVMe CQs 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. Personal GitHub PR: https://github.com/tianocore/edk2/pull/4320 Github branch: https://github.com/os-d/edk2/tree/osde/volatile_cq_v2 Changes v1 =3D> v2: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - Remove volatile keyword from SQ Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Cc: Michael Kubacki Cc: Sean Brogan Oliver Smith-Denny (2): Add the volatile keyword to NvmExpressDxe's Passthru CQ Add volatile keyword to NvmExpressPei's Passthru CQ MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 6 +++--- MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) --=20 2.40.0