x86: harden use of calc_ler_msr()
authorJan Beulich <jbeulich@suse.com>
Wed, 1 Jun 2022 07:19:25 +0000 (09:19 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 1 Jun 2022 07:19:25 +0000 (09:19 +0200)
commit58ce5b6c33ecae76f2e9fc5213a56e98c3be4be5
tree3e0cd43d7c6b1b1c312d1d1bcafd53335af71894
parent7fbebfa5406dadd82ba2e650282715dacf771133
x86: harden use of calc_ler_msr()

Avoid calling the function more than once, thus making sure we won't,
under any unusual circumstances, attempt to enable XEN_LER late (which
can't work, for setup_force_cpu_cap() being __init. In turn this then
allows making the function itself __init, too.

While fiddling with section attributes in this area, also move the two
involved variables to .data.ro_after_init.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/traps.c