From nobody Tue Nov 18 04:25:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) client-ip=209.85.221.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890890; cv=none; d=zohomail.com; s=zohoarc; b=MAlStKWAMblcgS+xRzzwjM2kctLKTMX8yVucdkc4JbWXzYKOUPWnlPHJ3owP9FacN2h8tMRGi+GFkfYKqPC0N6VFbLA9IXe2E7DM14LW61RP8+Xt/eQShCCUDvoZwpKFIhwBKz4I+tx1jpdJ2Z7l6fkdlNdYzeHX3pkFciEnPhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890890; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lPfxuHaLxE9K8aKuTGSCmD6sK9ifyAYTxEpcM22e690=; b=n7ZpNas0IDk8MiLSIyfyz2XT6krRVr2/TIlkZWgenrOUkZPyIJ1JyfpUyw/ypByVcmYHFVFP7RHWbOlw6TUNe8eIQ/cQUBRwk51bEDhwOYOymg2vRM9M7kMhLkE0BKXemmvefB9o76nttv04i1tdOSPYEVqpzUV7Wj1EINDk8Ic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.zohomail.com with SMTPS id 1607890890361910.398315543552; Sun, 13 Dec 2020 12:21:30 -0800 (PST) Received: by mail-wr1-f45.google.com with SMTP id t16so14389577wra.3 for ; Sun, 13 Dec 2020 12:21:29 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id n9sm10368160wrq.41.2020.12.13.12.21.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lPfxuHaLxE9K8aKuTGSCmD6sK9ifyAYTxEpcM22e690=; b=Pr5IDJIIy1ec3blHYUhCbSak/f0RziqCIK5su9y046d1yiq063geeiaEQ9A/rOHqS1 YmXuZzav6vN5pAW+dNS9A6Lzm6NRFhk14UjAiKtbRPB0HT9O4oNODBBqXYvGT/IlzOrB jVtgM/lfkqcO/VNBCClpJZ6wRdH8eSVV36SI01vXijcQuriWNC9GMhIadVKr9TDAokcY ztO950eYWGI71rpLGbfq90p5IItiBoWufekxIvGfkSJnLTQwAUjFvgRKQCl9EhM0Kfux v3zalJvNAiSLoG5rxye32lCy3OLpmlY2Gm4I/Rn0H6Ne/scVsZg72O4oYS3QGFe6bDuc 8eKQ== 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=lPfxuHaLxE9K8aKuTGSCmD6sK9ifyAYTxEpcM22e690=; b=AwoH9WTR6Zopl6QvpU4jtq9+vZEzzwijRorwe82MJx+IBEGlEjjvglK4cgUzqrke6t Uh2QrYTHPFV2QfWlPXp13aeQIxkRqFF8PIt6d8qqMAVsPzLBtX+gNu1I+2NuVSV+DWQi yD4Tx9UpqJctfJNhXlOAY/A75W4vtF/gwuWPhKEtYVcSUPvbc9fxIVyhtZ0cRBwX/4Cg LnyTJqnGzgWbEdKRbkzv5TqPHyxhtLirdIMxCTupSftbV/OErZaVivd/LTboYVpf/dUh wEl6NYE9kvtI34W5OEktdFBXwt322nUwCHDsr0sklyTv9Q7qUFrYKQWaKbxslEvtur2N U7dQ== X-Gm-Message-State: AOAM5311i6/xMgG21lysxy68XDsbvSVc/MwvcKyu+FgN5s8p4bUJxt4o HR9FEVJpuZVFO06Ptqf2/Xw= X-Google-Smtp-Source: ABdhPJykEIfb+pgpzd8TM3ktlEuSMEG2GBmsebeicQwa/ZyOg087Gw/0IqJ5Ecv/dMNq7lQ3IwomKg== X-Received: by 2002:a05:6000:10c4:: with SMTP id b4mr25926230wrx.170.1607890888569; Sun, 13 Dec 2020 12:21:28 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Aurelien Jarno , Aleksandar Rikalo , kvm@vger.kernel.org, Jiaxun Yang , Huacai Chen , Paul Burton , Richard Henderson Subject: [PULL 20/26] hw/mips/malta: Rewrite CP0_MVPConf0 access using deposit() Date: Sun, 13 Dec 2020 21:19:40 +0100 Message-Id: <20201213201946.236123-21-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201213201946.236123-1-f4bug@amsat.org> References: <20201213201946.236123-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) PTC field has 8 bits, PVPE has 4. We plan to use the "hw/registerfields.h" API with MIPS CPU definitions (target/mips/cpu.h). Meanwhile we use magic 8 and 4. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201204222622.2743175-6-f4bug@amsat.org> --- hw/mips/malta.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index f06cb90a44a..366f4fdfcde 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -24,6 +24,7 @@ =20 #include "qemu/osdep.h" #include "qemu/units.h" +#include "qemu/bitops.h" #include "qemu-common.h" #include "qemu/datadir.h" #include "cpu.h" @@ -1136,8 +1137,11 @@ static void malta_mips_config(MIPSCPU *cpu) CPUState *cs =3D CPU(cpu); =20 if (ase_mt_available(env)) { - env->mvp->CP0_MVPConf0 |=3D ((smp_cpus - 1) << CP0MVPC0_PVPE) | - ((smp_cpus * cs->nr_threads - 1) << CP0MVPC0_PTC); + env->mvp->CP0_MVPConf0 =3D deposit32(env->mvp->CP0_MVPConf0, + CP0MVPC0_PTC, 8, + smp_cpus * cs->nr_threads - 1); + env->mvp->CP0_MVPConf0 =3D deposit32(env->mvp->CP0_MVPConf0, + CP0MVPC0_PVPE, 4, smp_cpus - 1); } } =20 --=20 2.26.2