diff --git a/rune/libenclave/internal/runtime/pal/skeleton/sgxutils.c b/rune/libenclave/internal/runtime/pal/skeleton/sgxutils.c index 6dd352a765ffceda53a6db9155206bf67dedff00..a0d642354f45580352828e698a6dfb2e761e1745 100644 --- a/rune/libenclave/internal/runtime/pal/skeleton/sgxutils.c +++ b/rune/libenclave/internal/runtime/pal/skeleton/sgxutils.c @@ -49,44 +49,30 @@ static inline uint64_t get_xcr0() return xgetbv(0); } -static bool try_get_xcr0(uint64_t *value) +static uint64_t try_get_xcr0() { int cpu_info[4] = {0, 0, 0, 0}; - *value = SGX_XFRM_LEGACY; - - // check if xgetbv instruction is supported + // Check if xgetbv instruction is supported. __cpuid(cpu_info, 1); - // ecx[27:26] indicate whether support xsave/xrstor, and whether enable xgetbv, xsetbv - if (!(cpu_info[2] & (1<