yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-kvm-Make-kvm_sclp_service_call-void.patch

ddf19c
From 999cf62d870ff9aa8e9609fcbbcefef9ae1aceb6 Mon Sep 17 00:00:00 2001
ddf19c
From: Thomas Huth <thuth@redhat.com>
ddf19c
Date: Fri, 29 May 2020 05:53:50 -0400
ddf19c
Subject: [PATCH 08/42] s390x: kvm: Make kvm_sclp_service_call void
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Thomas Huth <thuth@redhat.com>
ddf19c
Message-id: <20200529055420.16855-9-thuth@redhat.com>
ddf19c
Patchwork-id: 97030
ddf19c
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH v2 08/38] s390x: kvm: Make kvm_sclp_service_call void
ddf19c
Bugzilla: 1828317
ddf19c
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
RH-Acked-by: David Hildenbrand <david@redhat.com>
ddf19c
ddf19c
From: Janosch Frank <frankja@linux.ibm.com>
ddf19c
ddf19c
It defaults to returning 0 anyway and that return value is not
ddf19c
necessary, as 0 is also the default rc that the caller would return.
ddf19c
ddf19c
While doing that we can simplify the logic a bit and return early if
ddf19c
we inject a PGM exception.
ddf19c
ddf19c
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
ddf19c
Reviewed-by: Thomas Huth <thuth@redhat.com>
ddf19c
Message-Id: <20191129091713.4582-1-frankja@linux.ibm.com>
ddf19c
Reviewed-by: David Hildenbrand <david@redhat.com>
ddf19c
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ddf19c
(cherry picked from commit 15b6c0370c3e2774fd9ffda5c10c6e36952e8eb6)
ddf19c
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ddf19c
---
ddf19c
 target/s390x/kvm.c | 12 +++++-------
ddf19c
 1 file changed, 5 insertions(+), 7 deletions(-)
ddf19c
ddf19c
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
ddf19c
index a02d569537..1c5bc7a2f9 100644
ddf19c
--- a/target/s390x/kvm.c
ddf19c
+++ b/target/s390x/kvm.c
ddf19c
@@ -1159,13 +1159,13 @@ void kvm_s390_access_exception(S390CPU *cpu, uint16_t code, uint64_t te_code)
ddf19c
     kvm_s390_vcpu_interrupt(cpu, &irq);
ddf19c
 }
ddf19c
 
ddf19c
-static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
ddf19c
+static void kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
ddf19c
                                  uint16_t ipbh0)
ddf19c
 {
ddf19c
     CPUS390XState *env = &cpu->env;
ddf19c
     uint64_t sccb;
ddf19c
     uint32_t code;
ddf19c
-    int r = 0;
ddf19c
+    int r;
ddf19c
 
ddf19c
     sccb = env->regs[ipbh0 & 0xf];
ddf19c
     code = env->regs[(ipbh0 & 0xf0) >> 4];
ddf19c
@@ -1173,11 +1173,9 @@ static int kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
ddf19c
     r = sclp_service_call(env, sccb, code);
ddf19c
     if (r < 0) {
ddf19c
         kvm_s390_program_interrupt(cpu, -r);
ddf19c
-    } else {
ddf19c
-        setcc(cpu, r);
ddf19c
+        return;
ddf19c
     }
ddf19c
-
ddf19c
-    return 0;
ddf19c
+    setcc(cpu, r);
ddf19c
 }
ddf19c
 
ddf19c
 static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
ddf19c
@@ -1240,7 +1238,7 @@ static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1)
ddf19c
         setcc(cpu, 3);
ddf19c
         break;
ddf19c
     case PRIV_B2_SCLP_CALL:
ddf19c
-        rc = kvm_sclp_service_call(cpu, run, ipbh0);
ddf19c
+        kvm_sclp_service_call(cpu, run, ipbh0);
ddf19c
         break;
ddf19c
     default:
ddf19c
         rc = -1;
ddf19c
-- 
ddf19c
2.27.0
ddf19c