linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: linux-s390@vger.kernel.org
Subject: [GIT PULL 47/52] KVM: s390: pfmf: take care of amode when setting reg2
Date: Tue, 14 Jun 2016 18:57:24 +0000	[thread overview]
Message-ID: <201606141857.u5EIs1o5000783@mx0b-001b2d01.pphosted.com> (raw)
In-Reply-To: <201606141857.u5EIs0dO141856@mx0a-001b2d01.pphosted.com>

From: David Hildenbrand <dahi@linux.vnet.ibm.com>

Depending on the addressing mode, we must not overwrite bit 0-31 of the
register. In addition, 24 bit and 31 bit have to set certain bits to 0,
which is guaranteed by converting the end address to an effective
address.

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/kvm/priv.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 5c926b7..71fa603 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -733,8 +733,15 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
 
 		start += PAGE_SIZE;
 	}
-	if (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC)
-		vcpu->run->s.regs.gprs[reg2] = end;
+	if (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) {
+		if (psw_bits(vcpu->arch.sie_block->gpsw).eaba == PSW_AMODE_64BIT) {
+			vcpu->run->s.regs.gprs[reg2] = end;
+		} else {
+			vcpu->run->s.regs.gprs[reg2] &= ~0xffffffffUL;
+			end = kvm_s390_logical_to_effective(vcpu, end);
+			vcpu->run->s.regs.gprs[reg2] |= end;
+		}
+	}
 	return 0;
 }
 
-- 
2.5.5

  reply	other threads:[~2016-06-14 18:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1465930649-181383-1-git-send-email-borntraeger@de.ibm.com>
2016-06-14 18:56 ` [GIT PULL 01/52] s390: hypfs: Move diag implementation and data definitions Christian Borntraeger
2016-06-14 18:56   ` Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 02/52] s390: Make cpc_name accessible Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 03/52] s390: Make diag224 public Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 04/52] KVM: s390: Add operation exception interception handler Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 05/52] KVM: s390: Extend diag 204 fields Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 06/52] KVM: s390: Add sthyi emulation Christian Borntraeger
2016-06-14 18:56   ` Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 07/52] KVM: s390: Limit sthyi execution Christian Borntraeger
2016-06-14 18:56   ` Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 08/52] KVM: s390: Add mnemonic print to kvm_s390_intercept_prog Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 09/52] KVM: s390: interface to query and configure cpu features Christian Borntraeger
2016-06-14 18:56   ` Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 10/52] KVM: s390: forward ESOP if available Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 11/52] KVM: s390: gaccess: store guest address on ALC prot exceptions Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 12/52] KVM: s390: gaccess: function for preparing translation exceptions Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 13/52] KVM: s390: gaccess: convert kvm_s390_check_low_addr_prot_real() Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 14/52] KVM: s390: gaccess: convert guest_translate_address() Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 15/52] KVM: s390: gaccess: convert guest_page_range() Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 16/52] KVM: s390: gaccess: convert get_vcpu_asce() Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 17/52] s390/crypto: allow to query all known cpacf functions Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 18/52] KVM: s390: interface to query and configure cpu subfunctions Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 19/52] s390/sclp: detect 64-bit-SCAO facility Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 20/52] KVM: s390: handle missing " Christian Borntraeger
2016-06-14 18:56   ` Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 21/52] s390/sclp: detect guest-PER enhancement Christian Borntraeger
2016-06-14 18:56 ` [GIT PULL 22/52] KVM: s390: guestdbg: signal missing hardware support Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 23/52] s390/sclp: detect cmma Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 24/52] KVM: s390: enable CMMA if the interpration is available Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 25/52] KVM: s390: provide CMMA attributes only if available Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 26/52] s390/sclp: detect guest-storage-limit-suppression Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 27/52] KVM: s390: handle missing guest-storage-limit-suppression Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 28/52] s390/sclp: detect intervention bypass facility Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 29/52] KVM: s390: enable ib only if available Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 30/52] s390/sclp: detect conditional-external-interception facility Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 31/52] KVM: s390: enable cei only if available Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 32/52] s390/sclp: detect PFMF interpretation facility Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 33/52] KVM: s390: enable PFMFI only if available Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 34/52] s390/sclp: detect interlock-and-broadcast-suppression facility Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 35/52] KVM: s390: enable ibs only if available Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 36/52] KVM: s390: enable host-protection-interruption only with ESOP Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 37/52] KVM: s390: turn on tx even without ctx Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 38/52] KVM: s390: provide logging for diagnose 0x500 Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 39/52] KVM: s390: fixup I/O interrupt traces Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 40/52] s390/mm: don't drop errors in get_guest_storage_key Christian Borntraeger
2016-06-14 18:57 ` Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 41/52] s390/mm: set and get guest storage key mmap locking Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 42/52] s390/mm: simplify get_guest_storage_key Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 43/52] s390/mm: return key via pointer in get_guest_storage_key Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 44/52] KVM: s390: storage keys fit into a char Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 45/52] KVM: s390: pfmf: fix end address calculation Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 46/52] KVM: s390: pfmf: MR and MC are ignored without CSSKE Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 47/52] KVM: s390: pfmf: take care of amode when setting reg2 Christian Borntraeger
2016-06-14 18:57   ` Christian Borntraeger [this message]
2016-06-14 18:57 ` [GIT PULL 48/52] KVM: s390: pfmf: support conditional-sske facility Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 49/52] KVM: s390: pfmf: handle address overflows Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 50/52] s390/sclp: detect storage-key facility Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 51/52] KVM: s390: trace and count all skey intercepts Christian Borntraeger
2016-06-14 18:57 ` [GIT PULL 52/52] KVM: s390: handle missing storage-key facility Christian Borntraeger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201606141857.u5EIs1o5000783@mx0b-001b2d01.pphosted.com \
    --to=borntraeger@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).