Commit 6167375b authored by David Hildenbrand's avatar David Hildenbrand Committed by Christian Borntraeger

KVM: s390: gaccess: store guest address on ALC prot exceptions

Let's pass the effective guest address to get_vcpu_asce(), so we
can properly set the guest address in case we inject an ALC protection
exception.
Signed-off-by: default avatarDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 22be5a13
...@@ -477,7 +477,7 @@ enum { ...@@ -477,7 +477,7 @@ enum {
}; };
static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce, static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce,
ar_t ar, enum gacc_mode mode) unsigned long ga, ar_t ar, enum gacc_mode mode)
{ {
int rc; int rc;
struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw); struct psw_bits psw = psw_bits(vcpu->arch.sie_block->gpsw);
...@@ -519,6 +519,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce, ...@@ -519,6 +519,7 @@ static int get_vcpu_asce(struct kvm_vcpu *vcpu, union asce *asce,
vcpu->arch.pgm.exc_access_id = ar; vcpu->arch.pgm.exc_access_id = ar;
break; break;
case PGM_PROTECTION: case PGM_PROTECTION:
tec_bits->addr = ga >> PAGE_SHIFT;
tec_bits->b60 = 1; tec_bits->b60 = 1;
tec_bits->b61 = 1; tec_bits->b61 = 1;
break; break;
...@@ -783,7 +784,8 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, ar_t ar, void *data, ...@@ -783,7 +784,8 @@ int access_guest(struct kvm_vcpu *vcpu, unsigned long ga, ar_t ar, void *data,
if (!len) if (!len)
return 0; return 0;
rc = get_vcpu_asce(vcpu, &asce, ar, mode); ga = kvm_s390_logical_to_effective(vcpu, ga);
rc = get_vcpu_asce(vcpu, &asce, ga, ar, mode);
if (rc) if (rc)
return rc; return rc;
nr_pages = (((ga & ~PAGE_MASK) + len - 1) >> PAGE_SHIFT) + 1; nr_pages = (((ga & ~PAGE_MASK) + len - 1) >> PAGE_SHIFT) + 1;
...@@ -854,7 +856,7 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, ar_t ar, ...@@ -854,7 +856,7 @@ int guest_translate_address(struct kvm_vcpu *vcpu, unsigned long gva, ar_t ar,
gva = kvm_s390_logical_to_effective(vcpu, gva); gva = kvm_s390_logical_to_effective(vcpu, gva);
tec = (struct trans_exc_code_bits *)&pgm->trans_exc_code; tec = (struct trans_exc_code_bits *)&pgm->trans_exc_code;
rc = get_vcpu_asce(vcpu, &asce, ar, mode); rc = get_vcpu_asce(vcpu, &asce, gva, ar, mode);
tec->addr = gva >> PAGE_SHIFT; tec->addr = gva >> PAGE_SHIFT;
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment