All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master)
@ 2017-04-04  8:51 Christian Borntraeger
  2017-04-04  8:51 ` [GIT PULL 1/1] KVM: s390: remove change-recording override support Christian Borntraeger
  2017-04-04 13:54 ` [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Radim Krčmář
  0 siblings, 2 replies; 3+ messages in thread
From: Christian Borntraeger @ 2017-04-04  8:51 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390

Paolo, Radim,

a fix for the new iep feature that was added in 4.11-rc1.

The following changes since commit 97da3854c526d3a6ee05c849c96e48d21527606c:

  Linux 4.11-rc3 (2017-03-19 19:09:39 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-master-4.11-1

for you to fetch changes up to 232b8e3b1d4946a45e3b9dd4c282b12a085dd39d:

  KVM: s390: remove change-recording override support (2017-04-03 12:45:08 +0200)

----------------------------------------------------------------
KVM: s390: Fix instruction-execution-protection/change-recording override

This is a fix that prevents translation exception errors
on valid page tables for the instruction-exection-protection
support. This feature was added during the 4.11 merge window.
We have to remove an old check that would trigger if the
change-recording override is not available (e.g. edat1 disabled
via cpu model).

----------------------------------------------------------------
Heiko Carstens (1):
      KVM: s390: remove change-recording override support

 arch/s390/kvm/gaccess.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [GIT PULL 1/1] KVM: s390: remove change-recording override support
  2017-04-04  8:51 [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Christian Borntraeger
@ 2017-04-04  8:51 ` Christian Borntraeger
  2017-04-04 13:54 ` [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Radim Krčmář
  1 sibling, 0 replies; 3+ messages in thread
From: Christian Borntraeger @ 2017-04-04  8:51 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390, Heiko Carstens

From: Heiko Carstens <heiko.carstens@de.ibm.com>

Change-recording override (CO) was never implemented in any
machine. According to the architecture it is unpredictable if a
translation-specification exception will be recognized if the bit is
set and EDAT1 does not apply.
Therefore the easiest solution is to simply ignore the bit.

This also fixes commit cd1836f583d7 ("KVM: s390:
instruction-execution-protection support"). A guest may enable
instruction-execution-protection (IEP) but not EDAT1. In such a case
the guest_translate() function (arch/s390/kvm/gaccess.c) will report a
specification exception on pages that have the IEP bit set while it
should not.

It might make sense to add full IEP support to guest_translate() and
the GACC_IFETCH case. However, as far as I can tell the GACC_IFETCH
case is currently only used after an instruction was executed in order
to fetch the failing instruction. So there is no additional problem
*currently*.

Fixes: cd1836f583d7 ("KVM: s390: instruction-execution-protection support")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/kvm/gaccess.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index d55c829..ddbffb7 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -168,8 +168,7 @@ union page_table_entry {
 		unsigned long z  : 1; /* Zero Bit */
 		unsigned long i  : 1; /* Page-Invalid Bit */
 		unsigned long p  : 1; /* DAT-Protection Bit */
-		unsigned long co : 1; /* Change-Recording Override */
-		unsigned long	 : 8;
+		unsigned long	 : 9;
 	};
 };
 
@@ -745,8 +744,6 @@ static unsigned long guest_translate(struct kvm_vcpu *vcpu, unsigned long gva,
 		return PGM_PAGE_TRANSLATION;
 	if (pte.z)
 		return PGM_TRANSLATION_SPEC;
-	if (pte.co && !edat1)
-		return PGM_TRANSLATION_SPEC;
 	dat_protection |= pte.p;
 	raddr.pfra = pte.pfra;
 real_address:
@@ -1182,7 +1179,7 @@ int kvm_s390_shadow_fault(struct kvm_vcpu *vcpu, struct gmap *sg,
 		rc = gmap_read_table(sg->parent, pgt + vaddr.px * 8, &pte.val);
 	if (!rc && pte.i)
 		rc = PGM_PAGE_TRANSLATION;
-	if (!rc && (pte.z || (pte.co && sg->edat_level < 1)))
+	if (!rc && pte.z)
 		rc = PGM_TRANSLATION_SPEC;
 shadow_page:
 	pte.p |= dat_protection;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master)
  2017-04-04  8:51 [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Christian Borntraeger
  2017-04-04  8:51 ` [GIT PULL 1/1] KVM: s390: remove change-recording override support Christian Borntraeger
@ 2017-04-04 13:54 ` Radim Krčmář
  1 sibling, 0 replies; 3+ messages in thread
From: Radim Krčmář @ 2017-04-04 13:54 UTC (permalink / raw)
  To: Christian Borntraeger; +Cc: Paolo Bonzini, KVM, Cornelia Huck, linux-s390

2017-04-04 10:51+0200, Christian Borntraeger:
> Paolo, Radim,
> 
> a fix for the new iep feature that was added in 4.11-rc1.

Pulled, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-04-04 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-04  8:51 [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Christian Borntraeger
2017-04-04  8:51 ` [GIT PULL 1/1] KVM: s390: remove change-recording override support Christian Borntraeger
2017-04-04 13:54 ` [GIT PULL 0/1] KVM: s390: fix for 4.11 (kvm/master) Radim Krčmář

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.