KVM: s390: vsie: Use virt_to_phys for crypto control block
authorNina Schoetterl-Glausch <nsg@linux.ibm.com>
Mon, 29 Apr 2024 17:15:12 +0000 (19:15 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 1 May 2024 09:48:21 +0000 (11:48 +0200)
The address of the crypto control block in the (shadow) SIE block is
absolute/physical.
Convert from virtual to physical when shadowing the guest's control
block during VSIE.

Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Link: https://lore.kernel.org/r/20240429171512.879215-1-nsg@linux.ibm.com
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/kvm/vsie.c

index d8527a046cf7595ead8f0a8d2ec69f0c705c79ff..c9ecae830634f5f73863736c1e2137a7b08728e2 100644 (file)
@@ -362,7 +362,7 @@ end:
        case -EACCES:
                return set_validity_icpt(scb_s, 0x003CU);
        }
-       scb_s->crycbd = ((__u32)(__u64) &vsie_page->crycb) | CRYCB_FORMAT2;
+       scb_s->crycbd = (u32)virt_to_phys(&vsie_page->crycb) | CRYCB_FORMAT2;
        return 0;
 }