You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now this create unconditionally fails if the target_env is SGX. However, RDRAND was introduced in Ivy Bridge and RDSEED was introduced in Brodwell, while SGX wasn't introduced until Skylake.
@nagisa@akash-fortanix@jethrogb was there a reason why we assume RDRAND/RDSEED is not supported on SGX chips? I understand not trusting CPUID, but there isn't a chip out there that has SGX but doesn't have RDRAND.
The text was updated successfully, but these errors were encountered:
While there is no extant hardware that has SGX but not RDRAND, this might not always be the case. Intel might design a new way for enclaves to get randomness securely in the future. This means you can't just assume RDRAND is available just by virtue of being compiled for SGX.
The is_x86_feature_detected implementation here is designed to mimic what the std macro does. The CPUID instruction generates #UD inside SGX, so if you're cross-compiling for SGX and don't have std, you can't make any assumptions about how you might detect RDRAND support. The conservative option must be chosen which is to assume it's not supported. To force RDRAND support, you should compile with -C target-feature=+rdrnd or set this in your target specification.
NB. For the x86_64-fortanix-unknown-sgx target, improvements to is_x86_feature_detected are being planned.
Right now this create unconditionally fails if the
target_env
is SGX. However, RDRAND was introduced in Ivy Bridge and RDSEED was introduced in Brodwell, while SGX wasn't introduced until Skylake.@nagisa @akash-fortanix @jethrogb was there a reason why we assume RDRAND/RDSEED is not supported on SGX chips? I understand not trusting CPUID, but there isn't a chip out there that has SGX but doesn't have RDRAND.
The text was updated successfully, but these errors were encountered: