x86/xsaves: get_xsave_addr, check xsave header and support uncompressed format
authorHuaitong Han <huaitong.han@intel.com>
Mon, 21 Dec 2015 12:37:17 +0000 (13:37 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 21 Dec 2015 12:37:17 +0000 (13:37 +0100)
commit2a4b84706e5e67be4e3e3a023d4a0a7169b19b45
treec20767edf8a531972dd94d81e74d4ac35d1fea82
parent8eb2235599925b508bcbeb3402aba21fa2c266fd
x86/xsaves: get_xsave_addr, check xsave header and support uncompressed format

The check needs to be against the xsave header in the area, rather than Xen's
maximum xfeature_mask. A guest might easily have a smaller xcr0 than the
maximum Xen is willing to allow, causing the pointer below to be bogus.

The get_xsave_addr() is modified to support uncompressed xstate areas.

Signed-off-by: Huaitong Han <huaitong.han@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/xstate.c