Files
geramyloveless d6486e4dc8 Phase 1B chunk 6: IP discovery parser + correct team/bundle IDs
Two related changes that unblock the entitlement application + every
post-discovery bringup stage.

(1) IP discovery binary parser ported from upstream
    drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c. Reads the packed
    binary format documented in include/discovery.h:

      binary_header  (sig 0x28211407, 6 × table_info entries)
        └─ table[0] → ip_discovery_header  (sig 'IPDS')
              └─ die_info[N] → die_header
                    └─ ip_v4 [num_ips]
                         { hw_id, instance, num_base_address,
                           major, minor, revision, base_address[] }

    For each ip_v4 with hw_id in {MP0, MP1, GC, MMHUB→GMC, HDP,
    OSSSYS, SDMA0, SDMA1, NBIF→NBIO} we copy base_address[0] into
    DeviceContext.ip via IPBaseTable.set(). PSP/SMU/GMC/etc. queries
    isResolved() before using the base — now those checks pass once
    discovery has been loaded.

    Files:
      dext/amdgpu/amdgpu_discovery.h    structs + DiscoveryParseResult
      dext/amdgpu/amdgpu_discovery.cpp  parser (~230 lines)

    Selector 13 = LoadDiscoveryBinary: client uploads binary via
    DMABuffer (page-aligned per the 16 KB rule), calls
    LoadDiscoveryBin(size). Returns (ok, num_ips_total).

    scripts/macamdgpu_ping.swift gains --load-discovery PATH that
    drives this end-to-end.

    Reference binary committed at docs/reference/gfx1151_discovery.bin
    — pulled live from the Strix Halo box at 10.10.13.8 via
    /sys/kernel/debug/dri/0000:bd:00.0/amdgpu_discovery. Useful for
    parser regression checks. The R9700 has its own discovery binary
    accessible the same way (via the qemu-vfio-apple Linux VM passing
    the card through); pulling that lives on the worklist.

(2) Team ID + bundle identifiers updated to the user's real values:

      DEVELOPMENT_TEAM     YBQ9BU6Q6F  (override with XCODE_TEAM_ID env)
      Host app bundle      com.geramyloveless.MacAMDGPUHost
      Dext bundle          com.geramyloveless.MacAMDGPUHost.MacAMDGPU

    These match the user's Apple Developer team and the prefix already
    used by their qemu-vfio-apple host app, so first build will
    round-trip the bundle IDs to the Apple Developer portal cleanly.

    project.yml + Host/MacAMDGPUHostApp.swift + scripts/build.sh all
    point at the same identifiers.

(3) Dext is now correctly **embedded** in the host app at
    Contents/Library/SystemExtensions/MacAMDGPU.dext (xcodegen
    'embed: true' with no explicit destination now picks the right
    path based on target type = driver-extension).

Build still clean: ** BUILD SUCCEEDED ** for both MacAMDGPU.dext
(126 KB) and MacAMDGPUHost.app on this M5 with Xcode 26.4.1 +
DriverKit SDK 25.4.
2026-05-13 15:25:32 -07:00
..