From nobody Tue Feb 10 21:59:33 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1604424735; cv=none; d=zohomail.com; s=zohoarc; b=RiuKqcoIdC79+diOV8t1K9GkcyNPfw4ordxuBAPE39bir5d/9bW4wtEC3kMgrFWooe2lwiwvSlu9FqSInvPMemHRrI4+UPaOYVLfYeXeA3+kAAXPqbsxwWeDRMaRowIttjfmckd9jWBz0gjK1Pb4JYWG18Sv6ILF8n4n9QZKiZI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604424735; 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=foVWc9r1HLdO6p7KIENhYlJk5TO0X5g97/2uwPfPPpU=; b=BSJ73Wggdo84mv3siPFdkok8Uvbx4ne10Y5QgqECbNOi/xkuaGqY6Ri6kqq3hlECmY13LzFdp/dzzs0o95muzLic1o2oiE6JL/F8MAlP4AUvnOAOBpKVHCWkbgn/RNgZijf/PUE5RHlvijG5eVk3tCvzKoYE8RCX2xFnyXC2KxA= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1604424735703260.54479722831945; Tue, 3 Nov 2020 09:32:15 -0800 (PST) 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-596-Vng4ZMVSPEu05Ey1_g4Syg-1; Tue, 03 Nov 2020 12:32:09 -0500 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 69A198049DF; Tue, 3 Nov 2020 17:32:03 +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 47E3176649; Tue, 3 Nov 2020 17:32:03 +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 13368180B65D; Tue, 3 Nov 2020 17:32:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0A3HW0ob020601 for ; Tue, 3 Nov 2020 12:32:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id A1908A37AC; Tue, 3 Nov 2020 17:32:00 +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 9BB0FA37AA for ; Tue, 3 Nov 2020 17:31:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (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 71AB390E42A for ; Tue, 3 Nov 2020 17:31:58 +0000 (UTC) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-562-pxnvRbQCMxenZ8gScGjTLw-1; Tue, 03 Nov 2020 12:31:52 -0500 Received: by mail-wr1-f41.google.com with SMTP id n18so19387558wrs.5; Tue, 03 Nov 2020 09:31:51 -0800 (PST) Received: from x1w.redhat.com (234.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.234]) by smtp.gmail.com with ESMTPSA id x10sm25986458wrp.62.2020.11.03.09.31.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 09:31:50 -0800 (PST) X-MC-Unique: Vng4ZMVSPEu05Ey1_g4Syg-1 X-MC-Unique: pxnvRbQCMxenZ8gScGjTLw-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=foVWc9r1HLdO6p7KIENhYlJk5TO0X5g97/2uwPfPPpU=; b=atgvxozEXKyhXuiS1K1QSHFMQ3E8z3E6mQgf3BVYJD4fDhdF2kvSrGirWv+ul7JMJz 6NuzVbvA6QmbGeuPEL3NCvACYWUIXiAfMTaX9jRd19+WDPCpla+EeYXZDxRR0CS9kkdN JyXDecDVLfAtBTf8xREthP5TPN2VmbJWG2hmYpRV5zU0/oL8ITMT58GIrFI+/Mec/Epo HgBGib88H/csAgemWPhEcohDt1FpGDDAu5zy4T+kQg19Qa80DedTK48iy8S9ddRymne9 HzBJqc1fGYuNAMEBjG7Oo35bALhv7z3iQ0v1nr+65ywweNzZ+D0cGOgO/7+Pj/T/nvhO QDyA== X-Gm-Message-State: AOAM531bqbbOzHxv+iAYHnN/JRp2dtliSySxuXZfChvOyylh+23GuBiE EAwJQ/Ps5PkqlCHTMP1DfAM= X-Google-Smtp-Source: ABdhPJyQKtbepnTGklAK/im/LjZLVxerUBaDgLC7W9fp0ilK2rCBdCDV4yFrPYGkdsvlFRur0qpE9A== X-Received: by 2002:a5d:4b12:: with SMTP id v18mr27108339wrq.259.1604424710951; Tue, 03 Nov 2020 09:31:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 4/6] hw/intc/loongson: Fix incorrect 'core' calculation in liointc_read/write Date: Tue, 3 Nov 2020 18:31:25 +0100 Message-Id: <20201103173127.2704256-5-f4bug@amsat.org> In-Reply-To: <20201103173127.2704256-1-f4bug@amsat.org> References: <20201103173127.2704256-1-f4bug@amsat.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-loop: libvir-list@redhat.com Cc: Laurent Vivier , Thomas Huth , qemu-block@nongnu.org, Paul Burton , libvir-list@redhat.com, Aleksandar Rikalo , Euler Robot , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , AlexChen , Huacai Chen , Paolo Bonzini , John Snow , 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: AlexChen According to the loongson spec (http://www.loongson.cn/uploadfile/cpu/3B1500/Loongson_3B1500_cpu_user_1.pd= f) and the macro definition(#define R_PERCORE_ISR(x) (0x40 + 0x8 * x)), we know that the ISR size per CORE is 8, so here we need to divide (addr - R_PERCORE_ISR(0)) by 8, not 4. Reported-by: Euler Robot Signed-off-by: Alex Chen Reviewed-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <5FA12391.8090400@huawei.com> [PMD: Shortened subject] Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/loongson_liointc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/intc/loongson_liointc.c b/hw/intc/loongson_liointc.c index 30fb375b721..fbbfb57ee9c 100644 --- a/hw/intc/loongson_liointc.c +++ b/hw/intc/loongson_liointc.c @@ -130,7 +130,7 @@ liointc_read(void *opaque, hwaddr addr, unsigned int si= ze) =20 if (addr >=3D R_PERCORE_ISR(0) && addr < R_PERCORE_ISR(NUM_CORES)) { - int core =3D (addr - R_PERCORE_ISR(0)) / 4; + int core =3D (addr - R_PERCORE_ISR(0)) / 8; r =3D p->per_core_isr[core]; goto out; } @@ -173,7 +173,7 @@ liointc_write(void *opaque, hwaddr addr, =20 if (addr >=3D R_PERCORE_ISR(0) && addr < R_PERCORE_ISR(NUM_CORES)) { - int core =3D (addr - R_PERCORE_ISR(0)) / 4; + int core =3D (addr - R_PERCORE_ISR(0)) / 8; p->per_core_isr[core] =3D value; goto out; } --=20 2.26.2