From nobody Fri Nov 14 21:47:15 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590500014; cv=none; d=zohomail.com; s=zohoarc; b=IEGbITmWYQE83UQg3PEN0KGk8XFc7lvfVuNbwhh2HuPrne36KvVqqHpIiOJpJcdoxTyMS/URy7OQJB1bx9rWUgENP6Zjyrv13Ru2liNv3ZLoL/5vWkt1GJsCUSm3B4VQVivLEUF83gBZffgLSvN85Rfs+O4YE8vID6OZmHstS6I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590500014; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SzMnP+v0boOKzPS/hAbB4oxH7IK6D4Ae63ekoZyVIXc=; b=l7x37oC0tcs8MSoTISsa64Nw8M1j2zzVtQGsW4/zd8eLgPTPlUN9t7z8axQVSovvufrzZQGardIryNaBXXFBdU7DzyhY8wJ18Yet5EJ7at882Bsn7ntLMljbjZZkSqZXgO69zBHYsIu4D/SSgN4YmPwH+7kjsiSiFwjLU0Qkn3A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1590500014492107.8759397709556; Tue, 26 May 2020 06:33:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-qd4-QZ6RPzu9aVY7LPuwEw-1; Tue, 26 May 2020 09:33:30 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 170722D56; Tue, 26 May 2020 13:33:21 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EDDE9703BC; Tue, 26 May 2020 13:33:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BD5521809563; Tue, 26 May 2020 13:33:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QDXJX8012517 for ; Tue, 26 May 2020 09:33:19 -0400 Received: by smtp.corp.redhat.com (Postfix) id 696092166BA4; Tue, 26 May 2020 13:33:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BB9E2157F26 for ; Tue, 26 May 2020 13:33:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2982C862F63 for ; Tue, 26 May 2020 13:33:19 +0000 (UTC) Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-235-U0vGuhpIMJWohDC1iC9_-w-1; Tue, 26 May 2020 09:33:11 -0400 Received: by mail-ed1-f52.google.com with SMTP id g9so17644345edw.10; Tue, 26 May 2020 06:33:10 -0700 (PDT) Received: from x1w.redhat.com (71.red-88-21-204.staticip.rima-tde.net. [88.21.204.71]) by smtp.gmail.com with ESMTPSA id n25sm1623084edo.56.2020.05.26.06.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 06:33:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590500013; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SzMnP+v0boOKzPS/hAbB4oxH7IK6D4Ae63ekoZyVIXc=; b=VgGi3zdy9N4Gu8nrcTeoUrhB6Ue6UsMnqN8e3j246GUIhICBVPNoQ9SF0Go/Q8unM12mXK jJjffqdj6CoG9aUx1Sy4QOqfuTLB2l5gMXXMVCK33341lV4eThhSUiQ6uJU17K2JkwiZPF /uWq2RrtDRY21CM9QLnwkRLLmkBVx6Y= X-MC-Unique: qd4-QZ6RPzu9aVY7LPuwEw-1 X-MC-Unique: U0vGuhpIMJWohDC1iC9_-w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SzMnP+v0boOKzPS/hAbB4oxH7IK6D4Ae63ekoZyVIXc=; b=nJ+oLXWssUJPeu2Bt++ClhghDBl+JEgqFyF5bqg1Pksd9SqIyNzSzWvJO0uLklnqHw YDjjyYQv7JvNWqPx2Lui/lBm2Rtc9nklJGAFSQ9G4zuIxqUL7jMzVCoM9qwGVCT1lEyS /Zp1sozVO0gITtGvXfjl/hvr+YAGMBEsB9HkDF54gqx//ZXWOejqBIa7C/ytIvy311/z XdKELOQOcfD1VH/xYpdlObhMl+jZmbZYCwOAH7l6Dksh5jKtd5uZ1su6TQwyoix0F++q +mdU9ONtOdKL/l+MBRFfyDHD3yJVZRrSQUSM8fM9g1ZmX7EITtiOku2U3mLRLOv2QOEH BACg== X-Gm-Message-State: AOAM5332meDtQsirecCMi3+LXsLeD/uiqZURXJ680f8S98Kcwc/gKfpw jKsaF0ZnbW1MBWg9I+s7/co= X-Google-Smtp-Source: ABdhPJyhe8NpcMddqxli+7/P7ZF4MbpIJ2/9Jo4E7uADaHqbr/LsGsvWVSz60OKuxbSdJVyVpp4SvA== X-Received: by 2002:aa7:c444:: with SMTP id n4mr19858176edr.308.1590499989149; Tue, 26 May 2020 06:33:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/14] hw/mips/mips_int: De-duplicate KVM interrupt delivery Date: Tue, 26 May 2020 15:32:46 +0200 Message-Id: <20200526133247.13066-14-f4bug@amsat.org> In-Reply-To: <20200526133247.13066-1-f4bug@amsat.org> References: <20200526133247.13066-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Laurent Vivier , Aleksandar Rikalo , libvir-list@redhat.com, Thomas Huth , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , Huacai Chen , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aurelien Jarno X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Refactor duplicated code in a single place. Reviewed-by: Thomas Huth Message-Id: <20200429082916.10669-2-f4bug@amsat.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/mips/mips_int.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/mips/mips_int.c b/hw/mips/mips_int.c index 796730b11d..4a1bf846da 100644 --- a/hw/mips/mips_int.c +++ b/hw/mips/mips_int.c @@ -47,17 +47,12 @@ static void cpu_mips_irq_request(void *opaque, int irq,= int level) =20 if (level) { env->CP0_Cause |=3D 1 << (irq + CP0Ca_IP); - - if (kvm_enabled() && irq =3D=3D 2) { - kvm_mips_set_interrupt(cpu, irq, level); - } - } else { env->CP0_Cause &=3D ~(1 << (irq + CP0Ca_IP)); + } =20 - if (kvm_enabled() && irq =3D=3D 2) { - kvm_mips_set_interrupt(cpu, irq, level); - } + if (kvm_enabled() && irq =3D=3D 2) { + kvm_mips_set_interrupt(cpu, irq, level); } =20 if (env->CP0_Cause & CP0Ca_IP_mask) { --=20 2.21.3