x86/cpuid: Tighten parsing of tsc_freq=FREQ
commit45009a3087b4acd8b1c91fcd0b1ee723ac3b0aec
authorMarkus Armbruster <armbru@redhat.com>
Tue, 22 Nov 2011 08:46:04 +0000 (22 09:46 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 28 Nov 2011 22:20:52 +0000 (28 16:20 -0600)
tree099d7eb5b00d02ea24d403d6c3ccb5327a2e82ce
parent961b42b9dc858936f32effc3f47c76b1c4e7de56
x86/cpuid: Tighten parsing of tsc_freq=FREQ

cpu_x86_find_by_name() uses strtosz_suffix_unit(), but screws up the
error checking.  It detects some failures, but not all.  Undetected
failures result in a zero tsc_khz value (error value -1 divided by
1000), which means "no tsc_freq set".

To reproduce, try "-cpu qemu64,tsc_freq=9999999T".
strtosz_suffix_unit() fails, because the value overflows int64_t,

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-i386/cpuid.c