KVM: PPC: Book3S HV nestedv2: Do not call H_COPY_TOFROM_GUEST
authorJordan Niethe <jniethe5@gmail.com>
Fri, 1 Dec 2023 13:26:14 +0000 (18:56 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Dec 2023 12:33:08 +0000 (23:33 +1100)
H_COPY_TOFROM_GUEST is part of the nestedv1 API and so should not be
called by a nestedv2 host. Do not attempt to call it.

Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231201132618.555031-10-vaibhav@linux.ibm.com
arch/powerpc/kvm/book3s_64_mmu_radix.c

index 916af6c153a5b0babc9c9acf726828c5609d7c63..4a1abb9f7c05818fda0c2504a4263e7794311935 100644 (file)
@@ -40,6 +40,9 @@ unsigned long __kvmhv_copy_tofrom_guest_radix(int lpid, int pid,
        unsigned long quadrant, ret = n;
        bool is_load = !!to;
 
+       if (kvmhv_is_nestedv2())
+               return H_UNSUPPORTED;
+
        /* Can't access quadrants 1 or 2 in non-HV mode, call the HV to do it */
        if (kvmhv_on_pseries())
                return plpar_hcall_norets(H_COPY_TOFROM_GUEST, lpid, pid, eaddr,