File ovmf-MdeModulePkg-NvmExpressDxe-fix-check-for-Cap.Css.patch of Package ovmf.25915
From 5d8d8b514832fcaa36c0b573b51442c2f53e2aaf Mon Sep 17 00:00:00 2001
From: "Mara Sophie Grosch via groups.io" <littlefox=lf-net.org@groups.io>
Date: Wed, 23 Mar 2022 18:22:33 +0800
Subject: [PATCH] MdeModulePkg/NvmExpressDxe: fix check for Cap.Css
Fix the check for NVMe command set being supported by the controller.
Was problematic with qemu (6.2.0, Debian 1:6.2+dfsg-3), which sets 0xC1
in that register, making the OVMF think the NVMe controller does not
support NVMe.
Uncovered by commit 9dd14fc91c174eae87fd122c7ac70073a363527f, which
changed the number of bits included in the Css register from 4 to 8.
Signed-off-by: Mara Sophie Grosch <littlefox@lf-net.org>
Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
Acked-by: Lee, Chun-Yi <jlee@suse.com>
---
MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: edk2-edk2-stable202202/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
===================================================================
--- edk2-edk2-stable202202.orig/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
+++ edk2-edk2-stable202202/MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressHci.c
@@ -785,7 +785,7 @@ NvmeControllerInit (
return Status;
}
- if (Private->Cap.Css != 0x01) {
+ if ((Private->Cap.Css & BIT0) == 0) {
DEBUG ((DEBUG_INFO, "NvmeControllerInit: the controller doesn't support NVMe command set\n"));
return EFI_UNSUPPORTED;
}