# acpidump never completes



## tralafiti (Jan 17, 2021)

I tried activating pci passthru on a bhyve arch-linux vm. Sadly as soon as I try to attach a pci device I can't start the vm anymore. 

`ps` shows it seems to be stuck at `acpidump -t` which seems strange to me:

```
# ps aud
USER       PID  %CPU %MEM     VSZ     RSS TT  STAT STARTED    TIME COMMAND
...
root      1537   0.0  0.0   13092    3980  1  Is+  18:27   0:00.07 /bin/sh /usr/local/sbin/vm _run -tf test
root      1673   0.0  0.0   13092    3976  1  I+   18:27   0:00.00 - /bin/sh /usr/local/sbin/vm _run -tf test
root      1674 100.0  6.6 3943000 2205956  1  R+   18:27   2:58.90 |-- acpidump -t
root      1675   0.0  0.0   11540    2752  1  I+   18:27   0:00.00 `-- grep DMAR
```
Indeed, when I run `acpidump -t` it never returns:

```
# acpidump -t
/*
  RSD PTR: OEM=SUPERM, ACPI_Rev=2.0x (2)
        XSDT=0x000000007e1950a0, length=36, cksum=85
 */
/*
  XSDT: Length=188, Revision=1, Checksum=66,
        OEMID=SUPERM, OEM Table ID=SMCI--MB, OEM Revision=0x1072009,
        Creator ID=AMI, Creator Revision=0x10013
        Entries={ 0x000000007e1999e8, 0x000000007e199b00, 0x000000007e199b48, 0x000000007e199be8, 0x000000007e199c30, 0x000000007e199c70, 0x000000007e199e20, 0x000000007e199e98, 0x000000007e199ec8, 0x000000007e199f00, 0x000000007e199f48, 0x000000007e19b850, 0x000000007e19bac8, 0x000000007e19c2a8, 0x000000007e19c318, 0x000000007e19c3c0, 0x000000007e19c3f0, 0x000000007e19c620, 0x000000007e19c770 }
 */
/*
  FACP: Length=276, Revision=6, Checksum=60,
        OEMID=SUPERM, OEM Table ID=SMCI--MB, OEM Revision=0x1072009,
        Creator ID=AMI, Creator Revision=0x10013
        FACS=0x7e1dd080, DSDT=0x0
        INT_MODEL=APIC
        Preferred_PM_Profile=Enterprise Server (4)
        SCI_INT=9
        SMI_CMD=0xb2, ACPI_ENABLE=0xa0, ACPI_DISABLE=0xa1, S4BIOS_REQ=0x0
        PSTATE_CNT=0x0
        PM1a_EVT_BLK=0x0-0x3
        PM1a_CNT_BLK=0x0-0x1
        PM_TMR_BLK=0x0-0x3
        P_LVL2_LAT=101 us, P_LVL3_LAT=1001 us
        FLUSH_SIZE=1024, FLUSH_STRIDE=16
        DUTY_OFFSET=1, DUTY_WIDTH=3
        DAY_ALRM=13, MON_ALRM=0, CENTURY=50
        IAPC_BOOT_ARCH={LEGACY_DEVICES}
        Flags={WBINVD,C1_SUPPORTED,SLEEP_BUTTON,S4_RTC_WAKE,RESET_REGISTER,PLATFORM_CLOCK,REMOTE_POWER_ON}
        RESET_REG=0xcf9:0[8] (IO), RESET_VALUE=0xe
 */
/*
  FACS: Length=64, HwSig=0x00000051, Firm_Wake_Vec=0x00000000
        Global_Lock=
        Flags=
        Version=2
 */
