]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
KVM: PPC: Book3S HV nestedv2: Keep nested guest HASHKEYR in sync
authorShivaprasad G Bhat <sbhat@linux.ibm.com>
Wed, 5 Jun 2024 13:07:27 +0000 (13:07 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 6 Jun 2024 12:39:04 +0000 (22:39 +1000)
The nestedv2 APIs has the guest state element defined for HASHKEYR for
the save-restore with L0. However, its ignored in the code.

The patch takes care of this for the HASHKEYR GSID.

Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/171759284380.1480.15665015792935543933.stgit@linux.ibm.com
arch/powerpc/kvm/book3s_hv_nestedv2.c

index 3879cae7d142f45dd634e957f5ed7c09ef524555..606e4fbc36d93ff58a5405a0a5f610c9327a6b67 100644 (file)
@@ -196,6 +196,9 @@ static int gs_msg_ops_vcpu_fill_info(struct kvmppc_gs_buff *gsb,
                case KVMPPC_GSID_DEXCR:
                        rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr);
                        break;
+               case KVMPPC_GSID_HASHKEYR:
+                       rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr);
+                       break;
                case KVMPPC_GSID_CIABR:
                        rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr);
                        break;
@@ -451,6 +454,9 @@ static int gs_msg_ops_vcpu_refresh_info(struct kvmppc_gs_msg *gsm,
                case KVMPPC_GSID_DEXCR:
                        vcpu->arch.dexcr = kvmppc_gse_get_u64(gse);
                        break;
+               case KVMPPC_GSID_HASHKEYR:
+                       vcpu->arch.hashkeyr = kvmppc_gse_get_u64(gse);
+                       break;
                case KVMPPC_GSID_CIABR:
                        vcpu->arch.ciabr = kvmppc_gse_get_u64(gse);
                        break;