mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 15:27:29 +00:00
KVM: s390: Fixes for PFMF
Add a check for low-address protection to the PFMF handler and convert real-addresses to absolute if necessary, as it is defined in the Principles of Operations specification. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
parent
f8232c8cf7
commit
fb34c60365
1 changed files with 13 additions and 3 deletions
|
@ -650,6 +650,11 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
|
||||||
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
|
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
|
||||||
|
|
||||||
start = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK;
|
start = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK;
|
||||||
|
if (vcpu->run->s.regs.gprs[reg1] & PFMF_CF) {
|
||||||
|
if (kvm_s390_check_low_addr_protection(vcpu, start))
|
||||||
|
return kvm_s390_inject_prog_irq(vcpu, &vcpu->arch.pgm);
|
||||||
|
}
|
||||||
|
|
||||||
switch (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) {
|
switch (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) {
|
||||||
case 0x00000000:
|
case 0x00000000:
|
||||||
end = (start + (1UL << 12)) & ~((1UL << 12) - 1);
|
end = (start + (1UL << 12)) & ~((1UL << 12) - 1);
|
||||||
|
@ -665,10 +670,15 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
|
||||||
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
|
return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
|
||||||
}
|
}
|
||||||
while (start < end) {
|
while (start < end) {
|
||||||
unsigned long useraddr;
|
unsigned long useraddr, abs_addr;
|
||||||
|
|
||||||
useraddr = gmap_translate(start, vcpu->arch.gmap);
|
/* Translate guest address to host address */
|
||||||
if (IS_ERR((void *)useraddr))
|
if ((vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) == 0)
|
||||||
|
abs_addr = kvm_s390_real_to_abs(vcpu, start);
|
||||||
|
else
|
||||||
|
abs_addr = start;
|
||||||
|
useraddr = gfn_to_hva(vcpu->kvm, gpa_to_gfn(abs_addr));
|
||||||
|
if (kvm_is_error_hva(useraddr))
|
||||||
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
|
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
|
||||||
|
|
||||||
if (vcpu->run->s.regs.gprs[reg1] & PFMF_CF) {
|
if (vcpu->run->s.regs.gprs[reg1] & PFMF_CF) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue