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.27509.1682616987179416161 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=o4dbSXiC; 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 AB51621C33E1; Thu, 27 Apr 2023 10:36:26 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com AB51621C33E1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1682616986; bh=pWccX6tFJx/X9y3WNTu+l6GdvFOdSP3N98dBzBkZDuA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o4dbSXiCg6fK/qJmHqaomrq0FbFpa8We86lrZAmfJ667ZOiADSQWaclIGcF2XAQHC UzzddQwTul/7CBU751xtNneMbOkPil/FXrPzmrl9uxxOoN0ob2zGn+wiRbfuHr49kw ixetK7ZyufrOS6weLxoHtGAURVOf9sf1EMRIV4u4= 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 1/2] Add the volatile keyword to NvmExpressDxe's Passthru CQ Date: Thu, 27 Apr 2023 10:36:21 -0700 Message-Id: <20230427173622.10614-2-osde@linux.microsoft.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230427173622.10614-1-osde@linux.microsoft.com> References: <20230427173622.10614-1-osde@linux.microsoft.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable This updates the relevant functions that expect a non-volatile structure to be passed to them to take casts of the CQ now that it is volatile. Cc: Hao A Wu Cc: Ray Ni Cc: Jian J Wang Cc: Liming Gao Cc: Michael Kubacki Cc: Sean Brogan Signed-off-by: Oliver Smith-Denny --- MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/Md= eModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index f37baa626a16..2ff2cb0e8d36 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -460,7 +460,7 @@ NvmExpressPassThru ( EFI_STATUS PreviousStatus; EFI_PCI_IO_PROTOCOL *PciIo; NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_CQ *Cq; UINT16 QueueId; UINT16 QueueSize; UINT32 Bytes; @@ -815,14 +815,14 @@ NvmExpressPassThru ( // Dump every completion entry status for debugging. // DEBUG_CODE_BEGIN (); - NvmeDumpStatus (Cq); + NvmeDumpStatus ((NVME_CQ *)Cq); DEBUG_CODE_END (); } =20 // // Copy the Respose Queue entry for this command to the callers resp= onse buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLET= ION)); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS= _COMPLETION)); } else { // // Timeout occurs for an NVMe command. Reset the controller to abort= the --=20 2.40.0