x86/cpuid: Remove BUG_ON() condition from guest_cpuid()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Jan 2017 11:44:29 +0000 (11:44 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 20 Jan 2017 16:12:10 +0000 (16:12 +0000)
commit2073a26f8920ac9c26323122308873d0bcc84be1
tree56f0c6fc69bdac1849c667283ff512b61ce12638
parent6949ce5c325b21e6639fcdeb5685f24962f3d9b5
x86/cpuid: Remove BUG_ON() condition from guest_cpuid()

Include a min() against the appropriate ARRAY_SIZE(), and ASSERT() that
max_subleaf is within ARRAY_SIZE().

This is more robust to unexpected problems in a release build of Xen.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Doug Goldstein <cardoe@cardoe.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpuid.c