summaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorEric Farman <farman@linux.ibm.com>2024-02-20 22:12:10 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-02-22 16:06:56 +0100
commit01be7f53dfc29e0a362f3d05e5ab2c8dfcc171c8 (patch)
tree50621901f71ea37531847dee2c7c4418381f7679 /arch/s390/include/asm/kvm_host.h
parent4a5993287467d2d0401503256dc9d2690c7f2020 (diff)
downloadlinux-stable-01be7f53dfc29e0a362f3d05e5ab2c8dfcc171c8.tar.gz
linux-stable-01be7f53dfc29e0a362f3d05e5ab2c8dfcc171c8.tar.bz2
linux-stable-01be7f53dfc29e0a362f3d05e5ab2c8dfcc171c8.zip
KVM: s390: fix access register usage in ioctls
The routine ar_translation() can be reached by both the instruction intercept path (where the access registers had been loaded with the guest register contents), and the MEM_OP ioctls (which hadn't). Since this routine saves the current registers to vcpu->run, this routine erroneously saves host registers into the guest space. Introduce a boolean in the kvm_vcpu_arch struct to indicate whether the registers contain guest contents. If they do (the instruction intercept path), the save can be performed and the AR translation is done just as it is today. If they don't (the MEM_OP path), the AR can be read from vcpu->run without stashing the current contents. Reviewed-by: Heiko Carstens <hca@linux.ibm.com> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com> Signed-off-by: Eric Farman <farman@linux.ibm.com> Link: https://lore.kernel.org/r/20240220211211.3102609-2-farman@linux.ibm.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/kvm_host.h')
-rw-r--r--arch/s390/include/asm/kvm_host.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 56c2efb41cf2..95990461888f 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -764,6 +764,8 @@ struct kvm_vcpu_arch {
__u64 cputm_start;
bool gs_enabled;
bool skey_enabled;
+ /* Indicator if the access registers have been loaded from guest */
+ bool acrs_loaded;
struct kvm_s390_pv_vcpu pv;
union diag318_info diag318_info;
};