Skip to content

Provisioning support in IGPU #586

Closed
Closed
@vit9696

Description

@vit9696

There are many issues with the matter, and I want to try to raise some attention to the problem from potentially interested parties. I kindly ask people without technical information to ignore this issue.

Problems:

  • Initialting HDCP in the driver leads to IGPU freezes in macOS, and this happens to be done by basically any video.
  • PAVP support is broken, and Intel hardware DRM decoder (used by e.g. Netflix) is not functional.
  • PAVP is not configured to use Apple certificate causing GuC springboard fail to load on SKL+ and resulting in performance issues.

All these issues normally are solved supplemental hacks, as flashing the firmware requires some effort, and ME/HECI is quite a dark forest. Basically, for this to work the following needs to be achived:

  • HDCP/PAVP should be properly initialized by the firmware during boot and potentially during S3.
  • Management Engine firmware should be properly configured.
  • PAVP should use the right key and report «Apple firmware only on Apple HW!» for GuC Springboard to load on SKL+.
  • PAVP should be EPID-provisioned for hardware DRM decoder to work.

What we know:

  • HECI protocol is more or less covered in the official DCMI-HI spec[1], PAVP and EPID are somehow covered in Platform Embedded Security Technology Revealed[2]. There are code samples in EPID SDK[3], some Android firmwares[4], and Intel GPU documents[5]. One can find a little more by searching CMD_SEND_SAFEID_PUBKEY, PAVP_EPID_API_VERSION_MAJOR, PAVP_CMD_HEADER, pavp_lib_session on GitHub code.
  • Apparently Apple uses the same ME firmware as everyone despite our strong suspects that it is not the case. Well, this may still be not true, but we did not find any evidence. Flashing ME firmware 9.5.3.1526 from a Mac on Haswell gives no visible changes.
  • In 12.0.2.1087 ME release pavp application is not encrypted, and apparently this confirms that Apple features are delivered to everyone[6][7][8].
  • SaInitDxe (now AppleMeDriverDxe) in Apple firmware performs EPID provisioning based on epid_provision variable. In the beginning of the year we did some RE on this with @savvamitrofanov. The code works just fine on other platforms, we tested it on four machines (3 haswell, 1 ivy). At this point it can be found in OpenCore vit9696-epid-20191124 branch[9]. Interestingly it also calls some FPF application, which is potentially responsible for permanently locking the configuration, but there is very little information on the matter, it looks similar to coreboot cse code[10], but we did not check much. We also did not try to access FPF on our test machines.
  • The easiest way to test EPID is to play a trailer in QuickTime[11]. Playing a purchased movie will also invoke HDCP, and thus will freeze everything badly. This seems to be because AppleGVA.framework enables HDCP only for high resolutions. WEG will need to be patched to reenable disabled features before testing: Springboard loading[12], PAVP removal[13], forcing software DRM decoder[14].

What we do not know:

  • We basically do not know whether HDCP/PAVP is properly initialised. I would say it is not.
  • We do not know how «Apple firmware only on Apple HW!» is chosen by PAVP. Perhaps it is enough to do EPID provisioning, but we did not try.

Although we are not ready to continue the research at the moment, we believe that it might be helpful to share this information with others. Perhaps somebody wants to continue or has information to share. CC @0xFireWolf, @al3xtjames, @osy86, @platomav, @skochinsky.

[1] https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/dcmi-hi-1-0-spec.pdf
[2] https://link.springer.com/content/pdf/10.1007%2F978-1-4302-6572-6.pdf
[3] https://github.com/Intel-EPID-SDK/epid-sdk
[4] https://github.com/shreekantsingh/uefi/tree/master/drivers/misc/mei
[5] https://01.org/sites/default/files/documentation/skl_opregion_rev0p5.pdf
[6] https://twitter.com/platomaniac/status/1031990242545418242
[7] https://github.com/CHEF-KOCH/Intel-ME-Firmware-Repository/tree/master/12
[8] https://github.com/ptresearch/unME12
[9] https://github.com/acidanthera/OcSupportPkg/tree/master/Application/PavpProvision
[10] https://github.com/coreboot/coreboot/blob/master/src/soc/intel/apollolake/cse.c
[11] https://drive.google.com/file/d/12pQ5FFpdHdGOVV6jvbqEq2wmkpMKxsOF/view
[12] https://github.com/acidanthera/WhateverGreen/blob/533611b/WhateverGreen/kern_igfx.cpp#L266-L267
[13] https://github.com/acidanthera/WhateverGreen/blob/533611b/WhateverGreen/kern_igfx.cpp#L270
[14] https://github.com/acidanthera/WhateverGreen/blob/dcbb8d9/WhateverGreen/kern_shiki.cpp#L117

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions