Re: [PATCH] selftests/sgx: Fix corrupted cpuid macro invocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/4/21 4:32 PM, Reinette Chatre wrote:
> I am not sure what the right way is to fix it though - my original
> intention, what the code uses, was to add a snippet as below as is the
> custom for all tests needing to run cpuid. There are many usages of
> cpuid among the selftests but none rely on the cpuid.h to bring in
> __cpuid_count. I do not know the motivation for this but preferred to
> stick with the custom for my implementation.
> 
> +static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
> +               unsigned int *ecx, unsigned int *edx)
> +{
> +    asm volatile("cpuid"
> +        : "=a" (*eax),
> +          "=b" (*ebx),
> +          "=c" (*ecx),
> +          "=d" (*edx)
> +        : "0" (*eax), "2" (*ecx)
> +        : "memory");
> +}

Reinette, is there some reason using __cpuid_count() won't work for the
SGX test?  Or is your concern that it _might_ break something because
you haven't tested it?



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux