git: aabd5243fb97 - stable/14 - ahci: Restrict NVMe redirection by BAR size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Feb 2026 21:45:02 UTC
The branch stable/14 has been updated by mav:
URL: https://cgit.FreeBSD.org/src/commit/?id=aabd5243fb97979d33a7eece4f7cca18ffd82a95
commit aabd5243fb97979d33a7eece4f7cca18ffd82a95
Author: Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2026-02-09 19:23:26 +0000
Commit: Alexander Motin <mav@FreeBSD.org>
CommitDate: 2026-02-24 21:43:36 +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
(cherry picked from commit b9d3945831fc7a60f2065c7a0afc747dc5653c9f)
---
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 3de1f6a79ef5..d708951efb05 100644
--- a/sys/dev/ahci/ahci_pci.c
+++ b/sys/dev/ahci/ahci_pci.c
@@ -520,7 +520,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);