Skip to contentSkip to conversation

KVM: s390: Fix for destroy page ultravisor call

GIT PULL Christian Borntraeger 2 participants 4 messages Nov 18, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Paolo,

one more fix for 5.10 in addition with an update of the MAINTAINERS file. The uv.c file is mostly used by KVM and Heiko asked that we take care of this patch.

The following changes since commit 6cbf1e960fa52e4c63a6dfa4cda8736375b34ccc:

KVM: s390: remove diag318 reset code (2020-11-11 09:31:52 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git tags/kvm-s390-master-5.10-2

for you to fetch changes up to 735931f9a51ab09cf795721b37696b420484625f:

MAINTAINERS: add uv.c also to KVM/s390 (2020-11-18 13:09:21 +0100)

----------------------------------------------------------------
KVM: s390: Fix for destroy page ultravisor call

- handle response code from older firmware
- add uv.c to KVM: s390/s390 maintainer list

----------------------------------------------------------------
Christian Borntraeger (2):
s390/uv: handle destroy page legacy interface
MAINTAINERS: add uv.c also to KVM/s390

 MAINTAINERS           | 1 +
 arch/s390/kernel/uv.c | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)
#1 lore raw

[GIT PULL 2/2] MAINTAINERS: add uv.c also to KVM/s390

Most changes in uv.c are related to KVM. Involve also the KVM team regarding changes to uv.c.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index e73636b75f29..06116d892a4b 100644
@@ -9674,6 +9674,7 @@ F:	Documentation/virt/kvm/s390*
 F:	arch/s390/include/asm/gmap.h
 F:	arch/s390/include/asm/kvm*
 F:	arch/s390/include/uapi/asm/kvm*
+F:	arch/s390/kernel/uv.c
 F:	arch/s390/kvm/
 F:	arch/s390/mm/gmap.c
 F:	tools/testing/selftests/kvm/*/s390x/
Signature · 1 line
2.28.0
#2 lore raw

[GIT PULL 1/2] s390/uv: handle destroy page legacy interface

In reply to Christian Borntraeger

Older firmware can return rc=0x107 rrc=0xd for destroy page if the page is already non-secure. This should be handled like a success as already done by newer firmware.

Fixes 1a80b54d1ce1 ("s390/uv: add destroy page call")
---
 arch/s390/kernel/uv.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
arch/s390/kernel/uv.c +8 -1
index 14bd9d58edc9..883bfed9f5c2 100644
@@ -129,8 +129,15 @@ int uv_destroy_page(unsigned long paddr)
 		.paddr = paddr
 	};
 
-	if (uv_call(0, (u64)&uvcb))
+	if (uv_call(0, (u64)&uvcb)) {
+		/*
+		 * Older firmware uses 107/d as an indication of a non secure
+		 * page. Let us emulate the newer variant (no-op).
+		 */
+		if (uvcb.header.rc == 0x107 && uvcb.header.rrc == 0xd)
+			return 0;
 		return -EINVAL;
+	}
 	return 0;
 }
 
Signature · 1 line
2.28.0
maintainer
#3 lore raw
In reply to Christian Borntraeger
Quoted 24 lines · Christian Borntraeger

Paolo,

one more fix for 5.10 in addition with an update of the MAINTAINERS file. The uv.c file is mostly used by KVM and Heiko asked that we take care of this patch.

The following changes since commit 6cbf1e960fa52e4c63a6dfa4cda8736375b34ccc:

   KVM: s390: remove diag318 reset code (2020-11-11 09:31:52 +0100)

are available in the Git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-master-5.10-2

for you to fetch changes up to 735931f9a51ab09cf795721b37696b420484625f:

   MAINTAINERS: add uv.c also to KVM/s390 (2020-11-18 13:09:21 +0100)

----------------------------------------------------------------
KVM: s390: Fix for destroy page ultravisor call

- handle response code from older firmware
- add uv.c to KVM: s390/s390 maintainer list

Quoted 9 lines

----------------------------------------------------------------
Christian Borntraeger (2):
s390/uv: handle destroy page legacy interface
MAINTAINERS: add uv.c also to KVM/s390

  MAINTAINERS           | 1 +
  arch/s390/kernel/uv.c | 9 ++++++++-
  2 files changed, 9 insertions(+), 1 deletion(-)

Pulled, thanks.

Paolo