x86/xsave: add fastpath for common xstate_ctxt_size() requests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 5 Jun 2014 15:52:11 +0000 (17:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Jun 2014 15:52:11 +0000 (17:52 +0200)
commitae3e6f8e2d98f4cc6b64dacfd6081cf831d75fa2
tree3cfc1690ba37e9cce1d274472c7a221ef8d13b5c
parent1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
x86/xsave: add fastpath for common xstate_ctxt_size() requests

xstate_ctxt_size(xfeature_mask) is runtime constant after boot, and for bounds
checking when handling xsave state.  Avoid reloading xcr0 twice to obtain a
number which has already been calculated.

Also annotate xfeature_mask as __read_mostly as it is only ever written once.

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