Intel TigerLake NVMe vmd: Adding Support & Debugging a Patch

From: Neel Chauhan <neel_at_neelc.org>
Date: Tue, 29 Dec 2020 18:30:23 -0800
Hi freebsd-hackers_at_, CC'd freebsd-current_at_,

I hope you all had a wonderful holiday season.

I recently got a HP Spectre x360 13t-aw200 which is an Intel 
TigerLake-based laptop. It has the Intel "Evo" branding and an "Optane" 
SSD which I disabled (so I can get a "second" SSD).

On the Spectre, the NVMe is not detected: https://imgur.com/a/ighTwHQ

I don't know if it is HP or Intel, but the VMD IDs device id is 
8086:9a0b. I'm guessing Intel since Dell laptops (XPS, Vostro) also have 
this device ID [1].

Sadly, NVMe RAID is forced on this laptop.

I wrote a rough patch to add the device IDs, and the patch is below:

--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
_at__at_ -66,13 +66,20 _at__at_ struct vmd_type {
  #define INTEL_VENDOR_ID                0x8086
  #define INTEL_DEVICE_ID_VMD    0x201d
  #define INTEL_DEVICE_ID_VMD2   0x28c0
+#define INTEL_DEVICE_ID_VMD3   0x9a0b

  static struct vmd_type vmd_devs[] = {
          { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD,  "Intel Volume 
Management Device" },
          { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD2, "Intel Volume 
Management Device" },
+        { INTEL_VENDOR_ID, INTEL_DEVICE_ID_VMD3, "Intel Volume 
Management Device" },
          { 0, 0, NULL }

However, I get a panic whenever I use this patch: 
https://imgur.com/a/XUQksOi

Without this patch, I am able to boot fine but can't see the SSD or any 
nvd* devices beyond a "none" device in `pciconf -lv`.

For those who know about PCI/ACPI subsystems, can you please tell me 
what's going wrong?

I'm still debugging in the meanwhile, but am no expert on PCI/ACPI 
subsystems. I may know more than most PC builders or CS grads, but not 
really enough to do it full-time.

The Spectre's SSD works fine with Windows 10 (obviously) and Linux 
(Fedora and Debian tested).

Best,

Neel Chauhan

Sources:

[1]: Linux probes:
  * Vostro: https://certification.ubuntu.com/hardware/202007-28047
  * XPS: https://linux-hardware.org/?probe=ba53f6e513
Received on Wed Dec 30 2020 - 01:30:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:26 UTC