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
From the specification of x86_64, Vol. 2A 3-191, the cpuid instruction will override register EDX in most cases. A more general solution, declaring this register in clobber list would be better. Furthermore, x86_64 specification only marks EDX as reserved when EAX is 07h, such claim may be violated in the future, to maximize the compatibility, I think declaring the register EDX in clobber list is worth considering.
The source of xv6: kernel/cpuid.c: 140: asm("cpuid" : "=a"(maxsubleaf), "=b"(sef_flags) : "a" (7), "c" (0) :);
The text was updated successfully, but these errors were encountered:
From the specification of x86_64, Vol. 2A 3-191, the cpuid instruction will override register EDX in most cases. A more general solution, declaring this register in clobber list would be better. Furthermore, x86_64 specification only marks EDX as reserved when EAX is 07h, such claim may be violated in the future, to maximize the compatibility, I think declaring the register EDX in clobber list is worth considering.
The source of xv6: kernel/cpuid.c: 140:
asm("cpuid" : "=a"(maxsubleaf), "=b"(sef_flags) : "a" (7), "c" (0) :);
The text was updated successfully, but these errors were encountered: