diff options
author | Harsh Prateek Bora <harshpb@linux.ibm.com> | 2024-03-08 16:49:30 +0530 |
---|---|---|
committer | Nicholas Piggin <npiggin@gmail.com> | 2024-03-13 02:47:04 +1000 |
commit | 21a8d22f58b7e8eb70f5cf48ba119d7865a37fc0 (patch) | |
tree | daf54335ac93a26cf815fe3d4d73ddaeb26bdcf0 /hw/ppc/spapr.c | |
parent | 1331d0acc76662bd423cb06db23cf0083da695e0 (diff) |
spapr: nested: keep nested-hv related code restricted to its API.
spapr_exit_nested and spapr_get_pate_nested_hv contains code which
is specific to nested-hv API. Isolating code flows based on API
helps extending it to be used with different API as well.
Suggested-by: Nicholas Piggin <npiggin@gmail.com>
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>
Diffstat (limited to 'hw/ppc/spapr.c')
-rw-r--r-- | hw/ppc/spapr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index ff429d0ffe..e001ffe06f 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1421,7 +1421,11 @@ static bool spapr_get_pate(PPCVirtualHypervisor *vhyp, PowerPCCPU *cpu, entry->dw1 = spapr->patb_entry; return true; } else { - return spapr_get_pate_nested_hv(spapr, cpu, lpid, entry); + assert(spapr_nested_api(spapr)); + if (spapr_nested_api(spapr) == NESTED_API_KVM_HV) { + return spapr_get_pate_nested_hv(spapr, cpu, lpid, entry); + } + return false; } } |