Does Intel SGX provide software memory protection in simulation mode? - intel

I have some 4th generation Intel CPU and I want to run some Intel SGX application. I use release simulation mode.
Here you can see that SGX simulation doesn't provide HARDWARE protection! However, I would like to know if Intel SGX provides some kind of SOFTWARE protection in release simulation mode?

No, the goal of simulation mode is to develop enclave on non-supporting platforms and to enable debug of enclaves.
In simulation mode, the enclave is running as a standard process in regular memory and can be debugged and accessed like any other process in the system.

Related

How to get the Quote from an Intel SGX Enclave

Recently I am developing a trusted computing project with the help of an Intel SGX Enclave.
To verify an Enclave i need the Quote generated by the Quoting-Enclave.
I know how it works theoretically and how to start an Enclave.
But I am not able to find any code examples or detailed explanation on how to recieve the quote for an Enclave and sending it to the calling programm.
Can someone please explain that to me through an example?
Thanks!
Well, what you are trying to do is called Attestation.
Attestation is a process to verify:
whether an enclave is running the expected bynaries (signed library), and,
whether it is running in a real SGX enabled processor.
Attestation usually is required prior to providing secrets to an enclave. This process is called Provisioning.
There are two kinds of Attestation:
Local Attestation: two enclaves, running on the same Platform (PC) want to "verify" each other.
Remote Attestation: a Service Provicer needs to verify an enclave remotely.
You mention Quote Enclave (QE) so I suppose you are using Remote attestation.
If you are searching for examples, please refer to the example projects comming with the Intel SGX SDK, or the ones available at the Intel SGX site.

Intel OpenCL: Tools for looking timeline of concurrent kernel execution

In case of CUDA, NSIGHT would give us detail time lines of each kernel.
Is there similar tool for Intel Opencl? Basically I want to see if my three kernels are running in concurrently or not.

can we read and program the microcodes of AMD processor?

we can know that microcodes in Intel processors is encrypted (as issued in "Intel® 64 and IA-32 Architectures Software Developer’s Manual"). One cannot programm the Intel microcodes as he wants.
So, does anyone know how about the AMD microcodes? Are the microcodes of AMD CPU encrypted ?
Anyone knows how to program microcodes? It's doesn't limit on AMD or Intel CPUs.
Thank you in advance!
(ps: Not the microcodes in GPU, but in CPU).
This article provides information on the microcode of AMD's Opteron (K8) family. It claims that it is not encrypted and provides information on the microcode format and updating the microcode.
Anyone knows how to program microcodes? It's doesn't limit on AMD or Intel CPUs.
Not too many people do that kind of work. It's often written with a C compiler tweaked to generate the necessary microcode.
To answer your question in regard "is there other processors accepting microcode?" FPGA's are only programmed using such. These are not CPUs, what you program in them "is written at the hardware level". The microcode changes the doors and the result is your program. It can become very tedious as everything runs in parallel (true hardware parallelism).
AMD microcode for recent processors is, indeed, encrypted and authenticated, much like Intel's. You need to have the proper crypto key to sign a microcode update the processor will accept.
Intel does it by embedding in the processor mask (hardware read-only) microcode a hash of the valid key(s?): the key itself is too large to bother embedding in the processor, so it will be present in the update data itself as seen here. Also, the Intel microcode update is actually an unified processor-package update data, it updates more than just the microcode for the decode unit. It can update all sort of internal processor parameters, as well as control sequences for other units than the decoder... it also has both opcode (and likely microcode) that the processor runs before(?)/after applying the update.

HyperQ support in OpenCL

I want to run heterogeneous kernels that execute on a single GPU asynchronously. I think this is possible in Nvidia Kepler K20(Or any device having compute capability 3.5+) by launching each of this kernels to a different stream and the runtime system maps them to different hardware queues based on the resource availability.
Is this feature accessible in OpenCL?
If it is so, what is the equivalent of a CUDA 'Stream' in OpenCL?
Do Nvidia drivers support such an execution on their K20 cards through OpenCL?
Is their any AMD GPU that has similar feature(or is there anything on development)?
Answer for any of these questions will help me a lot.
In principle, you can use OpenCL command queues to achieve CKE (Concurrent Kernel Execution). You can launch them from different CPU threads. Here are few links that might help you get started:
How do I know if the kernels are executing concurrently?
http://devgurus.amd.com/thread/142485
I am not sure how would it work with NVIDIA Kepler GPUs as we are having strange issues using OpenCL on K20 GPU.

Can a GPU be the host of a OpenCL program?

Little disclaimer: This is more the kind of theoretical / academic question than an actual problem I've got.
The usual way of setting up a parallel program in OpenCL is to write a C/C++ program, which sets up the devices (GPU and/or other CPUs), kernel and data buffers for executing the kernel on the device.
This program gets launched from the host, which used to be a CPU.
Would it be possible to write a OpenCL program where the host is a GPU and the devices other GPUs and/or CPUs?
What would be the prerequisites for such a scenario?
Do one need a special GPU or would it be possible to use any OpenCL-capable GPU?
Are you looking for a complete host or just a kernel launcher?
Up coming CUDA (v 5.0) introduces a feature to launch a kernel inside a kernel. Therefore, a device can be used for launching a kernel on itself. May be this feature will be supported by OpenCL too in near future.

Resources