git: b9d3945831fc - main - ahci: Restrict NVMe redirection by BAR size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 09 Feb 2026 19:29:42 UTC
The branch main has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=b9d3945831fc7a60f2065c7a0afc747dc5653c9f
commit b9d3945831fc7a60f2065c7a0afc747dc5653c9f
Author: Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2026-02-09 19:23:26 +0000
Commit: Alexander Motin <mav@FreeBSD.org>
CommitDate: 2026-02-09 19:23:26 +0000
ahci: Restrict NVMe redirection by BAR size
Attempts to access vendor-specific registers on emulator of older
Intel hardware was reported to confuse one. Since the redirection
obviously require BAR size bigger than normal 2KB of AHCI, add
the condition, similar to what Linux is doing.
Requested by: kib
MFC after: 2 weeks
---
sys/dev/ahci/ahci_pci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c
index 2b4cb37275a6..ed1b734f70be 100644
--- a/sys/dev/ahci/ahci_pci.c
+++ b/sys/dev/ahci/ahci_pci.c
@@ -523,7 +523,8 @@ ahci_pci_attach(device_t dev)
* here, or the user has to change the mode in the BIOS
* from RST to AHCI.
*/
- if (pci_get_vendor(dev) == 0x8086) {
+ if (pci_get_vendor(dev) == 0x8086 &&
+ rman_get_size(ctlr->r_mem) >= 512 * 1024) {
uint32_t vscap;
vscap = ATA_INL(ctlr->r_mem, AHCI_VSCAP);