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.web10.53600.1681947671828068529 for ; Wed, 19 Apr 2023 16:41:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@linux.microsoft.com header.s=default header.b=nAlagqjV; 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.159.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 5001021C2055; Wed, 19 Apr 2023 16:41:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5001021C2055 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1681947671; bh=jzX5K1cqbIOOklTRQrysPhGqVRpmu0sqgfJzegdN5nc=; h=From:To:Cc:Subject:Date:From; b=nAlagqjV+rWMlP5M6YWmoGdQQbLn3kE13d1VL+xgxxozupU9hFHpc3m4uD3g4X4tB BFiYZxpnGWxVvPg1wHYtyd8b9p8oNJ+fU7Fx8AZq1CGGRQzaTnSVsF42iH7ZTbW15S mmlhTdffbK3oejFz5NIj8OOY7Gze3O6H/fHAsxaU= 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 v1 0/2] MdeModulePkg: Add Volatile Keyword to NvmExpress Passthru CQs and SQs Date: Wed, 19 Apr 2023 16:41:06 -0700 Message-Id: <20230419234108.10243-1-osde@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 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 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(-) --=20 2.39.2