x86: Fix build with the get/set_reg() infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 21 Jan 2022 10:19:00 +0000 (10:19 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 21 Jan 2022 12:42:11 +0000 (12:42 +0000)
commit13caa585791234fe3e3719c8376f7ea731012451
tree8b9dfcf71c3f8b727c65eb8d321e93b302112705
parent0626219dcc6a4376c1a4b04209d6c15d06e23875
x86: Fix build with the get/set_reg() infrastructure

I clearly messed up concluding that the stubs were safe to drop.

The is_{pv,hvm}_domain() predicates are not symmetrical with both CONFIG_PV
and CONFIG_HVM.  As a result logic of the form `if ( pv/hvm ) ... else ...`
will always have one side which can't be DCE'd.

While technically only the hvm stubs are needed, due to the use of the
is_pv_domain() predicate in guest_{rd,wr}msr(), sort out the pv stubs too to
avoid leaving a bear trap for future users.

Fixes: 88d3ff7ab15d ("x86/guest: Introduce {get,set}_reg() infrastructure")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/include/asm/hvm/hvm.h
xen/arch/x86/include/asm/pv/domain.h