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.17683.1683251506592991874 for ; Thu, 04 May 2023 18:51:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=jHAjgTwM; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.201.8.94]) by linux.microsoft.com (Postfix) with ESMTPSA id 5B54A20EA24F; Thu, 4 May 2023 18:51:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 5B54A20EA24F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1683251506; bh=rGWpMNbr3TOBLbMZbJ9N0XL7nj7ZdbiZgAH1o4Vi5Lg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jHAjgTwMdgFJ3oPkYPU0hMEWQCDWiy7YUg+n6UKD1zAKSGBDjmA9u6OZwGdsBP2nf TKYEjB5+M0cwgzpLhCbTVcGh8gnh3cQ3DLY4Dy3Rbkm4+wGuj/QDMNXKOuJkPTpv3Z w655syxudYP4NrO1f52S7LOFzXBjylhTH4SqHsrw= Message-ID: <7f693d58-5a3a-054a-295d-ec0c98ca0c47@linux.microsoft.com> Date: Thu, 4 May 2023 21:51:43 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [edk2-devel][PATCH v2 0/2] Add Volatile Keyword to NvmExpress Passthru CQs To: devel@edk2.groups.io, osde@linux.microsoft.com Cc: Hao A Wu , Ray Ni , Jian J Wang , Liming Gao , Sean Brogan References: <20230427173622.10614-1-osde@linux.microsoft.com> From: "Michael Kubacki" In-Reply-To: <20230427173622.10614-1-osde@linux.microsoft.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit For the series: Acked-by: Michael Kubacki On 4/27/2023 1:36 PM, Oliver Smith-Denny wrote: > 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 => v2: > ================= > - 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(-) >