All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next)
@ 2017-04-26 12:38 Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 1/3] s390/cpacf: query instructions use unique parameters for compatibility with KMA Christian Borntraeger
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Christian Borntraeger @ 2017-04-26 12:38 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, Martin Schwidefsky
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390, Heiko Carstens

Paolo, Radim,

one last feature for 4.12. This pull request contains 2 patches for the
s390 base maintainers. These patches are necessary for the 3rd one.
I handled it via a a merge of a topic branch that will also be merged
by Martins s390 tree.

The following changes since commit 730cd632c4e485b90f97fe998e300045da094938:

  KVM: s390: Support keyless subset guest mode (2017-04-21 11:08:11 +0200)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-next-4.12-3

for you to fetch changes up to e000b8e0968dd7bfa09c444607ce1e48e57aafd3:

  s390: kvm: Cpu model support for msa6, msa7 and msa8 (2017-04-26 14:19:01 +0200)

----------------------------------------------------------------
KVM: s390: MSA8 feature for guests

- Detect all function codes for KMA and export the features
  for use in the cpu model

----------------------------------------------------------------
Christian Borntraeger (1):
      Merge branch 's390forkvm' of git://git.kernel.org/.../kvms390/linux

Jason J. Herne (3):
      s390/cpacf: query instructions use unique parameters for compatibility with KMA
      s390/cpacf: Introduce kma instruction
      s390: kvm: Cpu model support for msa6, msa7 and msa8

 Documentation/virtual/kvm/devices/vm.txt | 3 ++-
 arch/s390/include/asm/cpacf.h            | 5 +++--
 arch/s390/include/uapi/asm/kvm.h         | 3 ++-
 arch/s390/kvm/kvm-s390.c                 | 4 ++++
 arch/s390/tools/gen_facilities.c         | 1 +
 tools/arch/s390/include/uapi/asm/kvm.h   | 3 ++-
 6 files changed, 14 insertions(+), 5 deletions(-)

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

* [GIT PULL 1/3] s390/cpacf: query instructions use unique parameters for compatibility with KMA
  2017-04-26 12:38 [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Christian Borntraeger
@ 2017-04-26 12:38 ` Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 2/3] s390/cpacf: Introduce kma instruction Christian Borntraeger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2017-04-26 12:38 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, Martin Schwidefsky
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390,
	Heiko Carstens, Jason J. Herne

From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>

The new KMA instruction requires unique parameters. Update __cpacf_query to
generate a compatible assembler instruction.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Acked-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/cpacf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h
index e2dfbf2..175a5d7 100644
--- a/arch/s390/include/asm/cpacf.h
+++ b/arch/s390/include/asm/cpacf.h
@@ -149,8 +149,8 @@ static inline void __cpacf_query(unsigned int opcode, cpacf_mask_t *mask)
 
 	asm volatile(
 		"	spm 0\n" /* pckmo doesn't change the cc */
-		/* Parameter registers are ignored, but may not be 0 */
-		"0:	.insn	rrf,%[opc] << 16,2,2,2,0\n"
+		/* Parameter regs are ignored, but must be nonzero and unique */
+		"0:	.insn	rrf,%[opc] << 16,2,4,6,0\n"
 		"	brc	1,0b\n"	/* handle partial completion */
 		: "=m" (*mask)
 		: [fc] "d" (r0), [pba] "a" (r1), [opc] "i" (opcode)
-- 
2.7.4

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

* [GIT PULL 2/3] s390/cpacf: Introduce kma instruction
  2017-04-26 12:38 [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 1/3] s390/cpacf: query instructions use unique parameters for compatibility with KMA Christian Borntraeger
@ 2017-04-26 12:38 ` Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 3/3] s390: kvm: Cpu model support for msa6, msa7 and msa8 Christian Borntraeger
  2017-04-27 12:11 ` [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2017-04-26 12:38 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, Martin Schwidefsky
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390,
	Heiko Carstens, Jason J. Herne

From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>

Provide a kma instruction definition for use by callers of __cpacf_query.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 arch/s390/include/asm/cpacf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/include/asm/cpacf.h b/arch/s390/include/asm/cpacf.h
index 175a5d7..31cac7d 100644
--- a/arch/s390/include/asm/cpacf.h
+++ b/arch/s390/include/asm/cpacf.h
@@ -26,6 +26,7 @@
 #define CPACF_PCC		0xb92c		/* MSA4 */
 #define CPACF_KMCTR		0xb92d		/* MSA4 */
 #define CPACF_PPNO		0xb93c		/* MSA5 */
+#define CPACF_KMA		0xb929		/* MSA8 */
 
 /*
  * En/decryption modifier bits
-- 
2.7.4

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

* [GIT PULL 3/3] s390: kvm: Cpu model support for msa6, msa7 and msa8
  2017-04-26 12:38 [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 1/3] s390/cpacf: query instructions use unique parameters for compatibility with KMA Christian Borntraeger
  2017-04-26 12:38 ` [GIT PULL 2/3] s390/cpacf: Introduce kma instruction Christian Borntraeger
