spapr: nested: register nested-hv api hcalls only for cap-nested-hv
authorHarsh Prateek Bora <harshpb@linux.ibm.com>
Fri, 8 Mar 2024 11:19:27 +0000 (16:49 +0530)
committerNicholas Piggin <npiggin@gmail.com>
Tue, 12 Mar 2024 16:47:04 +0000 (02:47 +1000)
commit6026fdbdbdf5f30edc906de0ae287e95c1b6892b
treebf4adc3ecec3232ae26ffa838ae8add836ae9f33
parent868cb6bac51376a38b18f432a047242fed840998
spapr: nested: register nested-hv api hcalls only for cap-nested-hv

Since cap-nested-hv is an optional capability, it makes sense to register
api specfic hcalls only when respective capability is enabled. This
requires to introduce a new API to unregister hypercalls to maintain
sanity across guest reboot since caps are re-applied across reboots and
re-registeration of hypercalls would hit assert otherwise.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
hw/ppc/spapr.c
hw/ppc/spapr_hcall.c
hw/ppc/spapr_nested.c
include/hw/ppc/spapr.h
include/hw/ppc/spapr_nested.h