From: Harsh Prateek Bora <harshpb@linux.ibm.com>
To: npiggin@gmail.com, qemu-ppc@nongnu.org
Cc: clegoate@redhat.com, qemu-devel@nongnu.org, mikey@neuling.org,
vaibhav@linux.ibm.com, jniethe5@gmail.com, sbhat@linux.ibm.com,
kconsul@linux.vnet.ibm.com, danielhb413@gmail.com
Subject: [PATCH v2 12/14] spapr: nested: rename nested_host_state to nested_hv_host
Date: Thu, 12 Oct 2023 16:19:49 +0530 [thread overview]
Message-ID: <20231012104951.194876-13-harshpb@linux.ibm.com> (raw)
In-Reply-To: <20231012104951.194876-1-harshpb@linux.ibm.com>
Renaming nested host state variable name to reflect the nested-hv API
being used. For nested PAPR API, similar convention shall be used in
upcoming patch which helps distinguishing them from each other.
Signed-off-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
---
hw/ppc/spapr_nested.c | 18 +++++++++---------
include/hw/ppc/spapr_cpu_core.h | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/hw/ppc/spapr_nested.c b/hw/ppc/spapr_nested.c
index 1917d8bb13..607fb7ead2 100644
--- a/hw/ppc/spapr_nested.c
+++ b/hw/ppc/spapr_nested.c
@@ -238,21 +238,21 @@ static target_ulong h_enter_nested(PowerPCCPU *cpu,
return H_PARAMETER;
}
- spapr_cpu->nested_host_state = g_try_new(struct nested_ppc_state, 1);
- if (!spapr_cpu->nested_host_state) {
+ spapr_cpu->nested_hv_host = g_try_new(struct nested_ppc_state, 1);
+ if (!spapr_cpu->nested_hv_host) {
return H_NO_MEM;
}
assert(env->spr[SPR_LPIDR] == 0);
assert(env->spr[SPR_DPDES] == 0);
- nested_save_state(spapr_cpu->nested_host_state, cpu);
+ nested_save_state(spapr_cpu->nested_hv_host, cpu);
len = sizeof(*regs);
regs = address_space_map(CPU(cpu)->as, regs_ptr, &len, false,
MEMTXATTRS_UNSPECIFIED);
if (!regs || len != sizeof(*regs)) {
address_space_unmap(CPU(cpu)->as, regs, len, 0, false);
- g_free(spapr_cpu->nested_host_state);
+ g_free(spapr_cpu->nested_hv_host);
return H_P2;
}
@@ -330,8 +330,8 @@ void spapr_exit_nested(PowerPCCPU *cpu, int excp)
CPUPPCState *env = &cpu->env;
SpaprCpuState *spapr_cpu = spapr_cpu_state(cpu);
struct nested_ppc_state l2_state;
- target_ulong hv_ptr = spapr_cpu->nested_host_state->gpr[4];
- target_ulong regs_ptr = spapr_cpu->nested_host_state->gpr[5];
+ target_ulong hv_ptr = spapr_cpu->nested_hv_host->gpr[4];
+ target_ulong regs_ptr = spapr_cpu->nested_hv_host->gpr[5];
target_ulong hsrr0, hsrr1, hdar, asdr, hdsisr;
struct kvmppc_hv_guest_state *hvstate;
struct kvmppc_pt_regs *regs;
@@ -350,15 +350,15 @@ void spapr_exit_nested(PowerPCCPU *cpu, int excp)
* Switch back to the host environment (including for any error).
*/
assert(env->spr[SPR_LPIDR] != 0);
- nested_load_state(cpu, spapr_cpu->nested_host_state);
+ nested_load_state(cpu, spapr_cpu->nested_hv_host);
env->gpr[3] = env->excp_vectors[excp]; /* hcall return value */
cpu_ppc_hdecr_exit(env);
spapr_cpu->in_nested = false;
- g_free(spapr_cpu->nested_host_state);
- spapr_cpu->nested_host_state = NULL;
+ g_free(spapr_cpu->nested_hv_host);
+ spapr_cpu->nested_hv_host = NULL;
len = sizeof(*hvstate);
hvstate = address_space_map(CPU(cpu)->as, hv_ptr, &len, true,
diff --git a/include/hw/ppc/spapr_cpu_core.h b/include/hw/ppc/spapr_cpu_core.h
index 69a52e39b8..9c8c59f173 100644
--- a/include/hw/ppc/spapr_cpu_core.h
+++ b/include/hw/ppc/spapr_cpu_core.h
@@ -53,7 +53,7 @@ typedef struct SpaprCpuState {
/* Fields for nested-HV support */
bool in_nested; /* true while the L2 is executing */
- struct nested_ppc_state *nested_host_state; /* holds the L1 state while L2 executes */
+ struct nested_ppc_state *nested_hv_host; /* holds the L1 state while L2 executes */
} SpaprCpuState;
static inline SpaprCpuState *spapr_cpu_state(PowerPCCPU *cpu)
--
2.39.3
next prev parent reply other threads:[~2023-10-12 10:51 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 10:49 [PATCH v2 00/14] Nested PAPR API (KVM on PowerVM) Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 01/14] spapr: nested: move nested part of spapr_get_pate into spapr_nested.c Harsh Prateek Bora
2023-11-29 3:47 ` Nicholas Piggin
2023-10-12 10:49 ` [PATCH v2 02/14] spapr: nested: Introduce SpaprMachineStateNested to store related info Harsh Prateek Bora
2023-11-29 3:48 ` Nicholas Piggin
2023-10-12 10:49 ` [PATCH v2 03/14] spapr: nested: Document Nested PAPR API Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 04/14] spapr: nested: Introduce cap-nested-papr for " Harsh Prateek Bora
2023-11-29 4:01 ` Nicholas Piggin
2023-11-30 6:19 ` Harsh Prateek Bora
2023-11-30 11:11 ` Nicholas Piggin
2023-12-01 5:34 ` Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 05/14] spapr: nested: register nested-hv api hcalls only for cap-nested-hv Harsh Prateek Bora
2023-11-29 4:03 ` Nicholas Piggin
2023-10-12 10:49 ` [PATCH v2 06/14] spapr: nested: Introduce H_GUEST_[GET|SET]_CAPABILITIES hcalls Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 07/14] spapr: nested: Introduce H_GUEST_[CREATE|DELETE] hcalls Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 08/14] spapr: nested: Introduce H_GUEST_CREATE_VPCU hcall Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 09/14] spapr: nested: Initialize the GSB elements lookup table Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 10/14] spapr: nested: Introduce H_GUEST_[GET|SET]_STATE hcalls Harsh Prateek Bora
2023-10-12 10:49 ` [PATCH v2 11/14] spapr: nested: Use correct source for parttbl info for nested PAPR API Harsh Prateek Bora
2023-11-29 4:15 ` Nicholas Piggin
2023-10-12 10:49 ` Harsh Prateek Bora [this message]
2023-10-12 10:49 ` [PATCH v2 13/14] spapr: nested: keep nested-hv exit code restricted to its API Harsh Prateek Bora
2023-11-29 4:16 ` Nicholas Piggin
2023-10-12 10:49 ` [PATCH v2 14/14] spapr: nested: Introduce H_GUEST_RUN_VCPU hcall Harsh Prateek Bora
2023-11-29 4:58 ` Nicholas Piggin
2023-11-13 13:15 ` [PATCH v2 00/14] Nested PAPR API (KVM on PowerVM) Nicholas Piggin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231012104951.194876-13-harshpb@linux.ibm.com \
--to=harshpb@linux.ibm.com \
--cc=clegoate@redhat.com \
--cc=danielhb413@gmail.com \
--cc=jniethe5@gmail.com \
--cc=kconsul@linux.vnet.ibm.com \
--cc=mikey@neuling.org \
--cc=npiggin@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbhat@linux.ibm.com \
--cc=vaibhav@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).