From nobody Fri Nov 14 21:46:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1590490088; cv=none; d=zohomail.com; s=zohoarc; b=Q75sahuKXP/bQsN7Hpyfj8g/ViWUQfZjUO5FUE5zhRa7vl46QCz4bOHrSapUWpcrh171COheZz9NNWSwdAuSv1BvEg9c8FTqtik0hig0oMCt2xay4fhzh6jFDKRYQkSIcpFubcSW43rY5QMl6vbTzH+PFvJtysICk9wozUAhHdc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590490088; 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=a9SysdSsKGxJrK/73xeVGFTccxqpkDfnjIuSZKtsRJqMKOXz5XulKr0atXj4hVjBi3muGEfjhu+466jtdPX/rKBV8r2AbXSKO289lXqDfvXjFKjqdN8OE+iWe4ohd//4f2aIA/Hkw3tORPknc9FAoXROAswBsZ+GLdliNmVbECk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1590490088144351.7635432255523; Tue, 26 May 2020 03:48:08 -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-485-JbkpiV00PEqcOZ7sYZWCfQ-1; Tue, 26 May 2020 06:48:04 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5462D107ACF9; Tue, 26 May 2020 10:47:59 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3598D79C4C; Tue, 26 May 2020 10:47:59 +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 093226B498; Tue, 26 May 2020 10:47:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 04QAluK4030004 for ; Tue, 26 May 2020 06:47:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4CDA4202696C; Tue, 26 May 2020 10:47:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 254262028CD3 for ; Tue, 26 May 2020 10:47:56 +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 2A6A01049847 for ; Tue, 26 May 2020 10:47:54 +0000 (UTC) Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-UUYS19MNOx2vgCz0NXAhxw-1; Tue, 26 May 2020 06:47:49 -0400 Received: by mail-ej1-f66.google.com with SMTP id o15so1910511ejm.12; Tue, 26 May 2020 03:47:48 -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 c27sm3342597ejd.19.2020.05.26.03.47.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 03:47:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590490086; 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=Aj3m0dkYzl5ghqeK55JnhfTmMDsKXPUaxl87sgE0o/FR/rKlI00qp2dKVPGuZtM5KpXARA TmdGIo0qDFtDC4YKMRyOgYsTzjiKgQ3BfcuyLHW4dr5yDRWx12on1oCzrs0HbTTf7J+CmO 0xMMEPvmoB/q8qbYxXWWB6B1cqVTERI= X-MC-Unique: JbkpiV00PEqcOZ7sYZWCfQ-1 X-MC-Unique: UUYS19MNOx2vgCz0NXAhxw-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=YZVhCR3nHBPkZGvDLseW9rS8k+TODF3OLPQnTDtjofIlTTejIphoPcz9M2AjtMGl+v kl1sAKdGL+vfLw47rBY9D/v79vDBl/nbY2NA490teR96as7nd8PuSB9NzNXVM6pTvRhg gHATz2XJ6xxdIO4QSjBWAMbKOfgX9VRpI58KkFJZ9TDoeVr8qBTxJ34kS/TzXElIvxDn eUH3b75t+FDNYewFwIfAvQJmqOv1N9PCcxtK8+O1OCsugjtgrpX7AAs4Ws8MV31MB9Y/ VqMeqreBwznATdV93sOE9/QnOvZ5kLgxPHSucfWmpo/LPzL5V931bpDwskqcZs55p9qn f2OQ== X-Gm-Message-State: AOAM533sVBMCKTkice1KiGBbECLraM2WSS02f2XJ8Bf0i6kyGUEoDD7n MKUdOL5aeRzU59MUkaowf6c= X-Google-Smtp-Source: ABdhPJy1srfveRWp4BYfglPPpBm74kwqzlVLximCdMgSDXaasUTut93LWwDHx66jJr980f8hMOkJoA== X-Received: by 2002:a17:906:1f09:: with SMTP id w9mr530482ejj.508.1590490067469; Tue, 26 May 2020 03:47:47 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 13/14] hw/mips/mips_int: De-duplicate KVM interrupt delivery Date: Tue, 26 May 2020 12:47:25 +0200 Message-Id: <20200526104726.11273-14-f4bug@amsat.org> In-Reply-To: <20200526104726.11273-1-f4bug@amsat.org> References: <20200526104726.11273-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Spam-Signature: yes X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 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.11 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