...blinking cursor here...
^C
```

I tried booting archlinux live system to see if it can perform a acpidump, which worked:

```
root@archiso ~ # acpidump -s
ACPI: MCFG 0x0000000000000000 00003C (v01 SUPERM SMCI--MB 01072009 MSFT 00000097)
ACPI: EINJ 0x0000000000000000 000150 (v01 INTEL  VND      00000001 INTL 00000001)
ACPI: APIC 0x0000000000000000 000078 (v04 INTEL  TIANO    00000001 MSFT 00000000)
ACPI: SSDT 0x0000000000000000 000277 (v02 PmRef  Cpu0Tst  00003000 INTL 20061109)
ACPI: SPMI 0x0000000000000000 000041 (v05 SUPERM SMCI--MB 00000000 AMI. 00000000)
ACPI: UEFI 0x0000000000000000 000042 (v01 SUPERM SMCI--MB 00000002      01000013)
ACPI: ERST 0x0000000000000000 000230 (v01 INTEL  VND      00000001 INTL 00000001)
ACPI: DSDT 0x0000000000000000 0047F2 (v02 SUPERM SMCI--MB 01072009 INTL 20061109)
ACPI: WSMT 0x0000000000000000 000028 (v01 u?              01072009 AMI  00010013)
ACPI: WDAT 0x0000000000000000 0001AC (v01 SUPERM SMCI--MB 01072009 MSFT 00010013)
ACPI: HEST 0x0000000000000000 0000A8 (v01 INTEL  VND      00000001 INTL 00000001)
ACPI: BERT 0x0000000000000000 000030 (v01 INTEL  VND      00000001 INTL 00000001)
ACPI: SSDT 0x0000000000000000 0007DF (v02 PmRef  ApTst    00003000 INTL 20061109)
ACPI: DMAR 0x0000000000000000 000070 (v01 INTEL  BDW      00000001 INTL 00000001)
ACPI: FACP 0x0000000000000000 000114 (v06 SUPERM SMCI--MB 01072009 AMI  00010013)
ACPI: FPDT 0x0000000000000000 000044 (v01 SUPERM SMCI--MB 01072009 AMI  00010013)
ACPI: SSDT 0x0000000000000000 001901 (v02 PmRef  CpuPm    00003000 INTL 20061109)
ACPI: HPET 0x0000000000000000 000038 (v01 SUPERM SMCI--MB 00000001 MSFT 01000013)
ACPI: BDAT 0x0000000000000000 000030 (v01                 00000000      00000000)
ACPI: FIDT 0x0000000000000000 00009C (v01 SUPERM SMCI--MB 01072009 AMI  00010013)
ACPI: FACS 0x0000000000000000 000040
ACPI: SSDT 0x0000000000000000 00007A (v02 PmRef  Cpu0Cst  00003001 INTL 20061109)
ACPI: SSDT 0x0000000000000000 000231 (v02 PmRef  ApCst    00003000 INTL 20061109)
ACPI: SSDT 0x0000000000000000 0004B3 (v02 PmRef  Cpu0Ist  00003000 INTL 20061109)
ACPI: SSDT 0x0000000000000000 00063B (v02 PmRef  ApIst    00003000 INTL 20061109)
```

12.2-RELEASE-p2 running on an Supermicro A2SDi-4C-HLN4F latest BIOS. 

Sadly I have no idea how to continue to debug this so any help would be welcome  Thank you


----------



## jmos (Jan 17, 2021)

Not using a wrapper resp. using bhyve directly should give you more informations. How to set up bhyve is explained in the handbook, and how the PCI passthrough is to be done here:



			bhyve/pci_passthru - FreeBSD Wiki


----------



## SirDice (Jan 18, 2021)

Did you _exclude_ the device on the host by setting `pptdevs` in /boot/loader.conf?


----------



## tralafiti (Jan 18, 2021)

It was setup as described in the wiki, my PCI device is available according to:

```
# vm passthru
DEVICE     BHYVE ID     READY        DESCRIPTION
...
ppt0       0/21/0       Yes          Atom Processor C3000 Series USB 3.0 xHCI Controller
...
```
 and was hidden to the host.

I peeked into vm-tools and it's possible to disable the hardware check with `vm_disable_host_checks="YES"`. With this flag set the bhyve vm is starting with pci passthru working!

So it's not bhyve related at all, it only manifests via bhyve's vm-tools because the script tries to check the hardware features via *acpidump* which seems broken somehow?

_edit: updated title_


----------