@ 2017-04-26 12:38 ` Christian Borntraeger
  2017-04-27 12:11 ` [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Christian Borntraeger @ 2017-04-26 12:38 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, Martin Schwidefsky
  Cc: KVM, Christian Borntraeger, Cornelia Huck, linux-s390,
	Heiko Carstens, Jason J. Herne

From: "Jason J. Herne" <jjherne@linux.vnet.ibm.com>

msa6 and msa7 require no changes.
msa8 adds kma instruction and feature area.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
 Documentation/virtual/kvm/devices/vm.txt | 3 ++-
 arch/s390/include/uapi/asm/kvm.h         | 3 ++-
 arch/s390/kvm/kvm-s390.c                 | 4 ++++
 arch/s390/tools/gen_facilities.c         | 1 +
 tools/arch/s390/include/uapi/asm/kvm.h   | 3 ++-
 5 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/Documentation/virtual/kvm/devices/vm.txt b/Documentation/virtual/kvm/devices/vm.txt
index b6cda49..575ccb0 100644
--- a/Documentation/virtual/kvm/devices/vm.txt
+++ b/Documentation/virtual/kvm/devices/vm.txt
@@ -140,7 +140,8 @@ struct kvm_s390_vm_cpu_subfunc {
        u8 kmo[16];           # valid with Message-Security-Assist-Extension 4
        u8 pcc[16];           # valid with Message-Security-Assist-Extension 4
        u8 ppno[16];          # valid with Message-Security-Assist-Extension 5
-       u8 reserved[1824];    # reserved for future instructions
+       u8 kma[16];           # valid with Message-Security-Assist-Extension 8
+       u8 reserved[1808];    # reserved for future instructions
 };
 
 Parameters: address of a buffer to load the subfunction blocks from.
diff --git a/arch/s390/include/uapi/asm/kvm.h b/arch/s390/include/uapi/asm/kvm.h
index bf92679..3dd2a1d 100644
--- a/arch/s390/include/uapi/asm/kvm.h
+++ b/arch/s390/include/uapi/asm/kvm.h
@@ -141,7 +141,8 @@ struct kvm_s390_vm_cpu_subfunc {
 	__u8 kmo[16];		/* with MSA4 */
 	__u8 pcc[16];		/* with MSA4 */
 	__u8 ppno[16];		/* with MSA5 */
-	__u8 reserved[1824];
+	__u8 kma[16];		/* with MSA8 */
+	__u8 reserved[1808];
 };
 
 /* kvm attributes for crypto */
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 8771fef..7eb1275 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -276,6 +276,10 @@ static void kvm_s390_cpu_feat_init(void)
 		__cpacf_query(CPACF_PPNO, (cpacf_mask_t *)
 			      kvm_s390_available_subfunc.ppno);
 
+	if (test_facility(146)) /* MSA8 */
+		__cpacf_query(CPACF_KMA, (cpacf_mask_t *)
+			      kvm_s390_available_subfunc.kma);
+
 	if (MACHINE_HAS_ESOP)
 		allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ESOP);
 	/*
diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c
index 0cf802d..be63fbd 100644
--- a/arch/s390/tools/gen_facilities.c
+++ b/arch/s390/tools/gen_facilities.c
@@ -82,6 +82,7 @@ static struct facility_def facility_defs[] = {
 			78, /* enhanced-DAT 2 */
 			130, /* instruction-execution-protection */
 			131, /* enhanced-SOP 2 and side-effect */
+			146, /* msa extension 8 */
 			-1  /* END */
 		}
 	},
diff --git a/tools/arch/s390/include/uapi/asm/kvm.h b/tools/arch/s390/include/uapi/asm/kvm.h
index a2ffec4..7f4fd65 100644
--- a/tools/arch/s390/include/uapi/asm/kvm.h
+++ b/tools/arch/s390/include/uapi/asm/kvm.h
@@ -131,7 +131,8 @@ struct kvm_s390_vm_cpu_subfunc {
 	__u8 kmo[16];		/* with MSA4 */
 	__u8 pcc[16];		/* with MSA4 */
 	__u8 ppno[16];		/* with MSA5 */
-	__u8 reserved[1824];
+	__u8 kma[16];		/* with MSA8 */
+	__u8 reserved[1808];
 };
 
 /* kvm attributes for crypto */
-- 
2.7.4

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

* Re: [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next)
  2017-04-26 12:38 [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Christian Borntraeger
                   ` (2 preceding siblings ...)
  2017-04-26 12:38 ` [GIT PULL 3/3] s390: kvm: Cpu model support for msa6, msa7 and msa8 Christian Borntraeger
@ 2017-04-27 12:11 ` Paolo Bonzini
  3 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2017-04-27 12:11 UTC (permalink / raw)
  To: Christian Borntraeger, Radim Krčmář, Martin Schwidefsky
  Cc: KVM, Cornelia Huck, linux-s390, Heiko Carstens



On 26/04/2017 14:38, Christian Borntraeger wrote:
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git  tags/kvm-s390-next-4.12-3

Pulled, thanks.

Paolo

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

end of thread, other threads:[~2017-04-27 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 12:38 [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Christian Borntraeger
2017-04-26 12:38 ` [GIT PULL 1/3] s390/cpacf: query instructions use unique parameters for compatibility with KMA Christian Borntraeger
2017-04-26 12:38 ` [GIT PULL 2/3] s390/cpacf: Introduce kma instruction Christian Borntraeger
2017-04-26 12:38 ` [GIT PULL 3/3] s390: kvm: Cpu model support for msa6, msa7 and msa8 Christian Borntraeger
2017-04-27 12:11 ` [GIT PULL 0/3] KVM: s390: feature for 4.12 (kvm/next) Paolo Bonzini

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.