From nobody Sun May 19 20:47:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103263+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103263+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1681947673; cv=none; d=zohomail.com; s=zohoarc; b=YWI62K/Py4ECjW4XI8s/xRuvucncPTS1bhH0jLjiZ9knTPe2rbVr84ZU/cyf3jWSZqqAaiMwlp0Pv7xD44N24NyJlhMbyaOiEhKnxfPZZOgRc+7wp+e6XQQOR8sSX1DOywPXfxtaQKyK7WL8Djc51rCLFMCOI0x3tJsfWXd8upg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681947673; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=0FX98JWwPfPrcOJNCJwN4z3xHMXCWzHU/ZYgCDPIlBY=; b=Fm4nCKyTF6yJBqyidHb7QUAnHrF4ZUhYygkCGI9vDMLBIJo89YcXvtO9XmsSE/MDqvo7nQX+8GtAYdqNYTTZz4n3MnXmIwatyYg0loySUzkcdWPkS5d2r5PPBIAJtpgmK4jIAOuWIlvI+9uTYpg0cbYJMXjMhJ+qyxwBdRN9Eio= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103263+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1681947673592572.4455991763975; Wed, 19 Apr 2023 16:41:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id hlDUYY1788612xpqquMPHvAE; Wed, 19 Apr 2023 16:41:13 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web11.54078.1681947672146615853 for ; Wed, 19 Apr 2023 16:41:12 -0700 X-Received: from OSD-Desktop.redmond.corp.microsoft.com (unknown [131.107.159.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 75F6B21C205A; Wed, 19 Apr 2023 16:41:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 75F6B21C205A 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 1/2] Add the volatile keyword to NvmExpressDxe's Passthru CQs and SQs. Date: Wed, 19 Apr 2023 16:41:07 -0700 Message-Id: <20230419234108.10243-2-osde@linux.microsoft.com> In-Reply-To: <20230419234108.10243-1-osde@linux.microsoft.com> References: <20230419234108.10243-1-osde@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osde@linux.microsoft.com X-Gm-Message-State: IjLPFlaAqWLrFOYTk1rtra2Wx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1681947673; bh=3zcHYjhjF802p7+xQc/f0+f7QcEtjYzJ+0tl29g7cvc=; h=Cc:Date:From:Reply-To:Subject:To; b=OomDSijsiqhUVJyInJsf6q8OkmgnvNG/395QjEwin0Ja70U5h4t8HTvSHHPB7gdHcwg yFtKDrCQ7WUxW+WDD4FbL54bLKeyaAXkjfp1xGYjVCG++SofXRhM3tMBiOE0kdGnJJT43 CtZ0D7+l82KXRc6rvf6zDHFe9f76BBWyeHI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1681947674424100006 Content-Type: text/plain; charset="utf-8" This updates the relevant functions that expect a non-volatile structure to be passed to them to take casts of the CQ and SQ, now that they are 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c b/MdeM= odulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c index f37baa626a16..1a7e39500ac0 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressPassthru.c @@ -459,8 +459,8 @@ NvmExpressPassThru ( EFI_STATUS Status; EFI_STATUS PreviousStatus; EFI_PCI_IO_PROTOCOL *PciIo; - NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_SQ *Sq; + volatile NVME_CQ *Cq; UINT16 QueueId; UINT16 QueueSize; UINT32 Bytes; @@ -581,7 +581,7 @@ NvmExpressPassThru ( return EFI_INVALID_PARAMETER; } =20 - ZeroMem (Sq, sizeof (NVME_SQ)); + ZeroMem ((VOID *)Sq, sizeof (NVME_SQ)); Sq->Opc =3D (UINT8)Packet->NvmeCmd->Cdw0.Opcode; Sq->Fuse =3D (UINT8)Packet->NvmeCmd->Cdw0.FusedOperation; Sq->Cid =3D Private->Cid[QueueId]++; @@ -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 respon= se buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETIO= N)); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_C= OMPLETION)); } else { // // Timeout occurs for an NVMe command. Reset the controller to abort t= he --=20 2.39.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103263): https://edk2.groups.io/g/devel/message/103263 Mute This Topic: https://groups.io/mt/98378948/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sun May 19 20:47:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103264+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103264+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.microsoft.com ARC-Seal: i=1; a=rsa-sha256; t=1681947673; cv=none; d=zohomail.com; s=zohoarc; b=TYT995IfV5doDhPLoJbZLAIixzoT3YiClSRbCXRFFpbByGR+7ZNP1rhiNvz3h+ARBI96vSq+BRD4P44MdJ5u1AvQ0w3wXf8V5TEhsh8H7N4qgiMhJS1aKgrrra6/4AP6rKsWR9bNfbV0xF97CMTc8QQhAwTkS6mRRXvVgwVV9hQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1681947673; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=NY04LcNNVOW6cls2sRvhWbumMbR/4A3I65+bvq3LLuE=; b=PCZGCN2Qa/fW+WxEQPVG8FNi4CD0mu3rW6SxCDiWkE6mBMLeZMd+JMQba6/xjIgiiy3i29YEoinDshDFeUIunpkf8/Iy6WKAXZr3bjlYjHU+qxAA003j/AqNZJTCFYtKiIcot191EaSyp/SEUcV8XBjEZKb3rmzXy/O0zP0RH94= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103264+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1681947673416148.91867270973137; Wed, 19 Apr 2023 16:41:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id i89CYY1788612x2VGk61lzmF; Wed, 19 Apr 2023 16:41:13 -0700 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.53601.1681947672260312361 for ; Wed, 19 Apr 2023 16:41:12 -0700 X-Received: from OSD-Desktop.redmond.corp.microsoft.com (unknown [131.107.159.171]) by linux.microsoft.com (Postfix) with ESMTPSA id 9956321C205B; Wed, 19 Apr 2023 16:41:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9956321C205B 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 2/2] Add volatile keyword to NvmExpressPei's Passthru CQs and SQs. Date: Wed, 19 Apr 2023 16:41:08 -0700 Message-Id: <20230419234108.10243-3-osde@linux.microsoft.com> In-Reply-To: <20230419234108.10243-1-osde@linux.microsoft.com> References: <20230419234108.10243-1-osde@linux.microsoft.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,osde@linux.microsoft.com X-Gm-Message-State: Sulc7TJyoaNO2RttuJF8dBFYx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1681947673; bh=4h2immOilhSpxU/JcJqUbNsZE8DtkVetteuxmBtwdcI=; h=Cc:Date:From:Reply-To:Subject:To; b=E8PQv0M6yb0LQjqGO+8kAYyHHtvGUqdOksOkzqlnCnnZ5PLajaPiuTVzjcAbTWk7/dR YIzGYMl7mB2eUHkeePMsnWc4iTNLkeorgaPjLlGOtQxbwWRdAiPVbwfUJuyCEpU8tIF/i f5bBv/AE2RK4RUult7WbppSvIwgsaJ3B7Fk= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1681947673955100001 Content-Type: text/plain; charset="utf-8" This applies the volatile keyword and appropriate casts to the NvmExpressPei's Passthru CQs and SQs. 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/NvmExpressPei/NvmExpressPeiPassThru.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c b/M= deModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c index 5081b53cd5e8..70b0b9d5965c 100644 --- a/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c +++ b/MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPeiPassThru.c @@ -115,7 +115,7 @@ NvmeCreatePrpList ( **/ EFI_STATUS NvmeCheckCqStatus ( - IN NVME_CQ *Cq + IN volatile NVME_CQ *Cq ) { if ((Cq->Sct =3D=3D 0x0) && (Cq->Sc =3D=3D 0x0)) { @@ -343,8 +343,8 @@ NvmePassThruExecute ( ) { EFI_STATUS Status; - NVME_SQ *Sq; - NVME_CQ *Cq; + volatile NVME_SQ *Sq; + volatile NVME_CQ *Cq; UINT8 QueueId; UINTN SqSize; UINTN CqSize; @@ -414,7 +414,7 @@ NvmePassThruExecute ( return EFI_INVALID_PARAMETER; } =20 - ZeroMem (Sq, sizeof (NVME_SQ)); + ZeroMem ((VOID *)Sq, sizeof (NVME_SQ)); Sq->Opc =3D (UINT8)Packet->NvmeCmd->Cdw0.Opcode; Sq->Fuse =3D (UINT8)Packet->NvmeCmd->Cdw0.FusedOperation; Sq->Cid =3D Private->Cid[QueueId]++; @@ -617,7 +617,7 @@ NvmePassThruExecute ( // // Copy the Respose Queue entry for this command to the callers response= buffer // - CopyMem (Packet->NvmeCompletion, Cq, sizeof (EFI_NVM_EXPRESS_COMPLETION)= ); + CopyMem (Packet->NvmeCompletion, (VOID *)Cq, sizeof (EFI_NVM_EXPRESS_COM= PLETION)); =20 // // Check the NVMe cmd execution result --=20 2.39.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#103264): https://edk2.groups.io/g/devel/message/103264 Mute This Topic: https://groups.io/mt/98378949/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-