Skip to contentSkip to conversation

KVM: s390: start using the GIB

PATCH Michael Mueller 1 participant 1 message Nov 27, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 27 lines · Cornelia Huck
Quoted 24 lines · On Mon, 19 Nov 2018 18:25:36 +0100 Michael Mueller <[email protected]> wrote:

By initializing the GIB, it will we used by the kvm host.

---
  arch/s390/kvm/kvm-s390.c | 6 ++++++
  1 file changed, 6 insertions(+)
arch/s390/kvm/kvm-s390.c +2 -0
index 386f98029a3f..08341be4d0aa 100644
@@ -417,6 +417,8 @@ static void kvm_s390_cpu_feat_init(void)
 
  int kvm_arch_init(void *opaque)
  {
+	int rc;
+
  	kvm_s390_dbf = debug_register("kvm-trace", 32, 1, 7 * sizeof(long));
  	if (!kvm_s390_dbf)
  		return -ENOMEM;
@@ -426,6 +428,10 @@ int kvm_arch_init(void *opaque)
  		return -ENOMEM;
  	}
 
Quoted 6 lines

arch/s390/kvm/kvm-s390.c int kvm_arch_init(void *opaque) · line 433

Quoted 3 lines
arch/s390/kvm/kvm-s390.c +3 -0
+	rc = kvm_s390_gib_init(GAL_ISC);
+	if (rc)
+		return rc;

Is a quick exit the right thing here? Doesn't that leave a memory leak because you did not unregister the dbf again?

Yes indeed!

Quoted 11 lines

arch/s390/kvm/kvm-s390.c int kvm_arch_init(void *opaque) · line 437

Quoted 5 lines
arch/s390/kvm/kvm-s390.c +1 -0
+
  	kvm_s390_cpu_feat_init();
 
  	/* Register floating interrupt controller interface. */

Further below, we'll have the same problem (dbf leak) if registering the flic should fail. This is extremely unlikely... but don't we also need to clean up the gib again in that case? For all later failure cases in kvm init, the exit function is called, but that one may be a problem.

Well all this is rather unlikely but not impossible.

I will prepare a separate patch for the flic issue and put it in front.

Quoted 1 line