Hacker News new | ask | show | jobs
by Ristovski 990 days ago
One of the major downsides of the Hexagon DSP is that its near impossible to actually run anything on it unless you somehow get your hands on an unprovisioned/unlocked SoC.

The HLOS (High-level OS) running on the Hexagon requires every "applet" to be signed by either the Qualcomm root cert or the OEMs cert. Usually, every phone has a set of generic Hexagon applets (or "skeleton libs") that are provided and signed by the OEM, which seem to be freely usable to offload some computational work to the DSP (mainly FastCV et al - https://developer.qualcomm.com/sites/default/files/docs/qual...). Those of course come with their own bugs: https://research.checkpoint.com/2021/pwn2own-qualcomm-dsp/

On some older SoCs, you were able to use a TOCTOU (Time of check to time of use) exploit to bypass the signature check by patching the applet loader shim in-memory, once it itself got authenticated: https://github.com/geohot/freethedsp/ (I have personally ported this to the msm8953, and it seems to work)

3 comments

I am not surprised. When I worked at Qualcomm my main gripe was how closed and secretive they were about everything. The tech underneath was pretty cool, although nothing spectacular in my opinion. I don't think I ever saw anything that deserved all that secrecy, at least in the GPU.

When I switched to NVidia I was surprised to find a much more open ecosystem with good public documentation. NVidia did have some tasty secret sauce stuff that they didn't expose outright, but they did what they could to empower developers to make the best use of the underlying hardware. They strike the right balance between openness and maintaining a competitive advantage, in my view.

Just my opinion based on working in both companies for a number of years. Thankfully I no longer have a dog in that fight.

I am an ex QCOMer and agree with everything here. We always said it was a legal firm with a tech problem. That stranglehold on IP really holds the company back, IMO. Sure the licensing model made $$$ but they lose a lot of good will in the tech community.
Hello,

> The HLOS (High-level OS) running on the Hexagon requires every "applet" to be signed by either the Qualcomm root cert or the OEMs cert

That's no longer true since quite some years now :) See the Unsigned PDs, which are allowed for general purpose compute since at least sm8150 (Snapdragon 855).

Note that the articles you mention says this about it:

> Signature-free dynamic shared objects are run inside an Unsigned PD, which is the user PD limited in its access to underlying DSP drivers and thread priorities. An Unsigned PD is designed to support only general computing applications.

I spent way too much time trying to make use of it with Halide and was not successful. Are you saying that this is now possible? I am the developer an app which would greatly benefit from it.
Yes. Note however that the Pixel line shipped with Hexagon access restricted for non-platform Android apps however. But on other devices, things should just work.
This whole approach makes little sense for a developer (not to mention a user). When a consumer buys a phone at particular price point, they expect it to offer some level of performance. Now if devs can offload to these accelerators on a tiny subset of devices in the market, it will by definition lead to a fragmented user experience (and a ton more dev work). Why bother?

I am becoming convinced that CPU (and maybe GPU) is the only viable accelerator on Android devices. All these fancy accelerators are just for phone makers to do their own thing (mainly camera crap). Might as well make it part of the ISP.

Also, I fear Apple is going to eat Android's lunch at this rate :(

The new Brew MP?
You just gave me PTSD flashbacks. Man I am getting old.
I find this one funny. When I was working at qcom, was surprising to see that BREW was still not gone from the monorepo in the 2020s. (but no longer used by anybody of course)