SGX is basically a HSM shoved into the corner of a CPU that shares some of the CPUs resources.
The spectre/meltdown style memory controller issues mostly apply to SGX as well.
In short the security model is an attacker in control of the physical CPU and the host operating system, within that model SGX is not secure against sophisticated attackers (especially the kind that might have Intel's full assistance including key material).