# HG changeset patch # User aph # Date 1562082892 -3600 # Node ID 599a7a7b6f773849c1f277e22407d2103fa545d9 # Parent 4077a625a01f9aa5e3744616e35324044db03e34 8226525: HotSpot compile-time error for x86-32 Reviewed-by: shade diff -r 4077a625a01f -r 599a7a7b6f77 src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp --- a/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp Mon Jul 01 08:24:45 2019 -0400 +++ b/src/hotspot/os_cpu/linux_x86/orderAccess_linux_x86.hpp Tue Jul 02 16:54:52 2019 +0100 @@ -57,7 +57,13 @@ inline void OrderAccess::cross_modify_fence() { int idx = 0; +#ifdef AMD64 __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory"); +#else + // On some x86 systems EBX is a reserved register that cannot be + // clobbered, so we must protect it around the CPUID. + __asm__ volatile ("xchg %%esi, %%ebx; cpuid; xchg %%esi, %%ebx " : "+a" (idx) : : "esi", "ecx", "edx", "memory"); +#endif } template<>