tools/xen-detect: avoid possible pitfall with cpuid()
authorJan Beulich <jbeulich@suse.com>
Thu, 6 Jan 2022 15:12:15 +0000 (16:12 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 6 Jan 2022 15:12:15 +0000 (16:12 +0100)
commit6330e328ba157ed5df417f463ba8621fee731e63
treedd45ae03fc7e02ca57d4304637dadf13b14c586f
parent31f3bc97f4508687215e459a5e35676eecf1772b
tools/xen-detect: avoid possible pitfall with cpuid()

The 64-bit form forces %ecx to 0 while the 32-bit one so far didn't - it
only ended up that way when "pv_context" is zero. While presently no
leaf queried by callers has separate subleaves, let's avoid chancing it.

While there
- replace references to operands by number,
- relax constraints where possible,
- limit PUSH/POP to just the registers not also used as input,
all where applicable also for the 64-bit variant.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
tools/misc/xen-detect.c