From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) client-ip=209.85.128.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890795; cv=none; d=zohomail.com; s=zohoarc; b=O7gKrLczCJKdiKK5hSl0bROAYCqSBlhE5HfpragTM5MfpxXWinkXuCR+hSGuq92LZauuvCIv10HeAZ7xAQ49+09GrwUYMEXovEy16GjA9rHg1l+0EHltQmkqOef10PjPAO+3lS7hIOuCD5RBThGZGh4I+wPXypcmzVmDupx7alo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890795; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h+0f4MZSwT7Z4ULpAMMMf+Y2JWijk+gFO9yAfDJUPRo=; b=D0CBFKRjsHZRRbtEywYXg7/gXPmWw15wDkwUnHFeX0YJbexj5hl3GdaaU39C8jE6JfVwrfNMMGfpI4H5S2mCF7CHOOWbg7UkppVlCQdjWbjT+aAhMdcbcTxfPbvk5P1OZFdJWYTSPpGBDBdo9IOaQqjqYOZZQwjD5poT9hlWqNQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.zohomail.com with SMTPS id 16078907957861007.9634190833442; Sun, 13 Dec 2020 12:19:55 -0800 (PST) Received: by mail-wm1-f46.google.com with SMTP id g25so7884791wmh.1 for ; Sun, 13 Dec 2020 12:19:55 -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 b4sm27219980wrr.30.2020.12.13.12.19.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:19:53 -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=h+0f4MZSwT7Z4ULpAMMMf+Y2JWijk+gFO9yAfDJUPRo=; b=UJMr2i9eDj/K0MVcCJ+eHoqUUGk/nd2qt7yFEqMack+wSX2s7WSSO6FxE+tCIP/Ys7 N1neLRDTRYdoM1prp+IqS1S/88Ms03F0CT9Z0sQCLxORgWu8ynoO/3J3Ivji5uFMuG84 25MsLPNiUWV7VedPd4IHFWPH5y0xuG1Ftc6OXkFi25B8PBoLKTF4TCU0pUWg+8Eip5cl avfscgy49AaE9FsWpQB6/I/IZ8O9Eal3JQYYMEXTpOlCsmZO7RZ3xKPAbhkFQoTQvmDI aFgPPqnGlHqso7eYh2r5Rsc93wLo2YYc3GDhQkfmQdo8dBh2gyGN5p4jRDoqiKNFgvWr 7WBA== 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=h+0f4MZSwT7Z4ULpAMMMf+Y2JWijk+gFO9yAfDJUPRo=; b=TTSt7Sm2gTWSKPaS6Ww8UtDJARsI0wUYuUNJnpmo5WMnkn3JeDc8fInmD5NS5PF9D3 wc8C4PKKnkVFEp9JPqWamDrLl+KipF/R8tu4WxWgPNLIF4rAPjYAlsPv8Qe+1fvEaWUX 6bHe1+36rzvnHzvaYr/xmyaS2DtL49K7tpa76xzaZ+kX/lK42r/OhyxKpXvNbzdHkWpI s/GpSx5TWdYSDielF6dQBSOy0dK6bEve1JpmQb6y9QECaxBdEAtarr6GYHqP1Qb0sa19 e7Ttcc9ZLIHzd4XczSgL/s7nzrD4tCrHLTh+64U5DtaVEx8J+w+R+P13XaUp8EzG7iFW 1TJA== X-Gm-Message-State: AOAM532EgtmeobJ97VzGZas6qL9NdUOTLgHra0e7KmmPAEypewEabmIp 4ODW3UCVwhZ4FN4UGmmrX4o= X-Google-Smtp-Source: ABdhPJyQGcPstFoF2k+UOL35hL2hnxGP87DnUYgX7saUmt1VArW5Q/W9u0DyNBvUw9DDWFHQkeJQJQ== X-Received: by 2002:a7b:cb84:: with SMTP id m4mr24472231wmi.157.1607890793929; Sun, 13 Dec 2020 12:19:53 -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 , Huacai Chen Subject: [PULL 01/26] MAINTAINERS: chenhc@lemote.com -> chenhuacai@kernel.org Date: Sun, 13 Dec 2020 21:19:21 +0100 Message-Id: <20201213201946.236123-2-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) From: Huacai Chen Use @kernel.org address as the main communications end point. Update the corresponding M-entries and .mailmap (for git shortlog translation). Signed-off-by: Huacai Chen Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <1607160121-9977-1-git-send-email-chenhuacai@kernel.org> --- .mailmap | 2 ++ MAINTAINERS | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.mailmap b/.mailmap index 663819fb017..a1bd659817d 100644 --- a/.mailmap +++ b/.mailmap @@ -49,6 +49,8 @@ Anthony Liguori Anthony Liguori <= aliguori@us.ibm.com> Filip Bozuta Frederic Konrad Greg Kurz +Huacai Chen +Huacai Chen James Hogan Leif Lindholm Radoslaw Biernacki diff --git a/MAINTAINERS b/MAINTAINERS index d48a4e8a8b7..d396c5943b6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -388,7 +388,7 @@ S: Maintained F: target/arm/kvm.c =20 MIPS KVM CPUs -M: Huacai Chen +M: Huacai Chen S: Odd Fixes F: target/mips/kvm.c =20 @@ -1149,7 +1149,7 @@ F: hw/mips/mipssim.c F: hw/net/mipsnet.c =20 Fuloong 2E -M: Huacai Chen +M: Huacai Chen M: Philippe Mathieu-Daud=C3=A9 R: Jiaxun Yang S: Odd Fixes @@ -1159,7 +1159,7 @@ F: hw/pci-host/bonito.c F: include/hw/isa/vt82c686.h =20 Loongson-3 virtual platforms -M: Huacai Chen +M: Huacai Chen R: Jiaxun Yang S: Maintained F: hw/intc/loongson_liointc.c @@ -2861,7 +2861,7 @@ F: disas/i386.c MIPS TCG target M: Philippe Mathieu-Daud=C3=A9 R: Aurelien Jarno -R: Huacai Chen +R: Huacai Chen R: Jiaxun Yang R: Aleksandar Rikalo S: Odd Fixes --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890800; cv=none; d=zohomail.com; s=zohoarc; b=hSbBBiDxDummmy4+NC2skW6v3+OzlNYzd+nkM69B+RkVSxhzknVT9o8ib9e1vTlVitKPQYjRPRLtZjJs1pUo5NR78ntC7bEgOCnYuOZ0MElbt3rACAAH7QFi51Z1dN8fdwn/taZ4wnZgCnD36hNPhRGTkAGdJDBH273eTs7foCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890800; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=39WDzgrzKw1HI9cbUqd/4nglotTqMx2ozVZiEV9EMeo=; b=T+wexw3yNr3HXTlAHlQ1aUsFicXxyTeJTJXZAfFWaTiJWSv6pCSZW3gugQkNpSTbd7VHwfkpmhgYotl/zZjRleFXdGFY4bkcLjsyKxjdZbqbTSnOvh1WuNN9L/yaxoBAuaMuED8F2RgSvzmcA5dbVwEVP7NJEuOA4pv69Eo1LRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1607890800726306.450242888817; Sun, 13 Dec 2020 12:20:00 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id k10so11955840wmi.3 for ; Sun, 13 Dec 2020 12:20:00 -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 h13sm28766022wrm.28.2020.12.13.12.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:19:58 -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=39WDzgrzKw1HI9cbUqd/4nglotTqMx2ozVZiEV9EMeo=; b=HNeZlXVtc7YfjiBul+Rccx5JKDxdpjacjieOOVNOFISfGRL06tM3qvroTYE1jrNqfZ QcQZ6KXhyY8ucZpcziHxytnf1cM0TZk40qOl4gCcD0ZGmVx58ssLywumZ+c9fOCHu7m/ PtVXnTWWnDmZapEKqWpEOAguvf/tkTkTOMpwnZ1vEYZpOk7KOwKwkrlIjfkj9yeg02XR 49rsclJmeSCajmC5NXGljEy7aevH63eryJL068edfTaKTGUOTDnQvoa1lBKogaNAcPjv ZoOTWDi0x/6iJHEro0xLrcAF7PruNCGo9iVGZ9vqukZaNKkNUCuThrGHNzuoYEjeGC7d vq9A== 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=39WDzgrzKw1HI9cbUqd/4nglotTqMx2ozVZiEV9EMeo=; b=HFXtzucyZRnnD5jh0BD92uchRlBWDFV4yRWslHSpRjaj5xkXYxrcptxS9d57vGTmpa 4jl+eBYjSjNGkv6no+kPHqpe6/FdihJOw4bhZS+fajvSw1h795p8vc/8Q5L5Ztehb/YM 7fTdb4wugXAQJK+Lc7qyFPgiIsEbfr/n/gL1nFHaBb2VZlp4kA+itnt/GnNQc2kadCTd gZs/4JFfdxSB4mMdq+o7f8xhySzWizIVfBjhJU/fm9EOx2q3LJAo1mpMxTp4dEcnW17/ Ultqh2Cu1xNeNbI6ReXsuQcMB9058mC0aqJJB9fMc6nnYME6V36v4hyX/A4QlCj5Ccmw LT1A== X-Gm-Message-State: AOAM5335P3ISnHPk2CUaLSiRJLlgNaL3LR7Q2LnLhbvYOzpsh//OD7Fq 75rVBuxWtWaM263FQ9dTLT8= X-Google-Smtp-Source: ABdhPJwOC+VH1ItUocY5MR5+0dEvvtca8Eo/rZUkwGTsvktz0B4ZV7qWU/u1sqZ4Y1ulDcTps9maWw== X-Received: by 2002:a05:600c:224b:: with SMTP id a11mr24308206wmm.97.1607890798961; Sun, 13 Dec 2020 12:19:58 -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 , Huacai Chen Subject: [PULL 02/26] target/mips/kvm: Assert unreachable code is not used Date: Sun, 13 Dec 2020 21:19:22 +0100 Message-Id: <20201213201946.236123-3-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) This code must not be used outside of KVM. Abort if it is. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Huacai Chen Acked-by: Paolo Bonzini Message-Id: <20200429082916.10669-3-f4bug@amsat.org> --- target/mips/kvm.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 72637a1e021..cbd0cb8faa4 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -198,9 +198,7 @@ int kvm_mips_set_interrupt(MIPSCPU *cpu, int irq, int l= evel) CPUState *cs =3D CPU(cpu); struct kvm_mips_interrupt intr; =20 - if (!kvm_enabled()) { - return 0; - } + assert(kvm_enabled()); =20 intr.cpu =3D -1; =20 @@ -221,9 +219,7 @@ int kvm_mips_set_ipi_interrupt(MIPSCPU *cpu, int irq, i= nt level) CPUState *dest_cs =3D CPU(cpu); struct kvm_mips_interrupt intr; =20 - if (!kvm_enabled()) { - return 0; - } + assert(kvm_enabled()); =20 intr.cpu =3D dest_cs->cpu_index; =20 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890805; cv=none; d=zohomail.com; s=zohoarc; b=cB9lXFJYy6iN0dTSo/d6tbzKO0jjS5+xwM+dWvCTZGvKANSURdL6W5Wt9w3YKs2o184KBEieC4SdYQGfHzmw1j0dGhTEePFv7azFKGmctOku0YLTQ8oMXyUjrqZk2FC0V2IvO1h2I8Zc010CFKlCVRXkErNdlALi/9Xy2waZXyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890805; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vNFKJu+n4IZ/CMsPrcMiCbRPKxOJx+sfVgOoT8DzTzM=; b=fcHRRa4U3jz2Qf+2+T4jeM7+0Jc+VsoVXOw5gmPwvV7eRyDkF5gHwn2FV6ScqESsonofMBJ/Ou4y/cjBe/B+s72j7bzEkfg41JjQIYAgJwsRKTGs5Y4N0ou+FW7bkIuAankxAa8JaYl/0biiqdonOIl87lYXr9SoIWtyLl5jQL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1607890805651355.3116832494568; Sun, 13 Dec 2020 12:20:05 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id c5so10753867wrp.6 for ; Sun, 13 Dec 2020 12:20:05 -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 d9sm29807500wrc.87.2020.12.13.12.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:03 -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=vNFKJu+n4IZ/CMsPrcMiCbRPKxOJx+sfVgOoT8DzTzM=; b=CyOXhXqwoUkfAHoDJ5+Gr9Hbrb+VgeWX8hIQ/FNHc3Hb7BLFVqGC3+E3dFjW5fWpK2 NRW34VR85opUiAoszJTDQUgchzByaZeYWoCmzg/UHX6imyHI2CIfws6UhWbrpp2JG8lN DTVs8W9OoeRiDkStjIGXi9phFLw/ahtRXN4O9fCNObwvwM05BNrZu7grhxs5ZqHpc1I9 kHi5SMU83DA3eaCC9teGDk+Fi5d2G7J9SdtY2nH5Igv9F1sfBYmzRaWoSXFaoftMVp9w XALx4Whce6OghuL7VrmTJH8frRaQ09eyU3UiJAn+ft+nb1E2OQE++y9J76PKMuPOPpEw 2Uew== 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=vNFKJu+n4IZ/CMsPrcMiCbRPKxOJx+sfVgOoT8DzTzM=; b=BqM3jZOhbAIQ8Ej7h7UCX12dEh9xIulfGreOaHbgELYQRQIESIuRKwQZ+V4c4YodxC pcgNAWUzwnao92OLLv8YUX4g1PtFiB+Ywd6eS6gfKV6vh9LbtwoZaLzW8tS9mv35dnJW MG3PgSTrcsTuRYtnd6rLaa1SUXGlGFV0ts+uHsLkfbdCzBNWavMIZlyGpO9ENBazDE4U RFlISFCbjDSYV/hlrCpOsdTWkzJAFAW02P0LZAWf22rfRmuic2TMZaglg+M67mn/bdV7 ORte3ReZYnJaFWXc/ek7rcOW2A+fxnUZJ5Gehh+aDHMhOpKIk8gJWgtFdxbWQvirsi1/ znHQ== X-Gm-Message-State: AOAM533hYv74cwV84z8ZqpUeuGpHDFQOyeScnXH+kTkNAWDUefxcp8J2 WoSpUTzmEAhBS9rASpRGfaM= X-Google-Smtp-Source: ABdhPJw3B2k1CxOd1n/33Sb1EtYQBldcALPKmiH+xNbh4q3vPykzdo6PwXeiPFYLzDkgmyv3WTcvCw== X-Received: by 2002:a5d:4242:: with SMTP id s2mr25494476wrr.187.1607890803857; Sun, 13 Dec 2020 12:20:03 -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 03/26] target/mips/kvm: Remove unused headers Date: Sun, 13 Dec 2020 21:19:23 +0100 Message-Id: <20201213201946.236123-4-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-7-f4bug@amsat.org> --- target/mips/kvm.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/mips/kvm.c b/target/mips/kvm.c index cbd0cb8faa4..94b3a88d8f8 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -19,11 +19,9 @@ #include "internal.h" #include "qemu/error-report.h" #include "qemu/main-loop.h" -#include "qemu/timer.h" #include "sysemu/kvm.h" #include "sysemu/kvm_int.h" #include "sysemu/runstate.h" -#include "sysemu/cpus.h" #include "kvm_mips.h" #include "exec/memattrs.h" #include "hw/boards.h" --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890810; cv=none; d=zohomail.com; s=zohoarc; b=RmP0UaC1vBFD/JxzdRf+DXcSFrt5ZD3yH+W8o2Hp9QaMosoqEoENqMPejaqDv0Vtf1Jwz/K0mdmrdp5vMCSSl2tzb/ejoB9OZZCu47SKAW1hYywOi3vE61Hx3ss5Z/WfF2Zr2jkqx28cwzpaQdSPcSWEjkyT/t2azQA25dadLVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890810; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h9xJIRQyKnane3GYzE3+NuQLJbx63PUZ7Fm8rhK2xB8=; b=G0ivlG5cvTWQmg3mvBsQSL+lMKE0tTTwcoLafA2+OgthKMuMRB3tkzVo/4wvC9h5djZNAJ2pu3DujYLMBzajo4cbVle8fsBRjgYru4f6h7H3fmZ4XJB0LObsXKGewBFCKrb3W8rxhSS2/FTIJjwEmPMwtX8zjaACGgBuqtxBg8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 1607890810634815.604055820744; Sun, 13 Dec 2020 12:20:10 -0800 (PST) Received: by mail-wr1-f44.google.com with SMTP id w5so10654916wrm.11 for ; Sun, 13 Dec 2020 12:20:10 -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 w189sm15877043wmg.31.2020.12.13.12.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:08 -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=h9xJIRQyKnane3GYzE3+NuQLJbx63PUZ7Fm8rhK2xB8=; b=mbgZQSGvTX3mqzqH4M6D4PcWZL78hL4Wie0tg103QQUUWktW0cmRGQYR0h7V3slQhg t4gSMQ34Q5A54o0Y1Sa7R7MGoucJqp3Q0Us+rViwnYoy08Q/6oLfcMz0cdEkMESRDLRr Pi8LEeMxrAFFcLQoiRffdL7iBoiQ/mR2Dzj7OwnN+lylVIQ42+5OjzgEPKLsgfYebJJu HihK+fShS3Ky+qibhLQDYRXvfHcg3/ibMXrTXJWu5fXCMu3lLORDVMWeiJK9Sw1coYqp i+kYxZP+dhrTFNcy+GQGtkLBuIULoYdwIAI0mI2UoaytcdImai1YpdGbLcLvVZ4xDrrh X4/w== 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=h9xJIRQyKnane3GYzE3+NuQLJbx63PUZ7Fm8rhK2xB8=; b=EevbCfL6ytkproxaFel+S+BPVso/p35pDZLqIOms2Fk7uYwcTLwUcZ2IQwvPNSVJBV 2bzVgfvspipiv5tAPulWkMEmZuZUVHAtbNVP6VlCDyo1ov16GG3hup2vbJmCal9H6BRw h5oAgsjyTe8tx1bYnWzt1GJIymWSpMbcpcyFyRdrFhWj4F/hwV3it8I4CxPAFx/fMwqX 79a/RXFjQ3/q9lBpeVhBhZxjrNPppdN9qEgNmY6LQVEywyLwl9uOQn1G/Z1mONm6Ix1j 9yV2qCjaRs3E7xFJoQwy6ixIah41mS+Zax+kdtIUtLlcHt7V+5DkF+3Dg4RZMxnhW54t 6FtA== X-Gm-Message-State: AOAM531Oy35ZQKv99NF7KWXZvkU2nHkIbze9NKEulEexss1QQB+RgKeO d7yTlefgZCtd9zADQph8E9w= X-Google-Smtp-Source: ABdhPJyhMywD88l8pOLmlXDRQKN769S3On8PU2OFuV79N9zVGRbpyseC8eMUVxtOcr1kWIil4eIZuw== X-Received: by 2002:adf:d18a:: with SMTP id v10mr25231575wrc.273.1607890808840; Sun, 13 Dec 2020 12:20:08 -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 04/26] target/mips: Include "exec/memattrs.h" in 'internal.h' Date: Sun, 13 Dec 2020 21:19:24 +0100 Message-Id: <20201213201946.236123-5-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) mips_cpu_do_transaction_failed() requires MemTxAttrs and MemTxResult declarations. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-8-f4bug@amsat.org> --- target/mips/internal.h | 1 + target/mips/kvm.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index dd8a7809b64..76b7a85cbb3 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -8,6 +8,7 @@ #ifndef MIPS_INTERNAL_H #define MIPS_INTERNAL_H =20 +#include "exec/memattrs.h" #include "fpu/softfloat-helpers.h" =20 /* diff --git a/target/mips/kvm.c b/target/mips/kvm.c index 94b3a88d8f8..477692566a4 100644 --- a/target/mips/kvm.c +++ b/target/mips/kvm.c @@ -23,7 +23,6 @@ #include "sysemu/kvm_int.h" #include "sysemu/runstate.h" #include "kvm_mips.h" -#include "exec/memattrs.h" #include "hw/boards.h" =20 #define DEBUG_KVM 0 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) client-ip=209.85.128.51; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f51.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890815; cv=none; d=zohomail.com; s=zohoarc; b=bifcao/5u/ecetzpDa0jCSzP6/Jr5UTDbU/WCydt7pYWqa2APxP1GQkvELA723JPvtMHGriUdxz30GjkIEuwvjwjylAXOSU75HNFEJaWJcIk1Ss7RaJ/qehdSMm/JJvVoC8ONJ+iK/+RKJWduM3joPG9zOWD1YwNGt1kIew0CeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890815; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2ISNCVzJYbaoq1vI61by2IBAkaqbdNie7OHgVDeXnbA=; b=lOyGzPwXt4OfS5aFH8xHhRqN2W77XeYceBBFQNxRNGj4y2FyG9pwIXBwEsE2gV7wiU1D0KV36K5/tHQigTHBjrjzFfjW/2LwWn3oFn2B1jacPwC49dqKnc6+4tZ3bv/8/7bFW6KOxTNVr1jGX5KjQpYS9eSN62c7m1/uz4mH+7A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.51 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by mx.zohomail.com with SMTPS id 1607890815738587.793118693284; Sun, 13 Dec 2020 12:20:15 -0800 (PST) Received: by mail-wm1-f51.google.com with SMTP id 190so1719939wmz.0 for ; Sun, 13 Dec 2020 12:20:15 -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 l8sm20448668wrb.73.2020.12.13.12.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:13 -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=2ISNCVzJYbaoq1vI61by2IBAkaqbdNie7OHgVDeXnbA=; b=QnkMcMiqG8UVyDMMuGRox71t7T+UqZBUKvKswBUB2KOeED01VBfl1gTqc5svpwe1CC rgudl0VE4QS0bigb8esLT9df+NjBOsWyrZfVj+qQPS449oSmXo9w2OybNxuwdEVbGcnf 9OZMrO0pd1dU/wYb+ybwrpJ0agz5ct4pj1VARipaQZi2eWaE2lDbgFBkJv4TXxPQ73ds n3sXcx4L7PddPgiwLLwSksoL8J28lLeRaYWBl/pcU7PRnZTDyVwPmI//BYk9vZdt7FsQ HwBqSaqbkszXuQTYtepR5kp0AgKMRup1qCrXkbc0/S+7Kkax0P9mPw/pOaLd5c2R2Ccw wprA== 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=2ISNCVzJYbaoq1vI61by2IBAkaqbdNie7OHgVDeXnbA=; b=WTDk1QqzmGAdaP/BAqMfjn0UeWUo/yqLjEVGvEHu2igVb357H+5/+lEqtyg9sFX5C9 wR92LFwsvSuY+LFp/2V0Jv2GK3r13xjnaSq+BIpDlTj657U//6fq/1n32QK6NufB+kKn ufztLMV+QxZtaMov3I0xC0cXN4p1P+SxfS+Q096nZgTB1FLtrXny871RrsQX+qG1C7qG FOt1hDZPbvn7E0yG/LVMJrrx/+ygdnuhX0WgO3yvnBOLyTFIEzbojQO8T7RVwzd0flhw DAPA5OvRz1Pnteg+4ol0xhG15yTvuG9JsVX4SuYBR7PIwJEJ8JX7ggBbii61PKHdlj6A YOBQ== X-Gm-Message-State: AOAM5322YFi8PYF1qByH3YKyEXzRtw2x9o6yExmv+TH+pOo28BfQIEWv sdK0SbAo84xixzmarI1SdQc= X-Google-Smtp-Source: ABdhPJw2ev9B7VvAvmY2StzAj4Kxo6/UL0BE2A2EbJKABhbhMiX+nTwfhVj5Xh5TwXp8OPQeLmPEsw== X-Received: by 2002:a1c:2b46:: with SMTP id r67mr24316116wmr.162.1607890813972; Sun, 13 Dec 2020 12:20:13 -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 , Huacai Chen Subject: [PULL 05/26] target/mips: Replace magic values by CP0PM_MASK or TARGET_PAGE_BITS_MIN Date: Sun, 13 Dec 2020 21:19:25 +0100 Message-Id: <20201213201946.236123-6-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) Replace magic values related to page size: 12 -> TARGET_PAGE_BITS_MIN 13 -> CP0PM_MASK Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Huacai Chen Message-Id: <20201109090422.2445166-2-f4bug@amsat.org> --- target/mips/cp0_helper.c | 5 +++-- target/mips/helper.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index a1b5140ccaf..e8b9343ec9c 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -904,7 +904,7 @@ void update_pagemask(CPUMIPSState *env, target_ulong ar= g1, int32_t *pagemask) goto invalid; } /* We don't support VTLB entry smaller than target page */ - if ((maskbits + 12) < TARGET_PAGE_BITS) { + if ((maskbits + TARGET_PAGE_BITS_MIN) < TARGET_PAGE_BITS) { goto invalid; } env->CP0_PageMask =3D mask << CP0PM_MASK; @@ -913,7 +913,8 @@ void update_pagemask(CPUMIPSState *env, target_ulong ar= g1, int32_t *pagemask) =20 invalid: /* When invalid, set to default target page size. */ - env->CP0_PageMask =3D (~TARGET_PAGE_MASK >> 12) << CP0PM_MASK; + mask =3D (~TARGET_PAGE_MASK >> TARGET_PAGE_BITS_MIN); + env->CP0_PageMask =3D mask << CP0PM_MASK; } =20 void helper_mtc0_pagemask(CPUMIPSState *env, target_ulong arg1) diff --git a/target/mips/helper.c b/target/mips/helper.c index 063b65c0528..041432489d6 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -858,8 +858,8 @@ refill: break; } } - pw_pagemask =3D m >> 12; - update_pagemask(env, pw_pagemask << 13, &pw_pagemask); + pw_pagemask =3D m >> TARGET_PAGE_BITS_MIN; + update_pagemask(env, pw_pagemask << CP0PM_MASK, &pw_pagemask); pw_entryhi =3D (address & ~0x1fff) | (env->CP0_EntryHi & 0xFF); { target_ulong tmp_entryhi =3D env->CP0_EntryHi; --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) client-ip=209.85.221.47; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f47.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890820; cv=none; d=zohomail.com; s=zohoarc; b=CssE/kL/ET68EjyyGu4hCep2bPRtcE4ozdRewBno7sLBDO8lWo0NtlCB24EaBJbaEU1uceE+N64+mSZFN1qC0GeZ0O+sMEGIIMUYIUPF9IaUvp8F6HR60bhBlmgO1TWpXXDkb+8+W0zzJtkvTSyyV4WiVfj1OP8c/6NWr1LSnqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890820; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=s6etg05C/BF399R/sCtLPATOdY8AkUS5HEwSvbkWAQM=; b=W2gEZTGizTiDf8tf8PoUGGVQcm1yKJRTqwZUv9Jg4P8tYICvJCjSOy156AJBLk1vfKLYYaboNu5vgPPC4LoNhOb2XNa6uFSBKhJTrVopnKZB7kaz3WhSXhnLF79OqKMhLyzcTgLWu7KOg4Ugsj+s2Q/Oqlge7hKi5Y8/h6JaQwo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mx.zohomail.com with SMTPS id 1607890820696293.0128545063433; Sun, 13 Dec 2020 12:20:20 -0800 (PST) Received: by mail-wr1-f47.google.com with SMTP id i9so14390443wrc.4 for ; Sun, 13 Dec 2020 12:20:20 -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 x7sm19488199wmi.11.2020.12.13.12.20.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:18 -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=s6etg05C/BF399R/sCtLPATOdY8AkUS5HEwSvbkWAQM=; b=q4Prp5VDpN3rINMABx1tB5qHHGoJp9wExi3jL5uSHNsSREz9xmjlJpKgJLDEI0nRnb SEH5OLN2DDe1Uv+sCv4EFmTSzWAr62LWrJUCmGGhw4U/NciSZWU/xewdzor/2AQLvCA2 VK0sNiuweaJZ/Z66bF/qSabLa+jLFxy1NH9kJDRbtSwQ6/bVEhvBBclWGJhywWlaYLAm JA6mpkIMwqyOMXu9EO99W3KGya+i7RL/n9G2A59bifZZmi0I77DgpBuzLC4Inv6wsWwD YNzZKn82oQuaYqRuB55jAm80wN4awzHSd0CtpIwZn5en4Re0uwMungEGFH97Axt+iFji XXFw== 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=s6etg05C/BF399R/sCtLPATOdY8AkUS5HEwSvbkWAQM=; b=rHUxuVeVEdb2LVLNZCStDBAdIfn5G009RTUBvA/qZH6BUfC8WTs3nSpxrX7O0ootU2 +PS1NJFCKPAUL9C0OJzzez/sI2yzffrCdLSlq7doRY6SHNCYvDFyFCMKjFGb+pXb1ytB hf7+QYCQRqbz9v2E/NhXRTet6rlQp9xBpH63Mt1PNk7V+K/PjZwV+2t/5h4qWor/QdeQ De0+jtG2jOozqe2rxxnz9J+j32CkFilWTWkmt6e2ApzxxbyeVulRNYcJ16sbejnKmCsG ZvsKaD8ISNjkbWJheCHOw+49qGOX5TK1CsqD7r8SytYpo604m+O+pX3dbyjZPgPU4vm7 G4oQ== X-Gm-Message-State: AOAM5308m1Lc2UXOepj/VYSPY1GAdW3D0qJgWfC+A5sS9TcaKsgEROy5 Li3lMcQFLZ06+kVLiEtrdL4= X-Google-Smtp-Source: ABdhPJyZsyojoo5AMZgAvYJyhWWykvGk9uZc61cVzGwJ7TbpydQtRq7kaBJdz/R8v4Gzu5uT0JKT6A== X-Received: by 2002:adf:ded1:: with SMTP id i17mr23100083wrn.190.1607890818932; Sun, 13 Dec 2020 12:20:18 -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 , Huacai Chen Subject: [PULL 06/26] target/mips: Do not include CP0 helpers in user-mode emulation Date: Sun, 13 Dec 2020 21:19:26 +0100 Message-Id: <20201213201946.236123-7-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) CP0 helpers are restricted to system-mode emulation. Do not intent do build cp0_helper.c in user-mode (this allows to simplify some #ifdef'ry). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Huacai Chen Message-Id: <20201109090422.2445166-3-f4bug@amsat.org> --- target/mips/cp0_helper.c | 4 ---- target/mips/meson.build | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index e8b9343ec9c..caaaefcc8ad 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -32,7 +32,6 @@ #include "sysemu/kvm.h" =20 =20 -#ifndef CONFIG_USER_ONLY /* SMP helpers. */ static bool mips_vpe_is_wfi(MIPSCPU *c) { @@ -1667,10 +1666,8 @@ target_ulong helper_evpe(CPUMIPSState *env) } return prev; } -#endif /* !CONFIG_USER_ONLY */ =20 /* R6 Multi-threading */ -#ifndef CONFIG_USER_ONLY target_ulong helper_dvp(CPUMIPSState *env) { CPUState *other_cs =3D first_cpu; @@ -1709,4 +1706,3 @@ target_ulong helper_evp(CPUMIPSState *env) } return prev; } -#endif /* !CONFIG_USER_ONLY */ diff --git a/target/mips/meson.build b/target/mips/meson.build index fa1f024e782..681a5524c0e 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -1,6 +1,5 @@ mips_ss =3D ss.source_set() mips_ss.add(files( - 'cp0_helper.c', 'cpu.c', 'dsp_helper.c', 'fpu_helper.c', @@ -15,6 +14,7 @@ =20 mips_softmmu_ss =3D ss.source_set() mips_softmmu_ss.add(files( + 'cp0_helper.c', 'cp0_timer.c', 'machine.c', 'mips-semi.c', --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) client-ip=209.85.221.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890825; cv=none; d=zohomail.com; s=zohoarc; b=QnsiUl/x2zmQJLUV58q9bYD271U60whxD/tHlFW7Pu808/E0ix9MivdvDZ6PszuYc4vnyxxnRAvsnF/ioAUCOBB0b0XJMI010Xej2JZIgtK1eJxXZbOcD5/u7GaDvOAd9z6C7Nas28rXeDFLO3n1b9kd1Oto7RT/5nUnfIH9BE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890825; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ElGn7JwtMTMMU13LrhvDMbTZ+gVsyAEKbzwxbxdSXTQ=; b=jVxFc/FPDk48+DV+AqjcNIel0RI5VTBOVH07QQvQMS0lbeEaU54fG1ICeidL/9D1ht6tlt/3yKt4mLh2bSx8oq2RYAoGXESOQaeBK4Q6PglwIAutX/IQ069Hoa59g7P/l+CfjnJmDK7uwwFpQQ/Bcxyyg6jtDXUlApWgO/Gtu9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mx.zohomail.com with SMTPS id 1607890825695859.870160055839; Sun, 13 Dec 2020 12:20:25 -0800 (PST) Received: by mail-wr1-f43.google.com with SMTP id w5so10655339wrm.11 for ; Sun, 13 Dec 2020 12:20:25 -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 q17sm27617700wrr.53.2020.12.13.12.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:23 -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=ElGn7JwtMTMMU13LrhvDMbTZ+gVsyAEKbzwxbxdSXTQ=; b=r279oMzyuCA06s9efRNLeeAbvEmXQa8MM5wCrkN4z80SdfG4YW8i5qEoPXL3o3oJzi RmVwgMhKBr4cnlxAyCF1GV3mj4WeRSBTBlqhLnx+iO+4rrza/osaiircUIlMbzxNd3iK Cbwao2wMXofejyOGUVwrDa3Mf/5sK/dAsxP39CKyeGmdw4+1UtmB9pQuHKPBPFn9bSht 7zAg5Kaca5zsZLeJuvFC37lgO14GuwKCNbMWbpRowN04gx/ili7iU2l2H8mkWf8bmfS0 tq3lVJknSoW4EbcjJAJPadvtUseVOKUUdCQvD5ciCtG5101ztnGpoCG/dKyAxgwTlvjB lG/w== 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=ElGn7JwtMTMMU13LrhvDMbTZ+gVsyAEKbzwxbxdSXTQ=; b=Yjs/gJEOudDIuWQh0weTIHNYpZzAjFLLz7DLbgjM9a9CdqCVpvG7bDsRaoGIyJjxgT GXTIyfPxdseWzVwuSwDCgu01/EMiI7j1kH+QQvdkn2mCpWlPi9EDtl3wOcIkb7FtW6NK zP5ufw8vNWvRklKSF11FY72S0JReiVNbEg8M5LvCllAsVnjHQv16zus1WrSXmHHzi3cM gxE4UeJkZf/IeGR3ShnRoMbTyUuGKdQI20N6IuRBq0ZG0jDk6BGvHyz53j+qsGbq7akh 2iSwNjgndaUK2X5uXjUA2123LNgzhOSqRYrOUqL8tHQZf+czV7mRa3uyIX3sxeLBneGB vDRg== X-Gm-Message-State: AOAM530287pTIOwhKFlYv56jvY/rHNeQOKRCANp7os/KJhbl7jO98cia 8XuM6fZz1prxpG04er6XTUI= X-Google-Smtp-Source: ABdhPJyXLdF/7P0sm1YXBUTdja+xRF+QyOyW3QdtUpku/c3SnS6EaVS1ygEllhtb7X2nkTZzGO+ydg== X-Received: by 2002:a5d:4349:: with SMTP id u9mr24715442wrr.319.1607890823912; Sun, 13 Dec 2020 12:20:23 -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 07/26] target/mips: Remove unused headers from cp0_helper.c Date: Sun, 13 Dec 2020 21:19:27 +0100 Message-Id: <20201213201946.236123-8-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) Remove unused headers and add missing "qemu/log.h" since qemu_log() is called. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-5-f4bug@amsat.org> --- target/mips/cp0_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index caaaefcc8ad..cb899fe3d73 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -21,15 +21,13 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/log.h" #include "qemu/main-loop.h" #include "cpu.h" #include "internal.h" #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" -#include "exec/memop.h" -#include "sysemu/kvm.h" =20 =20 /* SMP helpers. */ --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890830; cv=none; d=zohomail.com; s=zohoarc; b=kyV0t5rinYbh80/+PIjV0AnU9QIg4X9fMAgufPdDitjbhom77OxDpK5nF8+LTjdevNYFlLPABfI8/Q5elWXQfXXBQ1a5hL7w8/McKXMpNcNnBKYU6haeyx3LNqT+tlaP9tB6ja4sFQQKcRNnHXpGFT7jLhxMlHwhampOmA3ab8E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890830; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WU7av211Gw3wbADY6XPgoCLNL0Q/6KDqRZlDd72LlCc=; b=D35sDwrEe+0ZGtdfRlc3B1q6uKWaOjsut2S4k4/eS/HpllayfkPSyltUqkMmI0G9V5Mb4yStUnhcx+SqI0lYHJZKgTej9R0Dva+QDVf5sTtDKh/zEHoO9rLyDei3tbVawjkKItqzmpxCKnhJ9P2fhIsILV4zkI2aVYrTH3LT1BE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1607890830606480.56956123668317; Sun, 13 Dec 2020 12:20:30 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id g25so7885504wmh.1 for ; Sun, 13 Dec 2020 12:20:30 -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 64sm28192537wmd.12.2020.12.13.12.20.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:28 -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=WU7av211Gw3wbADY6XPgoCLNL0Q/6KDqRZlDd72LlCc=; b=lg3Plv9yDZIf0oqfQcqIFKuS+fY1twqqoLWJGkP/0s5QmgX9g+AcAhlXe1vIXb4SkU u6+sEEol4i03yQAqE9FQXbu+uJeG4jQ718E7L+3h4cgjvP6xQ1yzqV14WzhsvaDrVG0P XTMhtyIG1mGkUbiZ7EkPa89KKSkfSi4+ZKW1Capz0GuBJr3TBqqMgLU9DJ5WgV3BQGZ+ CdCT70G6GNCe49e0Qzn/arC9q/YMgpkeOdC5fZdvpcze8suLyybPK+ZM84FYfw742Tk0 SrhkkMAjcR233PY95gVChi8+8HwmS3hTg9g4QhMLzpOsJw2UyGpoLsFgG/Ul6Ol8kqE4 8OqQ== 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=WU7av211Gw3wbADY6XPgoCLNL0Q/6KDqRZlDd72LlCc=; b=U1vtuTm4uR5MTcnDMgs7x77gH5xqJaYbDOXCTLUnj5gKogqPxivLvmlhSQX/wQGRE5 TqVo55LlcJFjl5Q13VeddYQ8IRjd3XYyeVbBZa3MuB1SqrIiVjCgGIN1+Y8ydRrKQROy wb7J3W1D3fYNY2y9nE1KeKezh3h325gFrGUSdwWAp0Xo3J9xrGzYjl+zuPivfng9jAMG Rs+cbLKkGpixO9aedA6Vwu/kuiEf9V2tzyQJ7mYK8TLumUnZGO2we5iWg0IKUrzQjejy W1aKrp/rwGEjrdb83qnU7an2y6HE/DUCZhxLnmHnlL0nCV6xS6y1setKnc5iMSXVfp2Q A8xw== X-Gm-Message-State: AOAM531Pxs+ESBTXe31H8b2AEsYTdLGLdKOzfYNtrY/pVsyRqT5F3462 EVuVtAFq724uWKqUyrDlSrrN/btnJm4= X-Google-Smtp-Source: ABdhPJwGswfU1INeuc5+Xpdh/7IEhKrZYuniVVNcdgaPCtjzp2Ttm7znjOhHTptaP+0DrvPGZdnyxQ== X-Received: by 2002:a1c:2182:: with SMTP id h124mr24378018wmh.25.1607890828851; Sun, 13 Dec 2020 12:20: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 08/26] target/mips: Also display exception names in user-mode Date: Sun, 13 Dec 2020 21:19:28 +0100 Message-Id: <20201213201946.236123-9-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) Currently MIPS exceptions are displayed as string in system-mode emulation, but as number in user-mode. Unify by extracting the current system-mode code as excp_name() and use that in user-mode. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201119160536.1980329-1-f4bug@amsat.org> --- target/mips/helper.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/target/mips/helper.c b/target/mips/helper.c index 041432489d6..59de58fcbc9 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -978,6 +978,7 @@ hwaddr cpu_mips_translate_address(CPUMIPSState *env, ta= rget_ulong address, return physical; } } +#endif /* !CONFIG_USER_ONLY */ =20 static const char * const excp_names[EXCP_LAST + 1] =3D { [EXCP_RESET] =3D "reset", @@ -1018,7 +1019,14 @@ static const char * const excp_names[EXCP_LAST + 1] = =3D { [EXCP_MSADIS] =3D "MSA disabled", [EXCP_MSAFPE] =3D "MSA floating point", }; -#endif + +static const char *mips_exception_name(int32_t exception) +{ + if (exception < 0 || exception > EXCP_LAST) { + return "unknown"; + } + return excp_names[exception]; +} =20 target_ulong exception_resume_pc(CPUMIPSState *env) { @@ -1091,19 +1099,13 @@ void mips_cpu_do_interrupt(CPUState *cs) bool update_badinstr =3D 0; target_ulong offset; int cause =3D -1; - const char *name; =20 if (qemu_loglevel_mask(CPU_LOG_INT) && cs->exception_index !=3D EXCP_EXT_INTERRUPT) { - if (cs->exception_index < 0 || cs->exception_index > EXCP_LAST) { - name =3D "unknown"; - } else { - name =3D excp_names[cs->exception_index]; - } - qemu_log("%s enter: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx " %s exception\n", - __func__, env->active_tc.PC, env->CP0_EPC, name); + __func__, env->active_tc.PC, env->CP0_EPC, + mips_exception_name(cs->exception_index)); } if (cs->exception_index =3D=3D EXCP_EXT_INTERRUPT && (env->hflags & MIPS_HFLAG_DM)) { @@ -1490,8 +1492,9 @@ void QEMU_NORETURN do_raise_exception_err(CPUMIPSStat= e *env, { CPUState *cs =3D env_cpu(env); =20 - qemu_log_mask(CPU_LOG_INT, "%s: %d %d\n", - __func__, exception, error_code); + qemu_log_mask(CPU_LOG_INT, "%s: %d (%s) %d\n", + __func__, exception, mips_exception_name(exception), + error_code); cs->exception_index =3D exception; env->error_code =3D error_code; =20 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) client-ip=209.85.128.65; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f65.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890835; cv=none; d=zohomail.com; s=zohoarc; b=Vy5f7MwJ8vA+leOUAqCu3EfD+H5iI7rKkxg9sUqsx42yyHjA7AX2m3IroDl7vs7D26CHYaK+ghAUtHMQhuza+D9l3jGDgVU8qbldTfGp1wENL3hD+Kq2lYYtCS6vvem//CJ62SfBxwIdPzLaODl3wOPuYjxeaomfmwt5N2iKnmQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890835; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SiRxwMOsvHMX7da84kOf25+ipqu85MeG7Znceh6cVl0=; b=aPn7th9cQ3zX/X1uJg7Y7SPnhsZkvhOJ3+xtjEwZc+eF1kzTL7a/b3qvYDmt/H8HOPEDkydlPEk6k/LDNqMGLeXI/oY0usTy0QLUryElqsM1TH3j2Fna/DxbR2Y4EBKxeAybex5RhIevx8VLEUgp6TfQ5Hmzi3NYZ7Wn/rhqwMU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.65 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.zohomail.com with SMTPS id 1607890835598399.57898659199464; Sun, 13 Dec 2020 12:20:35 -0800 (PST) Received: by mail-wm1-f65.google.com with SMTP id q75so13416358wme.2 for ; Sun, 13 Dec 2020 12:20:35 -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 w3sm27387242wma.3.2020.12.13.12.20.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:33 -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=SiRxwMOsvHMX7da84kOf25+ipqu85MeG7Znceh6cVl0=; b=KsQv3qbOe+LI/cP5EbRVc/SVzgzrUF2ZAG/DrKk9RxDzkO0u6E03MnxQWFY+mGEd9D /hvwr8carDz8ZIbGZ+BIEDf5/jGNRzqNUIkp0H8jOyVxRKJh068pHSaZlm6rLALMF4fo pq6k7mFzjPpMPDe5j73MXeYWB8PQ/ceA/TP8EctzpGirpk+N0nD9ZDZ08IsLJ/gendvX 7VczUnp/wZk8oQU9W5qWER5e//1av8L5t+znrnIBpuCNRkR+PFBpPERulsbIWmY6ZvTj Ld0VBislp5Cwde6JQiZ0cub52eYHa7l27ShjMOwudC2wbeHIraeP6bg2JoTS568jpp2x TvsA== 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=SiRxwMOsvHMX7da84kOf25+ipqu85MeG7Znceh6cVl0=; b=Rk2PDXjsBkylWoVN06nko84+W8EzlRLxtXYZA/0DtUzxbLNU1Z7/+d9TRRWk+W3QvP NRrqnwFJUkTVeXmcDlNSo86axm2ZsUIPrvjgUUXKplf2nz4zXff7M5D2Ry7YQQEtDsXr 7piDTupuUjokeZ9TWGunPjYBjRvzD7y0KVx0E90dXJgncjPd3MtyOAOz54kGTaJWOKJb 2CKgJIFhpIFCcC4MxIH3jKqj3Wxp5RDJxNEDIhNSc/QTW0rI70XMrVL5V6McdaoM/skd HA7lU5dQG/wx7+I40iyEz7YKJX50qJv0AL4coy8wb5VOHoh3B/hhZzYotEE3cs7IoTKS p72A== X-Gm-Message-State: AOAM531ZATLcnwIi16ByuEgfzAHAvKjIRDtTbt2GkuV2PRyNdz9Tg9Yb dsdOghP8MOpXkO7oBkSWjBA= X-Google-Smtp-Source: ABdhPJxDuA+DFk/Zc3/I9RhXui88zg7XTIi8CvF9r8p0+haLdCa3xW3ioiFyX+skKOBc1htwpOepaw== X-Received: by 2002:a1c:b657:: with SMTP id g84mr24544929wmf.181.1607890833832; Sun, 13 Dec 2020 12:20:33 -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 , Huacai Chen Subject: [PULL 09/26] target/mips: Allow executing MSA instructions on Loongson-3A4000 Date: Sun, 13 Dec 2020 21:19:29 +0100 Message-Id: <20201213201946.236123-10-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) The Loongson-3A4000 is a GS464V-based processor with MIPS MSA ASE: https://www.mail-archive.com/qemu-devel@nongnu.org/msg763059.html Commit af868995e1b correctly set the 'MSA present' bit of Config3 register, but forgot to allow the MSA instructions decoding in insn_flags, so executing them triggers a 'Reserved Instruction'. Fix by adding the ASE_MSA mask to insn_flags. Fixes: af868995e1b ("target/mips: Add Loongson-3 CPU definition") Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Reviewed-by: Huacai Chen Message-Id: <20201130102228.2395100-1-f4bug@amsat.org> --- target/mips/translate_init.c.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/translate_init.c.inc b/target/mips/translate_init.= c.inc index ea85d5c6a79..79f75ed863c 100644 --- a/target/mips/translate_init.c.inc +++ b/target/mips/translate_init.c.inc @@ -832,7 +832,7 @@ const mips_def_t mips_defs[] =3D .mmu_type =3D MMU_TYPE_R4000, }, { - .name =3D "Loongson-3A4000", + .name =3D "Loongson-3A4000", /* GS464V-based */ .CP0_PRid =3D 0x14C000, /* 64KB I-cache and d-cache. 4 way with 32 bit cache line size. */ .CP0_Config0 =3D MIPS_CONFIG0 | (0x1 << CP0C0_AR) | (0x2 << CP0C0_= AT) | @@ -885,7 +885,7 @@ const mips_def_t mips_defs[] =3D .CP1_fcr31_rw_bitmask =3D 0xFF83FFFF, .SEGBITS =3D 48, .PABITS =3D 48, - .insn_flags =3D CPU_LOONGSON3A, + .insn_flags =3D CPU_LOONGSON3A | ASE_MSA, .mmu_type =3D MMU_TYPE_R4000, }, { --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) client-ip=209.85.128.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890840; cv=none; d=zohomail.com; s=zohoarc; b=Iv4IXqtWyjIGzQydsXl+iKhK5g+AeTQJuSCLMrkfpTBVFqm89jFeemzfz9DsszNw+UU+RFbWJtH/LMdJO8FVs43Uz5Je3DtxQ4jxvavtj3EDK3Z4TtmAm7RZ5q/FAz6GsFFBLztosMen5VwekHUb6BQ2zV2cuX4OeLBlTg9m3DM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890840; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UKVyHTJcfnmphpZOlFQ3sK0TO5i59SQTbNG7ZpwIL2s=; b=FGo0wZFw/zit+dNPkpkDFNdhs8FP060BRL9B0NG1iD4esj/iJLENtHDMWzjQTv9aIGJXGpDl4v4sQJblAG21czhX00G2PXiXuXq/X8vXcsTifbVTs4hrh0IIbj/gSMUhcqJL+6v7dRczKudtS390vGS4lRwein4fHSHPceCVCWQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.zohomail.com with SMTPS id 1607890840443761.6022812590422; Sun, 13 Dec 2020 12:20:40 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id v14so11953236wml.1 for ; Sun, 13 Dec 2020 12:20:39 -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 r20sm28985853wrg.66.2020.12.13.12.20.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:38 -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=UKVyHTJcfnmphpZOlFQ3sK0TO5i59SQTbNG7ZpwIL2s=; b=Q2ksS/NIJwRo6OVacRh1D3+KqjRnj3fQkjk+RFruSjRTqsxfiGyG+2kd+xqRaPSyNn Og8GyaYIUtXhBQX+ZW1nfYS1ilo/N/MXh94szzfdIv4dta73ui2OpQFnEmnU3t/r+teV Tka2QbqFNDF+03VruDSDXm2EDY0TDxtdzQcGizbC803leH6tL1MOB8fNUmFcmB7n+bV4 N8yARhMJkKFDmnjPEv7kVWv0GVMvQAhDMqIa45YAM3Bwo7t5En2DVylczCrwAzDEA5Xl sIg9lVvazuHl6l7sJEEFsd8GbAJt4sB2QIEPGG9ZKAcN5ikpBAIkwDEfNdY7XCyoOr7v +I3A== 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=UKVyHTJcfnmphpZOlFQ3sK0TO5i59SQTbNG7ZpwIL2s=; b=V1Dui7PWQZ0WQ9fH3P1c/XjfwcP4DJ7zo5YtYVg/71E1N3SHyJzv2+xT91p9+j7OY9 m2r2ysDo1OPe8tptZk/0v1IYiTeMz/85eMStMv1cQk0VmI0ALz5qgxHLpM+Foxnog8FH xnfX4tIK773n3bvlOhTR4kqoPJM1Ak84uKf3Keh3T+bJHW+i2d/ZYtgKwTNinl0q9Ajn QHY1F2IqKCJ77To+t9v6y36uUdPmaS/7Ton0HGn1pocLHwROeot29YCgKn7lnfqBteBf bk19X2YH0YrYAvPO9exBp7o3aTgeIKlRh4BJVch6GmjD5ABSBI8fTwGpskjIxT4hI2nF WT8g== X-Gm-Message-State: AOAM531LgiDee/cOY14atw/Z0IT5B0d+wcqJ45TWiA3B7XZAcoYWkC8i fwiz1+fBYQy4d7u4u4SvGdWom7etnuk= X-Google-Smtp-Source: ABdhPJzgoE2qp8c/gtBc5k0f18CqNg5PxnMO3ehBmX6yeySByMtolXCKZoaCC8qZNyu+dyEmkIbmeA== X-Received: by 2002:a7b:c773:: with SMTP id x19mr23833930wmk.127.1607890838712; Sun, 13 Dec 2020 12:20:38 -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 10/26] target/mips: Explicit Release 6 MMU types Date: Sun, 13 Dec 2020 21:19:30 +0100 Message-Id: <20201213201946.236123-11-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) As of Release 6, MMU type 4 is assigned to "Dual Variable-Page-Size and Fixed-Page-Size TLBs" and type 2 to "Block Address Translation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201201132817.2863301-4-f4bug@amsat.org> --- target/mips/internal.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 76b7a85cbb3..bcd3d857ab6 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -16,10 +16,11 @@ * CP0C0_MT field. */ enum mips_mmu_types { - MMU_TYPE_NONE, - MMU_TYPE_R4000, - MMU_TYPE_RESERVED, - MMU_TYPE_FMT, + MMU_TYPE_NONE =3D 0, + MMU_TYPE_R4000 =3D 1, /* Standard TLB */ + MMU_TYPE_BAT =3D 2, /* Block Address Translation */ + MMU_TYPE_FMT =3D 3, /* Fixed Mapping */ + MMU_TYPE_DVF =3D 4, /* Dual VTLB and FTLB */ MMU_TYPE_R3000, MMU_TYPE_R6000, MMU_TYPE_R8000 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) client-ip=209.85.221.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890845; cv=none; d=zohomail.com; s=zohoarc; b=jPlIbWGFnl+BxKdgewQULRl01CinD6gUp25JUgQ27zd9RuMItEO/g7D8ue8Cr3zwxzkH2jnE6y//V0ILpRCgJJstEz85objk/ESVTqD/xczIvjDW/nKpk+u5+2qf6V+PF4QIzxkPbYQ7hJSrKoC408P9+Y6Z3e4j1AKWnwG4obU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890845; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cgaHXNW/5WgtwEvWMUgAxy7itdnx69iC1c/ZHbcmFvM=; b=iR86UcuLZFR4Ru6ytTk2YW32c7GRWtJgj2ZJFIKPhKi5eZlNjoEhnR3MTXPJDWvoGSlGIMwTaVLi5H04UVsVLtXOR6cV2ubV5ywp2PgC2Trx9/7bxXQAPN/XZYPaBVomBCzMK4NZWrstS6ZS9jcPaC7F4a+5xDR/36B0UofNbts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.zohomail.com with SMTPS id 1607890845721114.29151912083239; Sun, 13 Dec 2020 12:20:45 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id t16so14388355wra.3 for ; Sun, 13 Dec 2020 12:20:45 -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 h13sm28768884wrm.28.2020.12.13.12.20.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:43 -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=cgaHXNW/5WgtwEvWMUgAxy7itdnx69iC1c/ZHbcmFvM=; b=uQYrE+2Qhcmp3WlwFdf+D5+FYcDpG6cFeMPXtrY0OjHRN54VDeyV4PYKH/fjkNOH9Q wVzi+zTFbAwfMhEeLrysDanA7Mn6Mn2C4DDp1HvOyjpdDoU4ASjaqqP9Qs24Lel8Cbxv mmNDIGN4fufjv6MdWjm7hfFh6ERPFyXQyvz90Cgu/eOfrsQt9OaWmrME9kyFMTOByKQS uTO11JZ01gOSC4kbMTGupYqPGQAbUyfxx+LV1WebPC+cKjZXaaxCKRIsmB1BhjpZWiy0 Wa8m/TJZIggopdrFRJw4oPlIfG3PA3fYFMNZQPEV9CjXXisBjwZFNqI2F3YR4NDw6izZ 6mGQ== 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=cgaHXNW/5WgtwEvWMUgAxy7itdnx69iC1c/ZHbcmFvM=; b=TSi5toaZH7Zmimy1Rbe7vj8DJmASppVe64vmHdRqC3qb5jwCCO8i8Gs2CnXSauEeQC xdDtMuSyJquPoAeQD1FKlxumdzKkhBjGnX6Ebu1XlWUBPZ8PjqlGfiFDb8SyKd6jAnMx wTpV266RjWaraVIll556xjjqSNQyAeGOu0ZyusMC19MGv5zW+eGqZBGB3DPPbrsiaYKR bUgJfg4DU0gFr3vsZZRdHga1Q7gaKI6LGpkKCii0H4j9yFQ80TbXNp13UpyujceDeeww RkgZU1OhR9AlJi7J+E+MhIYk0jJEI55HvttFwbPVFCM4mICvPtPjEBNRZ0S02oVedXCy L5fw== X-Gm-Message-State: AOAM532C4T+3pTQHEBvs3He5aMCZ3pmouHFFnKv2aF+17X07NE7roMNM qNOavAD5Zm7OHl0gj0AFIVE= X-Google-Smtp-Source: ABdhPJxi1HLf3FD13UfxWm0lJHdi9m9BmBMJoArKmNJDfLLV01NRhcTmbVSlznxIufmZF2k7WGlVfg== X-Received: by 2002:a5d:56c3:: with SMTP id m3mr8510854wrw.419.1607890843830; Sun, 13 Dec 2020 12:20:43 -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 11/26] target/mips: Rename cpu_supports_FEAT() as cpu_type_supports_FEAT() Date: Sun, 13 Dec 2020 21:19:31 +0100 Message-Id: <20201213201946.236123-12-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) As cpu_supports_isa() / cpu_supports_cps_smp() take a 'cpu_type' name argument, rename them cpu_type_supports_FEAT(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201207215257.4004222-2-f4bug@amsat.org> --- target/mips/cpu.h | 4 ++-- hw/mips/boston.c | 4 ++-- hw/mips/malta.c | 4 ++-- target/mips/translate.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 23f8c6f96cd..9c65c87bf99 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1286,8 +1286,8 @@ int cpu_mips_signal_handler(int host_signum, void *pi= nfo, void *puc); #define MIPS_CPU_TYPE_NAME(model) model MIPS_CPU_TYPE_SUFFIX #define CPU_RESOLVING_TYPE TYPE_MIPS_CPU =20 -bool cpu_supports_cps_smp(const char *cpu_type); -bool cpu_supports_isa(const char *cpu_type, uint64_t isa); +bool cpu_type_supports_cps_smp(const char *cpu_type); +bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa); void cpu_set_exception_base(int vp_index, target_ulong address); =20 /* mips_int.c */ diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 3d40867dc4c..16467ea4752 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -459,12 +459,12 @@ static void boston_mach_init(MachineState *machine) s =3D BOSTON(dev); s->mach =3D machine; =20 - if (!cpu_supports_cps_smp(machine->cpu_type)) { + if (!cpu_type_supports_cps_smp(machine->cpu_type)) { error_report("Boston requires CPUs which support CPS"); exit(1); } =20 - is_64b =3D cpu_supports_isa(machine->cpu_type, ISA_MIPS64); + is_64b =3D cpu_type_supports_isa(machine->cpu_type, ISA_MIPS64); =20 object_initialize_child(OBJECT(machine), "cps", &s->cps, TYPE_MIPS_CPS= ); object_property_set_str(OBJECT(&s->cps), "cpu-type", machine->cpu_type, diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 5c11eecec11..4651a1055c9 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1205,7 +1205,7 @@ static void create_cps(MachineState *ms, MaltaState *= s, static void mips_create_cpu(MachineState *ms, MaltaState *s, qemu_irq *cbus_irq, qemu_irq *i8259_irq) { - if ((ms->smp.cpus > 1) && cpu_supports_cps_smp(ms->cpu_type)) { + if ((ms->smp.cpus > 1) && cpu_type_supports_cps_smp(ms->cpu_type)) { create_cps(ms, s, cbus_irq, i8259_irq); } else { create_cpu_without_cps(ms, s, cbus_irq, i8259_irq); @@ -1309,7 +1309,7 @@ void mips_malta_init(MachineState *machine) loaderparams.initrd_filename =3D initrd_filename; kernel_entry =3D load_kernel(); =20 - if (!cpu_supports_isa(machine->cpu_type, ISA_NANOMIPS32)) { + if (!cpu_type_supports_isa(machine->cpu_type, ISA_NANOMIPS32)) { write_bootloader(memory_region_get_ram_ptr(bios), bootloader_run_addr, kernel_entry); } else { diff --git a/target/mips/translate.c b/target/mips/translate.c index c64a1bc42e1..b8ed16bb779 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31770,13 +31770,13 @@ void cpu_mips_realize_env(CPUMIPSState *env) mvp_init(env, env->cpu_model); } =20 -bool cpu_supports_cps_smp(const char *cpu_type) +bool cpu_type_supports_cps_smp(const char *cpu_type) { const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) !=3D 0; } =20 -bool cpu_supports_isa(const char *cpu_type, uint64_t isa) +bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa) { const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); return (mcc->cpu_def->insn_flags & isa) !=3D 0; --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) client-ip=209.85.221.52; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f52.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890850; cv=none; d=zohomail.com; s=zohoarc; b=TRqRSJ9yk7cDKPM3/NhFd3RXx3BVMSsk58GtKCCTFFpjMtrXprLyqEACUCIrT1KySSzhQParzI/Erg6P6gF/nhulpWuYKikxWjbufkYGxTycyBLCt3jLsfxYwBPxXv7rCbR56ARg0yXtY/cVU2QVkKC68UY6Msqy2Rx/DPKZO4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890850; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vnT/tPVrq2N2FYMYgZtTYaFHIckks0AviU81Qc91KKs=; b=PjfuOJzLeRz322hUAdCtxny0s0YfUtlH9MZLXtji7U+WXKSdt9MmW0xGaLAQkecRUFe9WKBf8zTgQNxmnrgf8tY63f6QyJwNasRkrjVy0UTQ+P0JGPVm2WkQTgpO0JuHMEacXZEwH4S1r7nw3jDHqpAR7esgjD4OAfYndPaCOok= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.52 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.zohomail.com with SMTPS id 1607890850676440.25871884412857; Sun, 13 Dec 2020 12:20:50 -0800 (PST) Received: by mail-wr1-f52.google.com with SMTP id r7so14384825wrc.5 for ; Sun, 13 Dec 2020 12:20:50 -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 j15sm28136891wrr.85.2020.12.13.12.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:48 -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=vnT/tPVrq2N2FYMYgZtTYaFHIckks0AviU81Qc91KKs=; b=e7LJbWzXLCuWedqjvI5ydJ2stCtieu6T9nS0X2Z2XF1+hXLOERf0REW678SVLmTByf /KpoBrysIy6bH9ANZcG8c3oIefq4OOZdzYwUW/Hx6z6ZzcPJ6MKk/m01+u/1jayMf0n1 J2Yb+7rQOJAifWCWTnmJ4kUIf4Xkx0uPWSDB0dRgQcV6iEydsv3upnUr04u1av3QxYKr Bp5FiYV4ab/2n/IR81zIlZ0p7RnBOUVGw4x2JBLaZdnAJLZ5KS0rp52l8MZtUqADo9UN mU7V24Xf1Sb7ebVUWeQQXyZcvtg9KJPohNXC2l1NaGFTMVoAi0s2yE3CYR4SOh/0Hnt5 CnTw== 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=vnT/tPVrq2N2FYMYgZtTYaFHIckks0AviU81Qc91KKs=; b=GbQJTQKd6d9Qxmp/+PDwGCBg9l2ms7aLOOy5JseM9NWfrZeBPXpCY8/muUYnpQXvo7 O4u23JpOXi0R6bm2yBJGhMltmgovWsY9AeWoFRPFwk/Wsvnk5ibbHj2KJd7gSSwHoqK9 KZIONIt7S7Iw0fCgWmkS5dyA4a6CcdBlf9gNK5+tk0XVC0ZaT75YP1+h2nFdIrpnc6ZV AlusPGbmCgx9/C1pNATFdpn7FTOpu6KobueVUnsgcM6r+Vl0Ar8kA/1O6RnuY7SwUnUy gbfL73ndISuR3izscuqETDXcJdgm8w9l5vJAoPViCz+PVnNveo3zyrLsyfkWjV6OT+I1 gkkQ== X-Gm-Message-State: AOAM530bnOhweZhZWeiPfkXfzh4k/x9wvv1JjASiFyGsFtQVVXLn3Ffn EQJFgHFKm+GPat7zgTnWAm8= X-Google-Smtp-Source: ABdhPJyNXoF7M7zDUTyKW48WK9Rf71RnICejRsTbBIzFiJxN3s8CoHQZP6272kqsV94+tQ9HPAT6nA== X-Received: by 2002:adf:f344:: with SMTP id e4mr24467434wrp.25.1607890848889; Sun, 13 Dec 2020 12:20:48 -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 12/26] target/mips: Introduce cpu_supports_isa() taking CPUMIPSState argument Date: Sun, 13 Dec 2020 21:19:32 +0100 Message-Id: <20201213201946.236123-13-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) Introduce cpu_supports_isa() which takes a CPUMIPSState argument, more useful at runtime when the CPU is created (no need to call the extensive object_class_by_name()). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201207215257.4004222-3-f4bug@amsat.org> --- target/mips/cpu.h | 1 + target/mips/cpu.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 9c65c87bf99..e8bca75f237 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1287,6 +1287,7 @@ int cpu_mips_signal_handler(int host_signum, void *pi= nfo, void *puc); #define CPU_RESOLVING_TYPE TYPE_MIPS_CPU =20 bool cpu_type_supports_cps_smp(const char *cpu_type); +bool cpu_supports_isa(const CPUMIPSState *env, uint64_t isa_mask); bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa); void cpu_set_exception_base(int vp_index, target_ulong address); =20 diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 76d50b00b42..687e2680dd1 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -310,3 +310,8 @@ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_typ= e, Clock *cpu_refclk) =20 return MIPS_CPU(cpu); } + +bool cpu_supports_isa(const CPUMIPSState *env, uint64_t isa_mask) +{ + return (env->cpu_model->insn_flags & isa_mask) !=3D 0; +} --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) client-ip=209.85.128.42; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f42.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890856; cv=none; d=zohomail.com; s=zohoarc; b=QlWpSOg9lFV4ydXhPxhKjnz3XL45jUD64WdL5WYbvCa/0surVpbLVkxklqWZyopVwmt3V0UNHM8ME4VdvMl3TrxFKwBIc9L2ihURD8HWXUY3FU3abEC83zldPX3mxbVAxfbxTdj7CWAYbDyXmqDxiMEEXgcz01vZznzWkMgzE8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890856; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uJl+/EeXqBxB7hfG+/ZfbRL30Nmwpy+BSYnXX9dfemM=; b=P+xJbNtDN06kSu80Cgk75chbae0v75of7tr+1PkSL8BFFen+QSgGPqfqYWYuFvVGef+k/DZiI0fsbDbGlS/PJdZI2V7wma+YQJgIeQaxqJCM1DztSp8/jMc7VF5t+ZtCDtPnsUwgIquQZQsCdxLxZuJF/4MrDv+6ea2EYE/jO/s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.42 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.zohomail.com with SMTPS id 1607890856594336.10557187460415; Sun, 13 Dec 2020 12:20:56 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id w206so7881208wma.0 for ; Sun, 13 Dec 2020 12:20:55 -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 s1sm31441773wrv.97.2020.12.13.12.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:53 -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=uJl+/EeXqBxB7hfG+/ZfbRL30Nmwpy+BSYnXX9dfemM=; b=u0ko4PweyxhLkeeWo3yjo1wYFhxgNEC5xrZTR5djqgHZbI8mv4MheQT0hAFOCezq1y +t+3hg7NcxRhx5zGvUWyOQD/p4xngcgSYKQMqZfOpdvwVne724d8k7enBYPR8EEBO+Ox WQJBbfGqH/t/swYfHhLzKf58Gnqqduou53TdAER3Rs4MeTNB483JcdU4MHLKZRSr7Mz9 05sglCyISn7H2VfrielSp9BMFJIzKeB03RoLFBZEbTEZ/pdDM11S49XzFQe9uadwbl88 nZkR0X5hG4lVOf0s6Up0ZgAaMPZ7phLTFTweLuF9xF706SfIDnJYl1HfY6PkSueSwrCx 7JAw== 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=uJl+/EeXqBxB7hfG+/ZfbRL30Nmwpy+BSYnXX9dfemM=; b=P+MMxaBY1pJ5+9S8X0ow5jNXY2nz5ER8cbwM5rXKqtZbQe2qPwOg8Wv4Wa5EMFIdDs OgMwkqvIRq8c7Sy+lArYYO9NQU2GjSt215vIrFSfMEto2yj/RgIIJ3jcpgp2tfLaTfwa 19kjwRVmzyJZDdJ76XYnohRPuL5XpE1JgX4MFLmK/MeRLg/74YgWsu0xlRKdQFKPDw/o eaPUgYifcuZT3YJkOH3veMGrJYmZedS4URvwaxOCsK97TUq36IxMAXOc7QaSpbOjIIc6 maJpz+P7AS26AgzcQl0GBsQk/uZOtNg+tmF/JpuiEGXbh5JuZSMYDp3tu0kq971uMcO2 CyMQ== X-Gm-Message-State: AOAM53368ezAKCW1drRvBZOXh1Ex8VhvRtOkPtXLo5e9OqLNNpziP4Vt FZNGrEb5NiNT+784o5k60L0= X-Google-Smtp-Source: ABdhPJwyr3Bcz0npqHp1+rzM78Aj/bFoHAUN+iHfi/EMO7r5KVcn6S69kfPOW50IF7acg/ABH6c7cA== X-Received: by 2002:a1c:b78a:: with SMTP id h132mr24042122wmf.141.1607890853818; Sun, 13 Dec 2020 12:20:53 -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 13/26] hw/mips: Move address translation helpers to target/mips/ Date: Sun, 13 Dec 2020 21:19:33 +0100 Message-Id: <20201213201946.236123-14-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) Address translation is an architectural thing (not hardware related). Move the helpers from hw/ to target/. As physical address and KVM are specific to system mode emulation, restrict this file to softmmu, so it doesn't get compiled for user-mode emulation. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-2-f4bug@amsat.org> --- include/hw/mips/cpudevs.h | 7 ------- target/mips/cpu.h | 8 ++++++++ hw/mips/boston.c | 1 - {hw =3D> target}/mips/addr.c | 2 +- target/mips/translate.c | 2 -- hw/mips/meson.build | 2 +- target/mips/meson.build | 1 + 7 files changed, 11 insertions(+), 12 deletions(-) rename {hw =3D> target}/mips/addr.c (98%) diff --git a/include/hw/mips/cpudevs.h b/include/hw/mips/cpudevs.h index 291f59281a0..f7c9728fa9f 100644 --- a/include/hw/mips/cpudevs.h +++ b/include/hw/mips/cpudevs.h @@ -5,13 +5,6 @@ =20 /* Definitions for MIPS CPU internal devices. */ =20 -/* addr.c */ -uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr); -uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr); -uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr); -bool mips_um_ksegs_enabled(void); -void mips_um_ksegs_enable(void); - /* mips_int.c */ void cpu_mips_irq_init_cpu(MIPSCPU *cpu); =20 diff --git a/target/mips/cpu.h b/target/mips/cpu.h index e8bca75f237..5d3b2a01c01 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1291,6 +1291,14 @@ bool cpu_supports_isa(const CPUMIPSState *env, uint6= 4_t isa_mask); bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa); void cpu_set_exception_base(int vp_index, target_ulong address); =20 +/* addr.c */ +uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr); +uint64_t cpu_mips_phys_to_kseg0(void *opaque, uint64_t addr); + +uint64_t cpu_mips_kvm_um_phys_to_kseg0(void *opaque, uint64_t addr); +bool mips_um_ksegs_enabled(void); +void mips_um_ksegs_enable(void); + /* mips_int.c */ void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level); =20 diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 16467ea4752..c3b94c68e1b 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -28,7 +28,6 @@ #include "hw/loader.h" #include "hw/loader-fit.h" #include "hw/mips/cps.h" -#include "hw/mips/cpudevs.h" #include "hw/pci-host/xilinx-pcie.h" #include "hw/qdev-clock.h" #include "hw/qdev-properties.h" diff --git a/hw/mips/addr.c b/target/mips/addr.c similarity index 98% rename from hw/mips/addr.c rename to target/mips/addr.c index 2f138fe1ea8..27a6036c451 100644 --- a/hw/mips/addr.c +++ b/target/mips/addr.c @@ -21,7 +21,7 @@ */ =20 #include "qemu/osdep.h" -#include "hw/mips/cpudevs.h" +#include "cpu.h" =20 static int mips_um_ksegs; =20 diff --git a/target/mips/translate.c b/target/mips/translate.c index b8ed16bb779..4a1ae73f9d0 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -28,8 +28,6 @@ #include "exec/exec-all.h" #include "tcg/tcg-op.h" #include "exec/cpu_ldst.h" -#include "hw/mips/cpudevs.h" - #include "exec/helper-proto.h" #include "exec/helper-gen.h" #include "hw/semihosting/semihost.h" diff --git a/hw/mips/meson.build b/hw/mips/meson.build index bcdf96be69f..77b4d8f365e 100644 --- a/hw/mips/meson.build +++ b/hw/mips/meson.build @@ -1,5 +1,5 @@ mips_ss =3D ss.source_set() -mips_ss.add(files('addr.c', 'mips_int.c')) +mips_ss.add(files('mips_int.c')) mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c')) mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c')) mips_ss.add(when: 'CONFIG_MALTA', if_true: files('gt64xxx_pci.c', 'malta.c= ')) diff --git a/target/mips/meson.build b/target/mips/meson.build index 681a5524c0e..4179395a8ea 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -14,6 +14,7 @@ =20 mips_softmmu_ss =3D ss.source_set() mips_softmmu_ss.add(files( + 'addr.c', 'cp0_helper.c', 'cp0_timer.c', 'machine.c', --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) client-ip=209.85.221.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890860; cv=none; d=zohomail.com; s=zohoarc; b=bnV+zCvdbizYocKra28LVEVBsF/lvqPoqhr+lnR7W9k6lLVs1J/1pFEpLuoi9teGp9GWBFPzizn0LJ8+D7y18m/uEgXLMR8r+vwNGMuv+d3C61MQxhMirq2siTLUy1yFTbJlEO7iZxZJqEyzkvCR+bdHulxGftyl8JxXMogAjDs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890860; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=E1hxADG4MX0Qqgj23YttpXWtCnMPo6j/2Ptp7rd9RPE=; b=nVND7hbAcOu7Du4D2FYOQBnllfyenc31UesfXJ262IXkbxs0y0vrNTcFAdBgt1QuO7qhD7+3QHZHKNXHMYKvGaTCXDnrZYnuZRmBVV5tlPDUh9rTkSHgpn+eISpdgzgzA187ZWjmtgx+zJlQFGKnFgzpElTCfKOOLB1aiypi540= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by mx.zohomail.com with SMTPS id 1607890860488282.1980721286051; Sun, 13 Dec 2020 12:21:00 -0800 (PST) Received: by mail-wr1-f46.google.com with SMTP id 91so14377719wrj.7 for ; Sun, 13 Dec 2020 12:20:59 -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 u3sm30014199wre.54.2020.12.13.12.20.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:20:58 -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=E1hxADG4MX0Qqgj23YttpXWtCnMPo6j/2Ptp7rd9RPE=; b=QJFYRIMo8edvn29D1DGA7j5LQJwzHYFijAw70dc84SW3Bf5yGOmnjKsKS20YMVf9Wt /BD5B0paE6WUu0sC6SPFI/4L1EkLVjUANPBop7Qd2o7tEG7H4SFdNffeLoeMrdeUyN8z xhz1zVIA8ydanmWq2pkfHi2+YLcjJaKSqEfen8BB77Ms4Y6KGkalcIGf9sLp2uQlBvx7 DlsC2gtyLoRhTEL493heZAMTVZY1zTTl+3c+oQy5DXIAezp5gGPbalKVXSyPzrQN2SaJ h0/jSmHwfX8nYQWjO9UW2HsD0YtMOv2J4LePNa8IXiKqUHQIdHayhMfSCp+1uiqPPckO ALRg== 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=E1hxADG4MX0Qqgj23YttpXWtCnMPo6j/2Ptp7rd9RPE=; b=Ja9NCHW4JRyToyoGD8XzgPTOuqzroOimleNdad7Waj3PmYI1xDelUBk5r3ZhXI7bjm 1qevZXDveI7qhKH3dRiuuQk4MZRRRoek/LN9QNPBDnKg7SjZcaE3Y0Icwq9JRsq4XBiu iExrKJNpmlKtSyt+uH5L3UFXWv0eO8rtkjcNM7DFA3dm55Z5geocixegYAPI+nhbFD2t qcpDySPxxZA7AwFUqzI4Xn7Zp0gBOpEnDhh6AV2t7WfLKHb+6a6blEkJZdg29vLZaRcf S5HsHfVfXEOgUPkKAGtyJE/sOdBaicFiiImg7KiETAqRJ49E4P0Qrmt03wA/HAwPfikY Mxiw== X-Gm-Message-State: AOAM531yChQhR7FMZC+U9xH7j6K6AZDV6218j7lS6kR5LwG+mOgelTYn Go2fruuFpJ9WUyYspeC/W9Q= X-Google-Smtp-Source: ABdhPJygLgMquJOuVDVVtUz62vwP8PWlMlcYv5NJwKGEiE1SobyrQYByafn6qthVZy6ISQ4FO2l0uA== X-Received: by 2002:adf:90d0:: with SMTP id i74mr26003505wri.288.1607890858762; Sun, 13 Dec 2020 12:20:58 -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 14/26] target/mips: Remove unused headers from translate.c Date: Sun, 13 Dec 2020 21:19:34 +0100 Message-Id: <20201213201946.236123-15-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-3-f4bug@amsat.org> --- target/mips/translate.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 4a1ae73f9d0..e87f472a8d1 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -24,8 +24,6 @@ #include "qemu/osdep.h" #include "cpu.h" #include "internal.h" -#include "disas/disas.h" -#include "exec/exec-all.h" #include "tcg/tcg-op.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h" --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) client-ip=209.85.128.54; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f54.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890865; cv=none; d=zohomail.com; s=zohoarc; b=RHmrBUdr4OxvaNxMSD3sZ4vPhQ7R2dQFfr/NOTAZQ/m3uq+Y/XfZy9W73LoNeq4HyGx6yKg5RQlNAJr0kh4fo6NIywVdwmsQ0ik3n4UXz2nprgpDzg99GF4dPGylvbgr5A30v+4ISWhnwD9BkOxKvGgn8BL1KYeKI9EBp6NmCLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890865; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=U1U85wbWiHYedQBnfCehC7vZG2diuqNh/zEf3sAbatk=; b=PqSt2ir2xRsOl+Yze6rx8ta5kUTKrUGUX5ooPx5aDp7ooAU8telDk8q7q1OLkangLaGsO8eEWj8z9k/5Hfi8w0AMWMQ0MR1msKuHi92glSo7ezPR61E0sp1YlpyGHAMhXAhxeLOeR9XTUkTqqSQqFzAaJh3zliD5CwZ+UBDyCxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.54 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.zohomail.com with SMTPS id 1607890865409852.9546993539875; Sun, 13 Dec 2020 12:21:05 -0800 (PST) Received: by mail-wm1-f54.google.com with SMTP id a3so13417251wmb.5 for ; Sun, 13 Dec 2020 12:21:04 -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 h5sm30144342wrp.56.2020.12.13.12.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:03 -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=U1U85wbWiHYedQBnfCehC7vZG2diuqNh/zEf3sAbatk=; b=mbQ3Z2kBPsaAeNkAQKlf/Uqc+U93xRoHgnDONlAQ92t4i03Hzh6EQALZI3Y2KEc3U+ o1H1TjPOani/Sz3yMY3hKY0n4Iz4FeNkEvoziMZBhVWPvaAKITTeu44/mfWZKwfWa0I4 /T/ovt9++wGDAVVgNaxc87M6DLv7/29iSOO5+y5mmpzQKXzDAstTpYhBBdpnhsqyy+JI xRRTW0sZVAuSoU6T7YTvOgQbY3LDniMGS6RyWJroOc9o4kEmKD0NqLGZr4oPM7YSPIMn IPXHhDCwvsP6b4T/7/VJQrFU++XjnyBZwrmpSRQizF+pFmOmSQAF3ZXYlKC0BEfn25V7 qyeg== 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=U1U85wbWiHYedQBnfCehC7vZG2diuqNh/zEf3sAbatk=; b=stVIK6o7biESPAO1btkjJY6nNT629hrQSckQhQKHKGQnSdJ9et+c2rvUofU/+7airA JbrTnDO3Ow+fLqdQmp/DPtx/uVszgjv/UYiS3kCR4VMl+p+QFaeOdGUKvFjlhxNdh1iH FhOqClmJH90YuRxCfrePFf3dGzQcn5icrlWCnuaL8ROg+zVM9LSrBh3LySmdUM/qOOFW 6+Yo3YEOBanQOSHUEhYmaDH67hmCsIBU4Y6k4x4JNQo13hRpW27WQ9WemhcFmzF77Agk fno7kU3UXiaeT/iNuLT1qy7ld8G+RuDR/XbUa0hn9EPdOb6IN4ilB43CIkfCeqrzW8eO +XDA== X-Gm-Message-State: AOAM533QMVTjbN8Z1lVblP1nPJ1JDLfCUyBnQAL9lDCrs7OE2YJc57Rt gfMlpwo7z93Q2xH8A6c0qf8= X-Google-Smtp-Source: ABdhPJzNHgtxhEQNX7DznNzRimsoGP5ISuhO0bLMbYb6QifZ7mqmtSXaufbgDyGau189eqa0XDfA4Q== X-Received: by 2002:a1c:43c5:: with SMTP id q188mr24563275wma.163.1607890863692; Sun, 13 Dec 2020 12:21:03 -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 15/26] target/mips: Remove unused headers from op_helper.c Date: Sun, 13 Dec 2020 21:19:35 +0100 Message-Id: <20201213201946.236123-16-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-6-f4bug@amsat.org> --- target/mips/op_helper.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 5184a1838be..5aa97902e98 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -19,15 +19,11 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "internal.h" -#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "exec/cpu_ldst.h" #include "exec/memop.h" -#include "sysemu/kvm.h" =20 =20 /*************************************************************************= ****/ --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) client-ip=209.85.128.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890870; cv=none; d=zohomail.com; s=zohoarc; b=R8yEfcUzos4mMnNUnqTiH7C1oq0N4k7ecpcS2OzW8CZDkBOM5xpMi+N7xDTzQepwSOPtvgeEN0ZiXEvx9d2Mma7yzrOLEqRLzjTAyJiqFf877bhgT5VIel6nHo4dAaE7nfGyYZbaQekZ385XsMP0dgRegLbSXKM4bZTws3b4Ut4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890870; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H63X5j82a+LliFWq3Jbhu57DqrlxgL6DTtMOErZtbQQ=; b=oIqhLDb+7dlNF6ABzA8C0Vh342+ORRdCF0A6CPRvHScn7k1fvSuSoV4iHPrdGzZvGDVS2Ap7hasVVayRF+PmHPIOQti2GtvDmrTijTQfINfIoBQmF/j64hb3Fy1UBDu0IOhGy82uS9Okknssd+MYhZFdR0gy16FnMxkvkaDezvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) by mx.zohomail.com with SMTPS id 1607890870417365.7424044601373; Sun, 13 Dec 2020 12:21:10 -0800 (PST) Received: by mail-wm1-f44.google.com with SMTP id 3so13413083wmg.4 for ; Sun, 13 Dec 2020 12:21:09 -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 q73sm28249910wme.44.2020.12.13.12.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:08 -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=H63X5j82a+LliFWq3Jbhu57DqrlxgL6DTtMOErZtbQQ=; b=lPbs7U1Oj6rFYBbgUiPOqTZ6521oG6m+tJxriuzaHqVF5erscvscVQ3dhMqHQsbHNQ 5r9lEXG2Gscm2RVAf9pZE28wmVUPfVz1xp/azb5nsQ+p8xRdcz+/rFA5qDhVfAa3RqV4 moCXUB4u6iiAHyqx3vEkswuoqCZJ8b4afHlsipDajERjcJBYzGwLIQ9hINcsUjMtS9Oy xp7SflzOtoo6X2jQA+ewdqeXJvIXeZnC8PtpfnS+k6j6Cnd8mXs03HgnrF2P4Nx9nALF D/D8YdWZxqKzUbigIhvS9SQBnkXcnFZ/0Xr5dUbBbgMSxPsXAcwf2RFJvxZ3CJKe8XSI AeZw== 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=H63X5j82a+LliFWq3Jbhu57DqrlxgL6DTtMOErZtbQQ=; b=LIomYOAyb1zXTGUw6lDFtBQxK8hD2wdSbjNCiA3BcNuRC6flQpuXyyoMpL0hPkPBC6 k6XAeuRZyvFsvX2c9jdXfD0e4F1sMnp7BFA5Q31Sk2AJgFiMaAPODslR9339+Qw8rpL6 UNf3hNS5bp3/gcrK6Iwo9ztPX2yRP/BanMpmUwIBLM+SHacITEyiXlZmZkmOAzdrZOJk 1B5yl23OVvACe838sSg5EDPGb0DGBkpxeXe2or4WBvqoeWeP3mApGoHTdTOecV7wOZv7 C1YY9WgQNQtgvsu7gfl21m0eZNSM+eKdvlhnkpUTMGFWFKyegKQ5iqJwyQFn9UExv7Df 8heQ== X-Gm-Message-State: AOAM532WWXIMcxdjkHuWZWSOsmCO3VYGsxS9RpGXo5Y97RPO6NbChBNa NL9EPoiYMGo3tbsyZrwovmg= X-Google-Smtp-Source: ABdhPJz3/rQrsUemKBe0Gm+tyYr3IRJvrRwSyn2Alp0P+Zr8a+YhxOpvSZRX/WsAXlj7ubTDzVcY9g== X-Received: by 2002:a1c:6383:: with SMTP id x125mr24420960wmb.46.1607890868670; Sun, 13 Dec 2020 12:21:08 -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 16/26] target/mips: Remove mips_def_t unused argument from mvp_init() Date: Sun, 13 Dec 2020 21:19:36 +0100 Message-Id: <20201213201946.236123-17-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) mvp_init() doesn't require any CPU definition (beside the information accessible via CPUMIPSState). Remove the unused argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201204222622.2743175-2-f4bug@amsat.org> --- target/mips/translate.c | 2 +- target/mips/translate_init.c.inc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index e87f472a8d1..f218997f049 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31763,7 +31763,7 @@ void cpu_mips_realize_env(CPUMIPSState *env) mmu_init(env, env->cpu_model); #endif fpu_init(env, env->cpu_model); - mvp_init(env, env->cpu_model); + mvp_init(env); } =20 bool cpu_type_supports_cps_smp(const char *cpu_type) diff --git a/target/mips/translate_init.c.inc b/target/mips/translate_init.= c.inc index 79f75ed863c..5a926bc6df3 100644 --- a/target/mips/translate_init.c.inc +++ b/target/mips/translate_init.c.inc @@ -989,7 +989,7 @@ static void fpu_init (CPUMIPSState *env, const mips_def= _t *def) memcpy(&env->active_fpu, &env->fpus[0], sizeof(env->active_fpu)); } =20 -static void mvp_init (CPUMIPSState *env, const mips_def_t *def) +static void mvp_init(CPUMIPSState *env) { env->mvp =3D g_malloc0(sizeof(CPUMIPSMVPContext)); =20 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) client-ip=209.85.128.45; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f45.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890875; cv=none; d=zohomail.com; s=zohoarc; b=SA4uKDfQ9Vz2kiR6V4mMgC31GJFFWYfAZiRXTQU7KdWsxUc+gEmW7PTVMi41NrJrjN8/Fqvmzl7Qv2PsJQj+bdsQFAykVBEDfmATsJ2YKSaUzwvCeIxb2wYNAyOr/Q53dtRSJ5HWV2yPQTwo7JDaGB0eaBLEzmVM8flgr3ru/vY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890875; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BwBCSJKUs74AgI90rgGgJ5DnyTy76Cwmh6AmTQxT6D8=; b=MxiVwS4uSODhFyLQFm6OMsZtVymYqomyNCznpSYNvGhpnopwsurXVxkeL1RhEJwrpU44WQRKDdd9KG0ctxc3nXH3jYS8B/ovDcHQvO6OXzjx5QD2uyoAiWbi8TzyzWlWlChf2wDmPf5rL9TfAQe9dfbdgNlfDmdFKNF6CDxHPOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.zohomail.com with SMTPS id 1607890875394328.49409612058605; Sun, 13 Dec 2020 12:21:15 -0800 (PST) Received: by mail-wm1-f45.google.com with SMTP id g25so7886365wmh.1 for ; Sun, 13 Dec 2020 12:21:14 -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 h184sm28789455wmh.23.2020.12.13.12.21.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:12 -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=BwBCSJKUs74AgI90rgGgJ5DnyTy76Cwmh6AmTQxT6D8=; b=mrwpFWGC/8qrenEQFhf/VblmOHmQoA6rejjcRRVDeYwpRb49BQO8vN8IeucQNyvrtF f8YuxMsC/iKs1KnLM42AK032qwQW6l08i6+WiyZDZK6g6QWF4NM+9+VGOd3vLxmT/7Qi ccFby7l/TiVjCbtXYXFPy+2pgJoFqeSrI59iqIwfv3HsS6nVHPMaVXFf5lZVFu7AX39r jWGdRsJxAltvakb4Mt5uDaC8KH3wT0ikuaV+GraTYk0xm8X5YbCOlXXnM2oGq16xiT8y vnVMGbcFrCJe28hJIbBHmyESd2jtuTxLLL7rxUCjjEMqKleKO1LzwlpHA9T4SRG4Yxtb dHww== 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=BwBCSJKUs74AgI90rgGgJ5DnyTy76Cwmh6AmTQxT6D8=; b=bb3bNh3o1ZXS6Cxht7xdc7KzCrSflzgtqJ+Y2uD217m09r+pJxhBj+qMt/CPsKdDPj P0q3QFWw5gHZFbVGJuLa7YbPoTAVMLu4QOavsUbDUl+JeIeU7boeVCgkT0cHIZr5CZm6 b+lqa+JWrQ0C/OiPwaD9a+3PVm5QyRCeLgjdYKiQu/RuQt13jGdZTaFoT06PUvlhyzyO gr9MpCOq1X+CG/LhZpceo7SXR+Be4SDdz5/7+cBuvEVxfr/bAbzqpVo5sw0TW0gruot5 eU7UOonGLWlZDD2FqHQgouU0DxmZiJ9TH4ZmnpPJxcNAK1z6bhMt294A86AhcETEGhTK xcmQ== X-Gm-Message-State: AOAM532acnkz8In94j3Gw3j5flBtCSEDFXuNWpS5Drhlzzzu4HnpY8Yu v0lAv9iEKqcmF/zPxqeL79Q= X-Google-Smtp-Source: ABdhPJyjCdeXDlFSxrZSqJn/AgC7v3c15fguzRGYdbHseBQtSeIjGz1sP0ZJiYfQIPcPfGi/6wFVDw== X-Received: by 2002:a1c:2288:: with SMTP id i130mr24700600wmi.78.1607890873572; Sun, 13 Dec 2020 12:21:13 -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 17/26] target/mips: Introduce ase_mt_available() helper Date: Sun, 13 Dec 2020 21:19:37 +0100 Message-Id: <20201213201946.236123-18-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) Instead of accessing CP0_Config3 directly and checking the 'Multi-Threading Present' bit, introduce an helper to simplify code review. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201204222622.2743175-3-f4bug@amsat.org> --- target/mips/cpu.h | 7 +++++++ hw/mips/cps.c | 3 +-- target/mips/cp0_helper.c | 2 +- target/mips/cpu.c | 2 +- target/mips/helper.c | 2 +- target/mips/translate.c | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 5d3b2a01c01..3ac21d0e9c0 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1289,6 +1289,13 @@ int cpu_mips_signal_handler(int host_signum, void *p= info, void *puc); bool cpu_type_supports_cps_smp(const char *cpu_type); bool cpu_supports_isa(const CPUMIPSState *env, uint64_t isa_mask); bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa); + +/* Check presence of multi-threading ASE implementation */ +static inline bool ase_mt_available(CPUMIPSState *env) +{ + return env->CP0_Config3 & (1 << CP0C3_MT); +} + void cpu_set_exception_base(int vp_index, target_ulong address); =20 /* addr.c */ diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 962b1b0b87c..7a0d289efaf 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -58,8 +58,7 @@ static void main_cpu_reset(void *opaque) =20 static bool cpu_mips_itu_supported(CPUMIPSState *env) { - bool is_mt =3D (env->CP0_Config5 & (1 << CP0C5_VP)) || - (env->CP0_Config3 & (1 << CP0C3_MT)); + bool is_mt =3D (env->CP0_Config5 & (1 << CP0C5_VP)) || ase_mt_availabl= e(env); =20 return is_mt && !kvm_enabled(); } diff --git a/target/mips/cp0_helper.c b/target/mips/cp0_helper.c index cb899fe3d73..36a92857bfb 100644 --- a/target/mips/cp0_helper.c +++ b/target/mips/cp0_helper.c @@ -1164,7 +1164,7 @@ void helper_mtc0_entryhi(CPUMIPSState *env, target_ul= ong arg1) old =3D env->CP0_EntryHi; val =3D (arg1 & mask) | (old & ~mask); env->CP0_EntryHi =3D val; - if (env->CP0_Config3 & (1 << CP0C3_MT)) { + if (ase_mt_available(env)) { sync_c0_entryhi(env, env->current_tc); } /* If the ASID changes, flush qemu's TLB. */ diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 687e2680dd1..9d7edc1ca21 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -74,7 +74,7 @@ static bool mips_cpu_has_work(CPUState *cs) } =20 /* MIPS-MT has the ability to halt the CPU. */ - if (env->CP0_Config3 & (1 << CP0C3_MT)) { + if (ase_mt_available(env)) { /* * The QEMU model will issue an _WAKE request whenever the CPUs * should be woken up. diff --git a/target/mips/helper.c b/target/mips/helper.c index 59de58fcbc9..0c657865793 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -419,7 +419,7 @@ void cpu_mips_store_status(CPUMIPSState *env, target_ul= ong val) tlb_flush(env_cpu(env)); } #endif - if (env->CP0_Config3 & (1 << CP0C3_MT)) { + if (ase_mt_available(env)) { sync_c0_status(env, env, env->current_tc); } else { compute_hflags(env); diff --git a/target/mips/translate.c b/target/mips/translate.c index f218997f049..ccc82abce04 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31917,7 +31917,7 @@ void cpu_state_reset(CPUMIPSState *env) =20 cpu_mips_store_count(env, 1); =20 - if (env->CP0_Config3 & (1 << CP0C3_MT)) { + if (ase_mt_available(env)) { int i; =20 /* Only TC0 on VPE 0 starts as active. */ --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) client-ip=209.85.128.41; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f41.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890880; cv=none; d=zohomail.com; s=zohoarc; b=S0RBDFdZC1ozsHBcNSTpxv/SEzCS1edYvD+ZBodW2TrK4l1AalQEz3dxLvdP04dK4vpQx+tkc4CI2OzSWjBSoScrxH5yQpw53r6KfbZwKzGTr9lJrOlt7O34PBv5C0RQTz6IxnHanz63sDrovGrjf8471t1oYzIGddUsWepNpR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890880; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7Yr9a6Psm/oyHKmjhGMfMuU1IeIspGuWtps3QIVvufw=; b=PyyzFrpGNEkc1KFRUqJ7VM5GfRFU21FcDVRB81NnikK8ANA2TJL7mW4KEoSbI6MX0+dxSs8iaDBiuPzEiNuTeD+/pfD5FLqcrr5rTmagnZIZhxWMkL10yQYbqF6QMRvbgAGt8UyQ9t56UoAtbb8H7eezuGTIJINDBNShFiufqh4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.41 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.zohomail.com with SMTPS id 1607890880368518.1436252498831; Sun, 13 Dec 2020 12:21:20 -0800 (PST) Received: by mail-wm1-f41.google.com with SMTP id e25so13418889wme.0 for ; Sun, 13 Dec 2020 12:21:19 -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 y7sm28088689wmb.37.2020.12.13.12.21.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:17 -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=7Yr9a6Psm/oyHKmjhGMfMuU1IeIspGuWtps3QIVvufw=; b=Vn2q1Ow1BONmjF96cTF1iuZedFmZh8/Kfc3IyYU8GUDXnVkpse/tCYcuwZtedQiIuE bjkdIDpBrP1LcSAEuX82fBqYt73JXehS6eaUypgRP9CPPkUXiC6xA9aYBUlAA/FTup/z oZ1eiAZSZ/pl6LzxvDQZpSHatnOIAGUUQ9p11vZZ+KI7OHKfUYkGdMGqlPPUFdidgj9V UFFTaw659ZLAyICXt5Pzn1pl1QbZUmMDglxXYfzhBhP0u15wgDoZFJrmNTF4QEWaVWVE VV+VR3vZC4CKms5TJh60iwujuyC/XEIQH5zmEnlmhIMb2U/4M90u5G9fEPju4pAdEHax csyQ== 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=7Yr9a6Psm/oyHKmjhGMfMuU1IeIspGuWtps3QIVvufw=; b=WkJGabHdfECoQIUcrBX2wrxcne6gR3gwavhycNkjWMl5PbNEOHVCTt6eBMgr8gzHbT norvYaUKrcoaEo4AoEGpkTlGClvnt01fq21Ak8M2CWT4bOD+nGrnPR4Ef2clkJAEp8w8 S+fhK5sRoiLXkn2y5ZOhM5EtO/GBxl8YqnRpnog/Wxk9qqTfR4PXk3EIOXH7WrUaTOvU WvS1NiWd/GiZ3poLz7OSn0c71RjxIE/XDuS0KymoKnY9pa3MwTljHTYLJyXfjv06BhJx gxAAuKECEfbLaEa2g2QPTTg4DVuY81ep+GUJ5CTzW54fJZhsLt4rPHLTZT42X3tr5eEc cTvA== X-Gm-Message-State: AOAM532NBofQ1dApohpbhov6AYP36NZs7nQu+ZOnu/aFqhuctR08SCJV KhitOWsQSHAPjJ/37XWp8yY= X-Google-Smtp-Source: ABdhPJzZI3n5VAnjAGiUXhbEjHscCsJk++wli2kENHVGP8fh2ufslHZhGmxtSJPM+1FKajpsttoGSw== X-Received: by 2002:a1c:98cc:: with SMTP id a195mr24641019wme.150.1607890878540; Sun, 13 Dec 2020 12:21:18 -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 18/26] target/mips: Do not initialize MT registers if MT ASE absent Date: Sun, 13 Dec 2020 21:19:38 +0100 Message-Id: <20201213201946.236123-19-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) Do not initialize MT-related config registers if the MT ASE is not present. As some functions access the 'mvp' structure, we still zero-allocate it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201204222622.2743175-4-f4bug@amsat.org> --- target/mips/translate_init.c.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/mips/translate_init.c.inc b/target/mips/translate_init.= c.inc index 5a926bc6df3..f72fee3b40a 100644 --- a/target/mips/translate_init.c.inc +++ b/target/mips/translate_init.c.inc @@ -993,6 +993,10 @@ static void mvp_init(CPUMIPSState *env) { env->mvp =3D g_malloc0(sizeof(CPUMIPSMVPContext)); =20 + if (!ase_mt_available(env)) { + return; + } + /* MVPConf1 implemented, TLB sharable, no gating storage support, programmable cache partitioning implemented, number of allocatable and shareable TLB entries, MVP has allocatable TCs, 2 VPEs --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) client-ip=209.85.221.66; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f66.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890885; cv=none; d=zohomail.com; s=zohoarc; b=i3DejInrSovSRgwO/k5LzPdwiodzDJQeJx1kxAmn6oQa648siy/pqC+e/IyLh2uxU0xZ8y13z801QpmHhIQN74/PXKg2L4Fte8FMmhiT9e72hOhhHU9qntYDslzlxOlMJ5UJYh6ePu5/GwvIg2RjFA5+Jrr8qJzT1Vjq5VpR6fA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890885; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=34Gjpun7TNPsoaQVN38Yv8sG5iP6wLHtCCAjvvFP5UI=; b=BjhSYnB0F/GvktXW4+L2TPZ/mJDkG4LfkTdAt/U1pJF6EIw1mMFlDJVXDYyIrPBEmVGzkEnQQmFnVsHThK+bbRmD0BSG7qV3PAq3mT1kemp/cqFbbknupQAtMtztRULskbiYsgDfnVW3Iqx52lBYOn4lN9vPHRYjwsQH20URLsQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.66 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by mx.zohomail.com with SMTPS id 160789088541626.514856940111713; Sun, 13 Dec 2020 12:21:25 -0800 (PST) Received: by mail-wr1-f66.google.com with SMTP id a12so14376136wrv.8 for ; Sun, 13 Dec 2020 12:21:24 -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 m11sm12338992wmi.16.2020.12.13.12.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:23 -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=34Gjpun7TNPsoaQVN38Yv8sG5iP6wLHtCCAjvvFP5UI=; b=BU3fUzi8DAzwsnOmXIJ76k8U4DrKlFD4XgiVs2SUI68jQ+iKUDSlr9JBsXwLewlN8J MDR35+6wJWQKp8NZ9NCwBBFSRnMsqAnE4kblbrdxgeuWNBEgv/KEOS0YdV54clSlunOG pmTEXF9/gqvpn1SUxQw/jGe9BhmRL4Ta/pxCNPx0KXBSGzNjJlwbTDdqT/R+1ppD9VNL wkVNTJ8ynCM0zNSOgU0iy4PdzHWWKAuBZ/3AdppawIr0PPXO7UCVzzV8EwKG0NrYen3X SCTqipVjLZOjlA5KRD6wCyMiGZh4cUAUpU9+md9tmT8RKZJHvo9KXxw561Vqvhqj9hvy VlYA== 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=34Gjpun7TNPsoaQVN38Yv8sG5iP6wLHtCCAjvvFP5UI=; b=tk1HTaeDGKhRp2fiW48cxwqXtLAhNGhKw8RP/1MlC7NIbkIElFh5sdLp73kaFgSTte PvFxk0PS4Ey4Nvi4gCUr1TTH0MkhOH2+RnlEqmpikDrpgj4CJtQqEpxbNX3VvMMX5DMe lNe3Q9w++DmHxsm2vUkbWs37SC7yONzZD8zi4uVUboetNrbfoXkziaHipeMpvsYtjxab nd9M3pT1x9hgagNFEqzL70C3A692rp57N9sHaxj+mm/aYQrFm5l7oI/Lgd9jc0Vjb8cM fSfnUARMQ8ZtQVtOfhic4M3stG+kwNRYz+SRz7SUV0Yk55KCITuMgBzt88NuivwIE7PR j1cg== X-Gm-Message-State: AOAM533Sdu8mbRJ9CoQTBTdfd8O07UrU+3x/ksne0okQ3U+sF0In0hYd ijcVNDPLLku7Al3kUyUASyY= X-Google-Smtp-Source: ABdhPJxgeDq4WOxjOJQN0+vNyfwIGM036dcbEAa5GUj9cBrFjsN9I9AoZgNvo12QV4gNO6aX/iXePw== X-Received: by 2002:a5d:6682:: with SMTP id l2mr25344695wru.213.1607890883667; Sun, 13 Dec 2020 12:21:23 -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 19/26] hw/mips/malta: Do not initialize MT registers if MT ASE absent Date: Sun, 13 Dec 2020 21:19:39 +0100 Message-Id: <20201213201946.236123-20-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) Do not initialize MT-related config register if the MT ASE is not present. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201204222622.2743175-5-f4bug@amsat.org> --- hw/mips/malta.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 4651a1055c9..f06cb90a44a 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1135,8 +1135,10 @@ static void malta_mips_config(MIPSCPU *cpu) CPUMIPSState *env =3D &cpu->env; CPUState *cs =3D CPU(cpu); =20 - env->mvp->CP0_MVPConf0 |=3D ((smp_cpus - 1) << CP0MVPC0_PVPE) | + if (ase_mt_available(env)) { + env->mvp->CP0_MVPConf0 |=3D ((smp_cpus - 1) << CP0MVPC0_PVPE) | ((smp_cpus * cs->nr_threads - 1) << CP0MVPC0_PTC); + } } =20 static void main_cpu_reset(void *opaque) --=20 2.26.2 From nobody Tue Nov 18 02:49:14 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 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) client-ip=209.85.128.46; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f46.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890895; cv=none; d=zohomail.com; s=zohoarc; b=ndvfkksXaog07a45BE5r5ZPPcfP+T9eWjfw5VoVwcBcqxFc1A5MQdmJ8Dxd825SOU6v2PhxSIvKJ5Fg04RLfsSCLSKEkDj06ENLj6X3ryghshF0H39124cfqLjdP6RHDKD7K1BNomBp8zK4Les0pqfFx9np2XP+AdDTiJXo5U4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890895; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IDtGX2egqT20QSVpEfuV5BUBIdAjxxq0FJmWInmLOws=; b=DOuk1NCiQThfnoBgGVQoDlpInSzlSifzlIV7zqtEK/ABP3PI/TroNhvmdjj8Sq8P3Wl/kM78LgQVoy5LTpDFbrv1HitNJEMj8FJjNr7qlMRPEMovUm0L7wGBfPZ55EpoEy3L7H+VRNFo1Wo96xmrEe6fH+U/pCz0X46xfVrrTTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.46 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.zohomail.com with SMTPS id 1607890895393702.7330360907158; Sun, 13 Dec 2020 12:21:35 -0800 (PST) Received: by mail-wm1-f46.google.com with SMTP id x22so11944778wmc.5 for ; Sun, 13 Dec 2020 12:21:34 -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 v189sm28388850wmg.14.2020.12.13.12.21.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:33 -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=IDtGX2egqT20QSVpEfuV5BUBIdAjxxq0FJmWInmLOws=; b=Rxe8/tK8x4o7R657Ex50CPpjB7/EeLZSFOP/XW+Mp4GBXVOrmqCRbWCxCDTTx9gQik x0rBQFDVRBfCSceRMW6vr0zWpwdDCV5lTNHemp/PDmd2xIab4knatraB71vETXn7AK7P RaNYEktPRVo/AgDkUZkmq+4gZV7c0YwWEqxeNLxTR7RWm5qW/1YAY7u+bn3Syll+J/G/ qr5Onq688Qk5UTFBdCX/MytWg0Esf5gND5ozdRUZFhagfjUrlaf79+cD6Sr+9UyKaJqk GDbwH1buILB/J3O50q+c6kXzfv2nc/cn2hPveeyXR0JTBMuhp0slv+HJywc43jEmgZta /X/w== 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=IDtGX2egqT20QSVpEfuV5BUBIdAjxxq0FJmWInmLOws=; b=RoS8jEvuCG8IHOKmf1oFBDERA1dpqGKIBYwnhpfn2rPgkTbOV8QltVGGLuCB4aSVRX T3bHxaaZIIbCPtrsppN+RUB1HIcugztoK4oXnvWmZg6OUoHsX0tpVY4crZcHxI7PlTB5 gwjhz6KaVPGHxY4h9b22CGUvcPkouKkkak22H0xn2bqFzE4tu0GvUyQ0cPOv9Prjw/yJ 86fW3ZIkQpNnQh78Mr+bOAgOocuJs26+xrQ+SaYoJBqOVQ6Y/WoTqQY3mlDe8ztQSrCo NRtSVfUvtNM+7e9ETQYsSvs2xHN0xK3bMtlRsScJLyo36iS4+OUJaNo/VzmgWtlZE7ri ATDQ== X-Gm-Message-State: AOAM530xMtZKODPOnLDxBYpjUM48XiIUnpgaVX6PGdonp/7fvfuU48Al F4mC8dczSXwQboleU5m6tM8= X-Google-Smtp-Source: ABdhPJw978QeLLZUhsM1IEM53GS3n3KXCYYFMbTvhHOFyz2/tV3RpsUG9gPyUqOu8SIdUbYNfVOzxA== X-Received: by 2002:a05:600c:211:: with SMTP id 17mr24471325wmi.84.1607890893645; Sun, 13 Dec 2020 12:21:33 -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 21/26] target/mips: Extract cpu_supports*/cpu_set* translate.c Date: Sun, 13 Dec 2020 21:19:41 +0100 Message-Id: <20201213201946.236123-22-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) Move cpu_supports*() and cpu_set_exception_base() from translate.c to cpu.c. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-9-f4bug@amsat.org> --- target/mips/cpu.c | 18 ++++++++++++++++++ target/mips/translate.c | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 9d7edc1ca21..3024c51a211 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -315,3 +315,21 @@ bool cpu_supports_isa(const CPUMIPSState *env, uint64_= t isa_mask) { return (env->cpu_model->insn_flags & isa_mask) !=3D 0; } + +bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa) +{ + const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); + return (mcc->cpu_def->insn_flags & isa) !=3D 0; +} + +bool cpu_type_supports_cps_smp(const char *cpu_type) +{ + const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); + return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) !=3D 0; +} + +void cpu_set_exception_base(int vp_index, target_ulong address) +{ + MIPSCPU *vp =3D MIPS_CPU(qemu_get_cpu(vp_index)); + vp->env.exception_base =3D address; +} diff --git a/target/mips/translate.c b/target/mips/translate.c index ccc82abce04..84d2d44e5d5 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31766,24 +31766,6 @@ void cpu_mips_realize_env(CPUMIPSState *env) mvp_init(env); } =20 -bool cpu_type_supports_cps_smp(const char *cpu_type) -{ - const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); - return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) !=3D 0; -} - -bool cpu_type_supports_isa(const char *cpu_type, uint64_t isa) -{ - const MIPSCPUClass *mcc =3D MIPS_CPU_CLASS(object_class_by_name(cpu_ty= pe)); - return (mcc->cpu_def->insn_flags & isa) !=3D 0; -} - -void cpu_set_exception_base(int vp_index, target_ulong address) -{ - MIPSCPU *vp =3D MIPS_CPU(qemu_get_cpu(vp_index)); - vp->env.exception_base =3D address; -} - void cpu_state_reset(CPUMIPSState *env) { CPUState *cs =3D env_cpu(env); --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) client-ip=209.85.128.43; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f43.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890900; cv=none; d=zohomail.com; s=zohoarc; b=eD/NL23M/FWuxoHKIR/npTaQXfs1EmgtSKKIPBGEj+E2ebEv7JcFl2y/gansKbvVL2AolmSlfYgUALb1XAqDTHq4vMlVzZNqDqWPcwdjGZX3YZ2FqgwOW82/390bjO4MAfH/x5zV9rTd+0cKC5xJTr27k7k0czMfIBgP3sfLcLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890900; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=h9y8pq9TBfI508xW8jBvGXxJJHeXigKFCx3JpEUOQz9gwriuaHC7s7ispbN/hbrmesZvRYO4x7M11aKcqZEpEc4UJzzjG0uzkWCGcryoUlGNCG+47FXlnrQUe1GWspFEdsqz1ja7VnsIpJzOjE+6CYyrDeg5k7vL395HwDK7qnY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.zohomail.com with SMTPS id 1607890900418211.07258510820157; Sun, 13 Dec 2020 12:21:40 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id k10so11958038wmi.3 for ; Sun, 13 Dec 2020 12:21:39 -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 j7sm26852271wmb.40.2020.12.13.12.21.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:38 -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=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=OakRocpid6FZj3s/PHYLg8MdRlpbGGdPHt0I1Hb3XrhOxXp3/vJv5KwyCgWALrU1gD cy5QiYNzKe4CL63vdsi0D1njoMUzsX59RGAdylbSTMxcaagw3mMevgxeLXuzYfRBFfey 0FiwS7SCZsQxFLdbxVsGsavlw0q/uUP5pSakgEzriGTJ+oyDfEM/5vaeqZSWkRhZ+t2I 6T6kvP20RAGbVNzgqNGKz8SnndsmKOKQI61NyIC7M7aQoqa9B6XIQoTlMV342ZF6GR7k plpVy02/WeD/36qp+tsHL80j8nR85pYGGf71Zx8TtAQGRIJWV5Sn3Hgcu2yw1InrB4zD hyEA== 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=elw3dkJb0pO4uN20lOWqB+T8hVaJgjod16PJg5LRYBw=; b=Qo7ePTFxXDMA1VulS98ublvpcGy4B9/TBG1TqhHjJobefKH8wax2BqyvI7dzbs8k/x lIVYB78TKN1feRcfkBJR8Efl3vgBo80fpcxsOMaHpApcmMpvFNAWFug67C6fgXfcShSs EGNgVup3lGkpoMfyngIxujh/yLC/ps0G/qFUUtBSncUVIWLBzWDYiFEhA1yk9YCukGFD X4Lgy5KStm6/vPg/Dzzp8IzLFAjnMwUbQu1S87niKiLwhlcCLes51iXilmt+MVSjEzij 3UN8WsjszqM+A1M+YFaPz5cr2Pm4NEO+eD4R7FQPnR63m9Xe+MZntp8xZ8j31xU18dJD hBLw== X-Gm-Message-State: AOAM531oEQsiR8hFsQZCZvnw2ik3ul/QexJtLzLUOeL286S1GJu/MwCc U4hUexpih6Yk9Xl8XsDSQQw= X-Google-Smtp-Source: ABdhPJxYfakzKjYyS+h5ikBDwAbUZrCSc5kwJtqdOV5z+575/HCCL+TNCGZORrpxlu3KFPynTy49wg== X-Received: by 2002:a1c:8016:: with SMTP id b22mr24363664wmd.135.1607890898684; Sun, 13 Dec 2020 12:21:38 -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 22/26] target/mips: Move mips_cpu_add_definition() from helper.c to cpu.c Date: Sun, 13 Dec 2020 21:19:42 +0100 Message-Id: <20201213201946.236123-23-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-10-f4bug@amsat.org> --- target/mips/cpu.c | 33 +++++++++++++++++++++++++++++++++ target/mips/helper.c | 33 --------------------------------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 3024c51a211..c29fef29d00 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -30,6 +30,7 @@ #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" +#include "qapi/qapi-commands-machine-target.h" =20 static void mips_cpu_set_pc(CPUState *cs, vaddr value) { @@ -299,6 +300,38 @@ static void mips_cpu_register_types(void) =20 type_init(mips_cpu_register_types) =20 +static void mips_cpu_add_definition(gpointer data, gpointer user_data) +{ + ObjectClass *oc =3D data; + CpuDefinitionInfoList **cpu_list =3D user_data; + CpuDefinitionInfoList *entry; + CpuDefinitionInfo *info; + const char *typename; + + typename =3D object_class_get_name(oc); + info =3D g_malloc0(sizeof(*info)); + info->name =3D g_strndup(typename, + strlen(typename) - strlen("-" TYPE_MIPS_CPU)); + info->q_typename =3D g_strdup(typename); + + entry =3D g_malloc0(sizeof(*entry)); + entry->value =3D info; + entry->next =3D *cpu_list; + *cpu_list =3D entry; +} + +CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) +{ + CpuDefinitionInfoList *cpu_list =3D NULL; + GSList *list; + + list =3D object_class_get_list(TYPE_MIPS_CPU, false); + g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); + g_slist_free(list); + + return cpu_list; +} + /* Could be used by generic CPU object */ MIPSCPU *mips_cpu_create_with_clock(const char *cpu_type, Clock *cpu_refcl= k) { diff --git a/target/mips/helper.c b/target/mips/helper.c index 0c657865793..87296fbad69 100644 --- a/target/mips/helper.c +++ b/target/mips/helper.c @@ -24,7 +24,6 @@ #include "exec/cpu_ldst.h" #include "exec/log.h" #include "hw/mips/cpudevs.h" -#include "qapi/qapi-commands-machine-target.h" =20 enum { TLBRET_XI =3D -6, @@ -1500,35 +1499,3 @@ void QEMU_NORETURN do_raise_exception_err(CPUMIPSSta= te *env, =20 cpu_loop_exit_restore(cs, pc); } - -static void mips_cpu_add_definition(gpointer data, gpointer user_data) -{ - ObjectClass *oc =3D data; - CpuDefinitionInfoList **cpu_list =3D user_data; - CpuDefinitionInfoList *entry; - CpuDefinitionInfo *info; - const char *typename; - - typename =3D object_class_get_name(oc); - info =3D g_malloc0(sizeof(*info)); - info->name =3D g_strndup(typename, - strlen(typename) - strlen("-" TYPE_MIPS_CPU)); - info->q_typename =3D g_strdup(typename); - - entry =3D g_malloc0(sizeof(*entry)); - entry->value =3D info; - entry->next =3D *cpu_list; - *cpu_list =3D entry; -} - -CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) -{ - CpuDefinitionInfoList *cpu_list =3D NULL; - GSList *list; - - list =3D object_class_get_list(TYPE_MIPS_CPU, false); - g_slist_foreach(list, mips_cpu_add_definition, &cpu_list); - g_slist_free(list); - - return cpu_list; -} --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) client-ip=209.85.128.50; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f50.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890905; cv=none; d=zohomail.com; s=zohoarc; b=KaT24dqfcoQhT117nhzMI535KVW8nFza1ERfmSLU+nWQ+R+m8FohwYAPI5xLunaUYgggWg7igsNOLo6RFCpiNJYaz1h9JiCIg1AYM/Pj91LdZ39NWy6ePeq6GQqoud6xnkGokXSk4DSo6xkGHk6LcJv8kdkcC42VDSeRTxymADQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890905; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zC5YsscNbzWCzjRwHYTqYhMRZYSKGJAcauFwzW475P4=; b=f9OZqcWHhft00zP59224KRLAmOjYz2f3Sa9MUMVtgcUXW32K0ff3FvD7CG/5Q8owCmVB1hsxlADNck4XSTVY71bWgz8xqHn3APvwKIz/TdhKOnXwzXL3HC1mvIv2YOQ7+8OmWe0PD3O+/hmyqW4KPhkfYX5pfUARJ0NLdUzz4vM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.zohomail.com with SMTPS id 1607890905723895.6436534707653; Sun, 13 Dec 2020 12:21:45 -0800 (PST) Received: by mail-wm1-f50.google.com with SMTP id 190so1722118wmz.0 for ; Sun, 13 Dec 2020 12:21:45 -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 h5sm30146925wrp.56.2020.12.13.12.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:43 -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=zC5YsscNbzWCzjRwHYTqYhMRZYSKGJAcauFwzW475P4=; b=O5cwCVELqRkpQhG/Gi+KnwgwwxeEQekbFMOxbxn3EvXx8HTPtFctBvGKvogIqcCBPg 9K8JcXqvpjH4tAWCiTyYQYhkWlactnMHoiXjkV3JX93ZNQtVOaQVIuhtwbYpf98HZJZy sKW2oiB/is2596VNfV/I27rBx5k8M+R7i2GC2T14uKJW2leu6Q48IMCYuWSCu1hUYYpO G6Wfl7vvOgaMzqzU88K2uteFtoy9RlrfABtz50PLdlaggeA4CwBKpTEtxi8+ytrktA5Y OnVJDkJVa1D305ckcY3RUsLpmdPN13jd4Pl/VRe+JgSp8V0IGN4l8kdaM4lecNhx1jQS VSTw== 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=zC5YsscNbzWCzjRwHYTqYhMRZYSKGJAcauFwzW475P4=; b=mfURDuJzZh92RqCyjcsa96gsCMQzMTjNvY2mCfch6MzEpjYvAHsKw2kUBgc5JIoptg SRC4vSiBp8uTmYYZ2a/GRq2FNr8KgYwEgDv7aNogT3/vQDEVzO+y8tu8/Wqe5K860z1v nuNARO8cb9UPPwhpA743+xIMtV6XpbHKL0mwab4lot0beJpzlnTAsmQIrstt7w9Vfl24 gfWb7I6FIxWJGp816rm7xlQV+i9qVo/greev0g+kc0F4O+mowPkNlBXADdOqwvCSJYNw DszXPRICys8FRqkS+Ao8i8lHZDnBlaKv9nUnkEjw7zz73eRRTCNW/C/Sb8+SfG6cDmnx ttKQ== X-Gm-Message-State: AOAM531pFbzZvHB0CNsQtSLJ2oIHXZ3t+3Oz3mSg2f/jrwuotOc9KSi+ 5CxDl+mVVYDSM1y+g4lf3tk= X-Google-Smtp-Source: ABdhPJyiCZwUbQMhykg7i7M1vk2uLxhJZJQlQw/cE6ZKBazOEyFejEzDz1Vnm1q6QoyBhIdJTR+o7Q== X-Received: by 2002:a05:600c:210e:: with SMTP id u14mr24783077wml.48.1607890903664; Sun, 13 Dec 2020 12:21:43 -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 23/26] target/mips: Move cpu definitions, reset() and realize() to cpu.c Date: Sun, 13 Dec 2020 21:19:43 +0100 Message-Id: <20201213201946.236123-24-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) Nothing TCG specific there, move to common cpu code. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-16-f4bug@amsat.org> --- target/mips/internal.h | 4 - target/mips/cpu.c | 243 ++++++++++++++++++++++++++++++++++++++++ target/mips/translate.c | 240 --------------------------------------- 3 files changed, 243 insertions(+), 244 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index bcd3d857ab6..0515966469b 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -207,10 +207,6 @@ static inline bool cpu_mips_hw_interrupts_pending(CPUM= IPSState *env) =20 void mips_tcg_init(void); =20 -/* TODO QOM'ify CPU reset and remove */ -void cpu_state_reset(CPUMIPSState *s); -void cpu_mips_realize_env(CPUMIPSState *env); - /* cp0_timer.c */ uint32_t cpu_mips_get_count(CPUMIPSState *env); void cpu_mips_store_count(CPUMIPSState *env, uint32_t value); diff --git a/target/mips/cpu.c b/target/mips/cpu.c index c29fef29d00..f2c4de7d070 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qemu/cutils.h" +#include "qemu/qemu-print.h" #include "qapi/error.h" #include "cpu.h" #include "internal.h" @@ -30,6 +31,7 @@ #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" +#include "hw/semihosting/semihost.h" #include "qapi/qapi-commands-machine-target.h" =20 static void mips_cpu_set_pc(CPUState *cs, vaddr value) @@ -100,6 +102,247 @@ static bool mips_cpu_has_work(CPUState *cs) return has_work; } =20 +#include "translate_init.c.inc" + +static void cpu_mips_realize_env(CPUMIPSState *env) +{ + env->exception_base =3D (int32_t)0xBFC00000; + +#ifndef CONFIG_USER_ONLY + mmu_init(env, env->cpu_model); +#endif + fpu_init(env, env->cpu_model); + mvp_init(env); +} + +/* TODO QOM'ify CPU reset and remove */ +static void cpu_state_reset(CPUMIPSState *env) +{ + CPUState *cs =3D env_cpu(env); + + /* Reset registers to their default values */ + env->CP0_PRid =3D env->cpu_model->CP0_PRid; + env->CP0_Config0 =3D env->cpu_model->CP0_Config0; +#ifdef TARGET_WORDS_BIGENDIAN + env->CP0_Config0 |=3D (1 << CP0C0_BE); +#endif + env->CP0_Config1 =3D env->cpu_model->CP0_Config1; + env->CP0_Config2 =3D env->cpu_model->CP0_Config2; + env->CP0_Config3 =3D env->cpu_model->CP0_Config3; + env->CP0_Config4 =3D env->cpu_model->CP0_Config4; + env->CP0_Config4_rw_bitmask =3D env->cpu_model->CP0_Config4_rw_bitmask; + env->CP0_Config5 =3D env->cpu_model->CP0_Config5; + env->CP0_Config5_rw_bitmask =3D env->cpu_model->CP0_Config5_rw_bitmask; + env->CP0_Config6 =3D env->cpu_model->CP0_Config6; + env->CP0_Config6_rw_bitmask =3D env->cpu_model->CP0_Config6_rw_bitmask; + env->CP0_Config7 =3D env->cpu_model->CP0_Config7; + env->CP0_Config7_rw_bitmask =3D env->cpu_model->CP0_Config7_rw_bitmask; + env->CP0_LLAddr_rw_bitmask =3D env->cpu_model->CP0_LLAddr_rw_bitmask + << env->cpu_model->CP0_LLAddr_shift; + env->CP0_LLAddr_shift =3D env->cpu_model->CP0_LLAddr_shift; + env->SYNCI_Step =3D env->cpu_model->SYNCI_Step; + env->CCRes =3D env->cpu_model->CCRes; + env->CP0_Status_rw_bitmask =3D env->cpu_model->CP0_Status_rw_bitmask; + env->CP0_TCStatus_rw_bitmask =3D env->cpu_model->CP0_TCStatus_rw_bitma= sk; + env->CP0_SRSCtl =3D env->cpu_model->CP0_SRSCtl; + env->current_tc =3D 0; + env->SEGBITS =3D env->cpu_model->SEGBITS; + env->SEGMask =3D (target_ulong)((1ULL << env->cpu_model->SEGBITS) - 1); +#if defined(TARGET_MIPS64) + if (env->cpu_model->insn_flags & ISA_MIPS3) { + env->SEGMask |=3D 3ULL << 62; + } +#endif + env->PABITS =3D env->cpu_model->PABITS; + env->CP0_SRSConf0_rw_bitmask =3D env->cpu_model->CP0_SRSConf0_rw_bitma= sk; + env->CP0_SRSConf0 =3D env->cpu_model->CP0_SRSConf0; + env->CP0_SRSConf1_rw_bitmask =3D env->cpu_model->CP0_SRSConf1_rw_bitma= sk; + env->CP0_SRSConf1 =3D env->cpu_model->CP0_SRSConf1; + env->CP0_SRSConf2_rw_bitmask =3D env->cpu_model->CP0_SRSConf2_rw_bitma= sk; + env->CP0_SRSConf2 =3D env->cpu_model->CP0_SRSConf2; + env->CP0_SRSConf3_rw_bitmask =3D env->cpu_model->CP0_SRSConf3_rw_bitma= sk; + env->CP0_SRSConf3 =3D env->cpu_model->CP0_SRSConf3; + env->CP0_SRSConf4_rw_bitmask =3D env->cpu_model->CP0_SRSConf4_rw_bitma= sk; + env->CP0_SRSConf4 =3D env->cpu_model->CP0_SRSConf4; + env->CP0_PageGrain_rw_bitmask =3D env->cpu_model->CP0_PageGrain_rw_bit= mask; + env->CP0_PageGrain =3D env->cpu_model->CP0_PageGrain; + env->CP0_EBaseWG_rw_bitmask =3D env->cpu_model->CP0_EBaseWG_rw_bitmask; + env->active_fpu.fcr0 =3D env->cpu_model->CP1_fcr0; + env->active_fpu.fcr31_rw_bitmask =3D env->cpu_model->CP1_fcr31_rw_bitm= ask; + env->active_fpu.fcr31 =3D env->cpu_model->CP1_fcr31; + env->msair =3D env->cpu_model->MSAIR; + env->insn_flags =3D env->cpu_model->insn_flags; + +#if defined(CONFIG_USER_ONLY) + env->CP0_Status =3D (MIPS_HFLAG_UM << CP0St_KSU); +# ifdef TARGET_MIPS64 + /* Enable 64-bit register mode. */ + env->CP0_Status |=3D (1 << CP0St_PX); +# endif +# ifdef TARGET_ABI_MIPSN64 + /* Enable 64-bit address mode. */ + env->CP0_Status |=3D (1 << CP0St_UX); +# endif + /* + * Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR + * hardware registers. + */ + env->CP0_HWREna |=3D 0x0000000F; + if (env->CP0_Config1 & (1 << CP0C1_FP)) { + env->CP0_Status |=3D (1 << CP0St_CU1); + } + if (env->CP0_Config3 & (1 << CP0C3_DSPP)) { + env->CP0_Status |=3D (1 << CP0St_MX); + } +# if defined(TARGET_MIPS64) + /* For MIPS64, init FR bit to 1 if FPU unit is there and bit is writab= le. */ + if ((env->CP0_Config1 & (1 << CP0C1_FP)) && + (env->CP0_Status_rw_bitmask & (1 << CP0St_FR))) { + env->CP0_Status |=3D (1 << CP0St_FR); + } +# endif +#else /* !CONFIG_USER_ONLY */ + if (env->hflags & MIPS_HFLAG_BMASK) { + /* + * If the exception was raised from a delay slot, + * come back to the jump. + */ + env->CP0_ErrorEPC =3D (env->active_tc.PC + - (env->hflags & MIPS_HFLAG_B16 ? 2 : 4)); + } else { + env->CP0_ErrorEPC =3D env->active_tc.PC; + } + env->active_tc.PC =3D env->exception_base; + env->CP0_Random =3D env->tlb->nb_tlb - 1; + env->tlb->tlb_in_use =3D env->tlb->nb_tlb; + env->CP0_Wired =3D 0; + env->CP0_GlobalNumber =3D (cs->cpu_index & 0xFF) << CP0GN_VPId; + env->CP0_EBase =3D (cs->cpu_index & 0x3FF); + if (mips_um_ksegs_enabled()) { + env->CP0_EBase |=3D 0x40000000; + } else { + env->CP0_EBase |=3D (int32_t)0x80000000; + } + if (env->CP0_Config3 & (1 << CP0C3_CMGCR)) { + env->CP0_CMGCRBase =3D 0x1fbf8000 >> 4; + } + env->CP0_EntryHi_ASID_mask =3D (env->CP0_Config5 & (1 << CP0C5_MI)) ? + 0x0 : (env->CP0_Config4 & (1 << CP0C4_AE)) ? 0x3ff : 0xff; + env->CP0_Status =3D (1 << CP0St_BEV) | (1 << CP0St_ERL); + /* + * Vectored interrupts not implemented, timer on int 7, + * no performance counters. + */ + env->CP0_IntCtl =3D 0xe0000000; + { + int i; + + for (i =3D 0; i < 7; i++) { + env->CP0_WatchLo[i] =3D 0; + env->CP0_WatchHi[i] =3D 0x80000000; + } + env->CP0_WatchLo[7] =3D 0; + env->CP0_WatchHi[7] =3D 0; + } + /* Count register increments in debug mode, EJTAG version 1 */ + env->CP0_Debug =3D (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); + + cpu_mips_store_count(env, 1); + + if (ase_mt_available(env)) { + int i; + + /* Only TC0 on VPE 0 starts as active. */ + for (i =3D 0; i < ARRAY_SIZE(env->tcs); i++) { + env->tcs[i].CP0_TCBind =3D cs->cpu_index << CP0TCBd_CurVPE; + env->tcs[i].CP0_TCHalt =3D 1; + } + env->active_tc.CP0_TCHalt =3D 1; + cs->halted =3D 1; + + if (cs->cpu_index =3D=3D 0) { + /* VPE0 starts up enabled. */ + env->mvp->CP0_MVPControl |=3D (1 << CP0MVPCo_EVP); + env->CP0_VPEConf0 |=3D (1 << CP0VPEC0_MVP) | (1 << CP0VPEC0_VP= A); + + /* TC0 starts up unhalted. */ + cs->halted =3D 0; + env->active_tc.CP0_TCHalt =3D 0; + env->tcs[0].CP0_TCHalt =3D 0; + /* With thread 0 active. */ + env->active_tc.CP0_TCStatus =3D (1 << CP0TCSt_A); + env->tcs[0].CP0_TCStatus =3D (1 << CP0TCSt_A); + } + } + + /* + * Configure default legacy segmentation control. We use this regardle= ss of + * whether segmentation control is presented to the guest. + */ + /* KSeg3 (seg0 0xE0000000..0xFFFFFFFF) */ + env->CP0_SegCtl0 =3D (CP0SC_AM_MK << CP0SC_AM); + /* KSeg2 (seg1 0xC0000000..0xDFFFFFFF) */ + env->CP0_SegCtl0 |=3D ((CP0SC_AM_MSK << CP0SC_AM)) << 16; + /* KSeg1 (seg2 0xA0000000..0x9FFFFFFF) */ + env->CP0_SegCtl1 =3D (0 << CP0SC_PA) | (CP0SC_AM_UK << CP0SC_AM) | + (2 << CP0SC_C); + /* KSeg0 (seg3 0x80000000..0x9FFFFFFF) */ + env->CP0_SegCtl1 |=3D ((0 << CP0SC_PA) | (CP0SC_AM_UK << CP0SC_AM) | + (3 << CP0SC_C)) << 16; + /* USeg (seg4 0x40000000..0x7FFFFFFF) */ + env->CP0_SegCtl2 =3D (2 << CP0SC_PA) | (CP0SC_AM_MUSK << CP0SC_AM) | + (1 << CP0SC_EU) | (2 << CP0SC_C); + /* USeg (seg5 0x00000000..0x3FFFFFFF) */ + env->CP0_SegCtl2 |=3D ((0 << CP0SC_PA) | (CP0SC_AM_MUSK << CP0SC_AM) | + (1 << CP0SC_EU) | (2 << CP0SC_C)) << 16; + /* XKPhys (note, SegCtl2.XR =3D 0, so XAM won't be used) */ + env->CP0_SegCtl1 |=3D (CP0SC_AM_UK << CP0SC1_XAM); +#endif /* !CONFIG_USER_ONLY */ + if ((env->insn_flags & ISA_MIPS32R6) && + (env->active_fpu.fcr0 & (1 << FCR0_F64))) { + /* Status.FR =3D 0 mode in 64-bit FPU not allowed in R6 */ + env->CP0_Status |=3D (1 << CP0St_FR); + } + + if (env->insn_flags & ISA_MIPS32R6) { + /* PTW =3D 1 */ + env->CP0_PWSize =3D 0x40; + /* GDI =3D 12 */ + /* UDI =3D 12 */ + /* MDI =3D 12 */ + /* PRI =3D 12 */ + /* PTEI =3D 2 */ + env->CP0_PWField =3D 0x0C30C302; + } else { + /* GDI =3D 0 */ + /* UDI =3D 0 */ + /* MDI =3D 0 */ + /* PRI =3D 0 */ + /* PTEI =3D 2 */ + env->CP0_PWField =3D 0x02; + } + + if (env->CP0_Config3 & (1 << CP0C3_ISA) & (1 << (CP0C3_ISA + 1))) { + /* microMIPS on reset when Config3.ISA is 3 */ + env->hflags |=3D MIPS_HFLAG_M16; + } + + /* MSA */ + if (env->CP0_Config3 & (1 << CP0C3_MSAP)) { + msa_reset(env); + } + + compute_hflags(env); + restore_fp_status(env); + restore_pamask(env); + cs->exception_index =3D EXCP_NONE; + + if (semihosting_get_argc()) { + /* UHI interface can be used to obtain argc and argv */ + env->active_tc.gpr[4] =3D -1; + } +} + static void mips_cpu_reset(DeviceState *dev) { CPUState *s =3D CPU(dev); diff --git a/target/mips/translate.c b/target/mips/translate.c index 84d2d44e5d5..19933b7868c 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -31753,246 +31753,6 @@ void mips_tcg_init(void) #endif } =20 -#include "translate_init.c.inc" - -void cpu_mips_realize_env(CPUMIPSState *env) -{ - env->exception_base =3D (int32_t)0xBFC00000; - -#ifndef CONFIG_USER_ONLY - mmu_init(env, env->cpu_model); -#endif - fpu_init(env, env->cpu_model); - mvp_init(env); -} - -void cpu_state_reset(CPUMIPSState *env) -{ - CPUState *cs =3D env_cpu(env); - - /* Reset registers to their default values */ - env->CP0_PRid =3D env->cpu_model->CP0_PRid; - env->CP0_Config0 =3D env->cpu_model->CP0_Config0; -#ifdef TARGET_WORDS_BIGENDIAN - env->CP0_Config0 |=3D (1 << CP0C0_BE); -#endif - env->CP0_Config1 =3D env->cpu_model->CP0_Config1; - env->CP0_Config2 =3D env->cpu_model->CP0_Config2; - env->CP0_Config3 =3D env->cpu_model->CP0_Config3; - env->CP0_Config4 =3D env->cpu_model->CP0_Config4; - env->CP0_Config4_rw_bitmask =3D env->cpu_model->CP0_Config4_rw_bitmask; - env->CP0_Config5 =3D env->cpu_model->CP0_Config5; - env->CP0_Config5_rw_bitmask =3D env->cpu_model->CP0_Config5_rw_bitmask; - env->CP0_Config6 =3D env->cpu_model->CP0_Config6; - env->CP0_Config6_rw_bitmask =3D env->cpu_model->CP0_Config6_rw_bitmask; - env->CP0_Config7 =3D env->cpu_model->CP0_Config7; - env->CP0_Config7_rw_bitmask =3D env->cpu_model->CP0_Config7_rw_bitmask; - env->CP0_LLAddr_rw_bitmask =3D env->cpu_model->CP0_LLAddr_rw_bitmask - << env->cpu_model->CP0_LLAddr_shift; - env->CP0_LLAddr_shift =3D env->cpu_model->CP0_LLAddr_shift; - env->SYNCI_Step =3D env->cpu_model->SYNCI_Step; - env->CCRes =3D env->cpu_model->CCRes; - env->CP0_Status_rw_bitmask =3D env->cpu_model->CP0_Status_rw_bitmask; - env->CP0_TCStatus_rw_bitmask =3D env->cpu_model->CP0_TCStatus_rw_bitma= sk; - env->CP0_SRSCtl =3D env->cpu_model->CP0_SRSCtl; - env->current_tc =3D 0; - env->SEGBITS =3D env->cpu_model->SEGBITS; - env->SEGMask =3D (target_ulong)((1ULL << env->cpu_model->SEGBITS) - 1); -#if defined(TARGET_MIPS64) - if (env->cpu_model->insn_flags & ISA_MIPS3) { - env->SEGMask |=3D 3ULL << 62; - } -#endif - env->PABITS =3D env->cpu_model->PABITS; - env->CP0_SRSConf0_rw_bitmask =3D env->cpu_model->CP0_SRSConf0_rw_bitma= sk; - env->CP0_SRSConf0 =3D env->cpu_model->CP0_SRSConf0; - env->CP0_SRSConf1_rw_bitmask =3D env->cpu_model->CP0_SRSConf1_rw_bitma= sk; - env->CP0_SRSConf1 =3D env->cpu_model->CP0_SRSConf1; - env->CP0_SRSConf2_rw_bitmask =3D env->cpu_model->CP0_SRSConf2_rw_bitma= sk; - env->CP0_SRSConf2 =3D env->cpu_model->CP0_SRSConf2; - env->CP0_SRSConf3_rw_bitmask =3D env->cpu_model->CP0_SRSConf3_rw_bitma= sk; - env->CP0_SRSConf3 =3D env->cpu_model->CP0_SRSConf3; - env->CP0_SRSConf4_rw_bitmask =3D env->cpu_model->CP0_SRSConf4_rw_bitma= sk; - env->CP0_SRSConf4 =3D env->cpu_model->CP0_SRSConf4; - env->CP0_PageGrain_rw_bitmask =3D env->cpu_model->CP0_PageGrain_rw_bit= mask; - env->CP0_PageGrain =3D env->cpu_model->CP0_PageGrain; - env->CP0_EBaseWG_rw_bitmask =3D env->cpu_model->CP0_EBaseWG_rw_bitmask; - env->active_fpu.fcr0 =3D env->cpu_model->CP1_fcr0; - env->active_fpu.fcr31_rw_bitmask =3D env->cpu_model->CP1_fcr31_rw_bitm= ask; - env->active_fpu.fcr31 =3D env->cpu_model->CP1_fcr31; - env->msair =3D env->cpu_model->MSAIR; - env->insn_flags =3D env->cpu_model->insn_flags; - -#if defined(CONFIG_USER_ONLY) - env->CP0_Status =3D (MIPS_HFLAG_UM << CP0St_KSU); -# ifdef TARGET_MIPS64 - /* Enable 64-bit register mode. */ - env->CP0_Status |=3D (1 << CP0St_PX); -# endif -# ifdef TARGET_ABI_MIPSN64 - /* Enable 64-bit address mode. */ - env->CP0_Status |=3D (1 << CP0St_UX); -# endif - /* - * Enable access to the CPUNum, SYNCI_Step, CC, and CCRes RDHWR - * hardware registers. - */ - env->CP0_HWREna |=3D 0x0000000F; - if (env->CP0_Config1 & (1 << CP0C1_FP)) { - env->CP0_Status |=3D (1 << CP0St_CU1); - } - if (env->CP0_Config3 & (1 << CP0C3_DSPP)) { - env->CP0_Status |=3D (1 << CP0St_MX); - } -# if defined(TARGET_MIPS64) - /* For MIPS64, init FR bit to 1 if FPU unit is there and bit is writab= le. */ - if ((env->CP0_Config1 & (1 << CP0C1_FP)) && - (env->CP0_Status_rw_bitmask & (1 << CP0St_FR))) { - env->CP0_Status |=3D (1 << CP0St_FR); - } -# endif -#else - if (env->hflags & MIPS_HFLAG_BMASK) { - /* - * If the exception was raised from a delay slot, - * come back to the jump. - */ - env->CP0_ErrorEPC =3D (env->active_tc.PC - - (env->hflags & MIPS_HFLAG_B16 ? 2 : 4)); - } else { - env->CP0_ErrorEPC =3D env->active_tc.PC; - } - env->active_tc.PC =3D env->exception_base; - env->CP0_Random =3D env->tlb->nb_tlb - 1; - env->tlb->tlb_in_use =3D env->tlb->nb_tlb; - env->CP0_Wired =3D 0; - env->CP0_GlobalNumber =3D (cs->cpu_index & 0xFF) << CP0GN_VPId; - env->CP0_EBase =3D (cs->cpu_index & 0x3FF); - if (mips_um_ksegs_enabled()) { - env->CP0_EBase |=3D 0x40000000; - } else { - env->CP0_EBase |=3D (int32_t)0x80000000; - } - if (env->CP0_Config3 & (1 << CP0C3_CMGCR)) { - env->CP0_CMGCRBase =3D 0x1fbf8000 >> 4; - } - env->CP0_EntryHi_ASID_mask =3D (env->CP0_Config5 & (1 << CP0C5_MI)) ? - 0x0 : (env->CP0_Config4 & (1 << CP0C4_AE)) ? 0x3ff : 0xff; - env->CP0_Status =3D (1 << CP0St_BEV) | (1 << CP0St_ERL); - /* - * Vectored interrupts not implemented, timer on int 7, - * no performance counters. - */ - env->CP0_IntCtl =3D 0xe0000000; - { - int i; - - for (i =3D 0; i < 7; i++) { - env->CP0_WatchLo[i] =3D 0; - env->CP0_WatchHi[i] =3D 0x80000000; - } - env->CP0_WatchLo[7] =3D 0; - env->CP0_WatchHi[7] =3D 0; - } - /* Count register increments in debug mode, EJTAG version 1 */ - env->CP0_Debug =3D (1 << CP0DB_CNT) | (0x1 << CP0DB_VER); - - cpu_mips_store_count(env, 1); - - if (ase_mt_available(env)) { - int i; - - /* Only TC0 on VPE 0 starts as active. */ - for (i =3D 0; i < ARRAY_SIZE(env->tcs); i++) { - env->tcs[i].CP0_TCBind =3D cs->cpu_index << CP0TCBd_CurVPE; - env->tcs[i].CP0_TCHalt =3D 1; - } - env->active_tc.CP0_TCHalt =3D 1; - cs->halted =3D 1; - - if (cs->cpu_index =3D=3D 0) { - /* VPE0 starts up enabled. */ - env->mvp->CP0_MVPControl |=3D (1 << CP0MVPCo_EVP); - env->CP0_VPEConf0 |=3D (1 << CP0VPEC0_MVP) | (1 << CP0VPEC0_VP= A); - - /* TC0 starts up unhalted. */ - cs->halted =3D 0; - env->active_tc.CP0_TCHalt =3D 0; - env->tcs[0].CP0_TCHalt =3D 0; - /* With thread 0 active. */ - env->active_tc.CP0_TCStatus =3D (1 << CP0TCSt_A); - env->tcs[0].CP0_TCStatus =3D (1 << CP0TCSt_A); - } - } - - /* - * Configure default legacy segmentation control. We use this regardle= ss of - * whether segmentation control is presented to the guest. - */ - /* KSeg3 (seg0 0xE0000000..0xFFFFFFFF) */ - env->CP0_SegCtl0 =3D (CP0SC_AM_MK << CP0SC_AM); - /* KSeg2 (seg1 0xC0000000..0xDFFFFFFF) */ - env->CP0_SegCtl0 |=3D ((CP0SC_AM_MSK << CP0SC_AM)) << 16; - /* KSeg1 (seg2 0xA0000000..0x9FFFFFFF) */ - env->CP0_SegCtl1 =3D (0 << CP0SC_PA) | (CP0SC_AM_UK << CP0SC_AM) | - (2 << CP0SC_C); - /* KSeg0 (seg3 0x80000000..0x9FFFFFFF) */ - env->CP0_SegCtl1 |=3D ((0 << CP0SC_PA) | (CP0SC_AM_UK << CP0SC_AM) | - (3 << CP0SC_C)) << 16; - /* USeg (seg4 0x40000000..0x7FFFFFFF) */ - env->CP0_SegCtl2 =3D (2 << CP0SC_PA) | (CP0SC_AM_MUSK << CP0SC_AM) | - (1 << CP0SC_EU) | (2 << CP0SC_C); - /* USeg (seg5 0x00000000..0x3FFFFFFF) */ - env->CP0_SegCtl2 |=3D ((0 << CP0SC_PA) | (CP0SC_AM_MUSK << CP0SC_AM) | - (1 << CP0SC_EU) | (2 << CP0SC_C)) << 16; - /* XKPhys (note, SegCtl2.XR =3D 0, so XAM won't be used) */ - env->CP0_SegCtl1 |=3D (CP0SC_AM_UK << CP0SC1_XAM); -#endif - if ((env->insn_flags & ISA_MIPS32R6) && - (env->active_fpu.fcr0 & (1 << FCR0_F64))) { - /* Status.FR =3D 0 mode in 64-bit FPU not allowed in R6 */ - env->CP0_Status |=3D (1 << CP0St_FR); - } - - if (env->insn_flags & ISA_MIPS32R6) { - /* PTW =3D 1 */ - env->CP0_PWSize =3D 0x40; - /* GDI =3D 12 */ - /* UDI =3D 12 */ - /* MDI =3D 12 */ - /* PRI =3D 12 */ - /* PTEI =3D 2 */ - env->CP0_PWField =3D 0x0C30C302; - } else { - /* GDI =3D 0 */ - /* UDI =3D 0 */ - /* MDI =3D 0 */ - /* PRI =3D 0 */ - /* PTEI =3D 2 */ - env->CP0_PWField =3D 0x02; - } - - if (env->CP0_Config3 & (1 << CP0C3_ISA) & (1 << (CP0C3_ISA + 1))) { - /* microMIPS on reset when Config3.ISA is 3 */ - env->hflags |=3D MIPS_HFLAG_M16; - } - - /* MSA */ - if (env->CP0_Config3 & (1 << CP0C3_MSAP)) { - msa_reset(env); - } - - compute_hflags(env); - restore_fp_status(env); - restore_pamask(env); - cs->exception_index =3D EXCP_NONE; - - if (semihosting_get_argc()) { - /* UHI interface can be used to obtain argc and argv */ - env->active_tc.gpr[4] =3D -1; - } -} - void restore_state_to_opc(CPUMIPSState *env, TranslationBlock *tb, target_ulong *data) { --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1607890910; cv=none; d=zohomail.com; s=zohoarc; b=eWhd4xh+3znNv3qMfzJM4U32ihwQt0SNKApsQ2F7q+wYduUlDsIOahIprx3d3g9gmLszLpn8LDAi3h7GPvtZEnX19FzuRBxCiWxRhbPAyTihdBx6auTN3I3M1T2BSghjDkRkPDsbvkAj1Mcxa0akJ8tIWGQN08f7GvR+yPz7Rxs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890910; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LJkeleUBcGHGZISXoGddym+wEofBms0JlYm/28m4/UY=; b=NVGtt7Y2qfh+gAUzk+hHJCpeA2FZoLS92d4axyDJB8/CJlc4u9o+8Yh+Xa6AxTJ6Ot9LhIbisYZwxSlMUHNcAk6GzH8vJHOMNN5oOTJ6AFlE5gGMEjViR+9HS7kace8b7SezQxBu/RtIr4RkedR//v68mxJ4MT7ZbC73Zx9I8QE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1607890910454278.36598727099397; Sun, 13 Dec 2020 12:21:50 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id d3so11953183wmb.4 for ; Sun, 13 Dec 2020 12:21:49 -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 e16sm31304940wra.94.2020.12.13.12.21.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:48 -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=LJkeleUBcGHGZISXoGddym+wEofBms0JlYm/28m4/UY=; b=reyXPlTsnGycXX/TRzVcaYnbIZrraBL/+1KXKqsJN518qKtofjV3OtHNLtKCd+Wqo2 Hy6a4QWpLfWJpOdeaPucv4VDG+ZmA50p+k1bIYMXwunOMS5ZFWEMNjjQJo2hBDPNmJQn qBSUzBgNtwDk8Y3LilDtvW4faxdvEb+ePpYpJNlxO+HqPNAXcCPTvWJ9yuV8NCEjpvzj Yny9byxkkJcZMhMxoHX2lWxrHq0veg6FzSj+5XFNqN1g/xsiVUt2OD9tx+agwiNVqwfs qJ6Fxu0vDt+IHbYZkniWL2ODYcrE9P/QLEnKosFIHTbMnA7esKmJeKQHVLNUNKfuY8w5 w08g== 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=LJkeleUBcGHGZISXoGddym+wEofBms0JlYm/28m4/UY=; b=dau0rnv1oqnSrfZJaZUTont6sYZxd2xz+ir+Z9+XSHegzCRBWNoQKgZr1AlNJl6Xff 1iW5f961zTAB6y9mZ/yp8Wxk+xr99oQxX0bv4uaQTCPjHZa1BQumuRqCMy7gSYg5yPxu MgvqZ+iNXWfdITCJg4Y3tUuGBqPRstEHiumHmcNrJwO0tzeuf+qRAN0ATktQMB6y4CGN eUnBRn+qh41fssQvl9PrbEj4k5ASVL9rREKB571b2U19mJBc9ZS2oYQ9I1FaXg0gcvRK D0ghPxofDbwwMbHaM9WYOIk+Q/tmbebtCxaUhNC5IROIdCHI/X/HQex/Bv9HSR32m1Pp ovlg== X-Gm-Message-State: AOAM531aos4XbM23wRf1OYTIGE/mojRPYtgTHiI0BYqxW1i5Lw86TdXJ frQME+DODmv7/TDqALeY1MA= X-Google-Smtp-Source: ABdhPJzMp3L7Q56kV+1c+M42iFI4YcY1kR8SEFv4g7CMPo7HH5NN8auAyFYmAwgHAOZbOuQSJxuF6w== X-Received: by 2002:a1c:4d05:: with SMTP id o5mr25058616wmh.85.1607890908729; Sun, 13 Dec 2020 12:21:48 -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 24/26] target/mips: Inline cpu_mips_realize_env() in mips_cpu_realizefn() Date: Sun, 13 Dec 2020 21:19:44 +0100 Message-Id: <20201213201946.236123-25-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-17-f4bug@amsat.org> --- target/mips/cpu.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index f2c4de7d070..aadc6f8e74d 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -104,17 +104,6 @@ static bool mips_cpu_has_work(CPUState *cs) =20 #include "translate_init.c.inc" =20 -static void cpu_mips_realize_env(CPUMIPSState *env) -{ - env->exception_base =3D (int32_t)0xBFC00000; - -#ifndef CONFIG_USER_ONLY - mmu_init(env, env->cpu_model); -#endif - fpu_init(env, env->cpu_model); - mvp_init(env); -} - /* TODO QOM'ify CPU reset and remove */ static void cpu_state_reset(CPUMIPSState *env) { @@ -400,6 +389,7 @@ static void mips_cpu_realizefn(DeviceState *dev, Error = **errp) { CPUState *cs =3D CPU(dev); MIPSCPU *cpu =3D MIPS_CPU(dev); + CPUMIPSState *env =3D &cpu->env; MIPSCPUClass *mcc =3D MIPS_CPU_GET_CLASS(dev); Error *local_err =3D NULL; =20 @@ -423,7 +413,13 @@ static void mips_cpu_realizefn(DeviceState *dev, Error= **errp) return; } =20 - cpu_mips_realize_env(&cpu->env); + env->exception_base =3D (int32_t)0xBFC00000; + +#ifndef CONFIG_USER_ONLY + mmu_init(env, env->cpu_model); +#endif + fpu_init(env, env->cpu_model); + mvp_init(env); =20 cpu_reset(cs); qemu_init_vcpu(cs); --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) client-ip=209.85.221.44; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-f44.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890915; cv=none; d=zohomail.com; s=zohoarc; b=bI0edq+7Dw/u7QacjyS9KW0sdkTXGjEFTpNe8T6BJnZVihUvuMD/sHckeQypbv9oG+qU7olpR4KUm3+TWWQPA4FJZEn6qHjMg5S3uTU67C5BlcPwD99+Izg6W3Jqq6LcYO0fYnJy9qYakMFrzodv+h0K/5d42SpClm/1+oYPOiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890915; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZtIz6icb9vG8sSEUm2p8Ck/LCv5K/GRxl6Ah3VWmmJs=; b=FLVzKhxCUm22LbdtvAONF2tXeaMdmRHFRco1mEzAfv7asK+97xJ5FjdK1BXqNDG42NVWn7LGje8tcGvdzKGs99yGl+L/6RGOWF7IVyGS+uV2h8w9RudahqicApMP3KaQ80a1e7Mil88oROFeMO1EV6m+Wsp2tUwsQdbfC9KzOhg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.221.44 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.zohomail.com with SMTPS id 16078909155353.88659997824891; Sun, 13 Dec 2020 12:21:55 -0800 (PST) Received: by mail-wr1-f44.google.com with SMTP id d26so1171936wrb.12 for ; Sun, 13 Dec 2020 12:21:54 -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 a14sm19603645wrn.3.2020.12.13.12.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:53 -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=ZtIz6icb9vG8sSEUm2p8Ck/LCv5K/GRxl6Ah3VWmmJs=; b=tzFWhUoChRKrYS25J+TqKbNe96+AgWzdYxtHl5ARz/GIED5fF95WrWR9oNZhmgVepK 69DEKpPLqkWHrighpo5wbEDimB9+v3nKviX1rCmjqEW0WZJ4Hk5RUyRZPD4ZAdHTSGRE OJnyXS1H6XTL4vTgEn4BfWmGu9xNdhNDecJNAzG5JMR69rByBZVswORo+IBLq1RyYyNG 4+zxsR0TUROEobAq8LyhvUlmk+mMgZDJzo5Mcsaiem95XfijzBr9ww4RJglPnJbyjIwU GgjEjQ7dazfh9Bjb2LJ3T8+HvJCeqEMWw+C8t5arZ0uVQMFkWgtd+NTFwP+Rq51cp8Rq JN1Q== 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=ZtIz6icb9vG8sSEUm2p8Ck/LCv5K/GRxl6Ah3VWmmJs=; b=WKy23PgrjuZ6UP9Hy009H9sOn0gE/b77n5CXn9qOuM38ySjATcoT9MqPrtZryBVrEw B/cpgOl3uBt2otfsFyqFsQYYLV7+YQRYyaYb73NfffdmtiDfKp2S3H6uGzEWw2LQjNlA VZBgSADanxej7hfymGhFvkLHnfjHjcP2e2wZuslItQZdMiaXWqi46AU6fR9qWCiwbABc HenQoLLVgeIZ//nPcXlwncdNDh8Ba8MjHvGweK8ipTr0aLU4WgP/vIyFpSmGzW+aewi6 fNxmFiOzV2IAzazSjpPKD8CGzmeccPAmKtsxukCpwjJHIMoIUfqG2VE3gOYDuOz9xF8C xZ8w== X-Gm-Message-State: AOAM533FAb4+kkP878MrAClQ9NrS5Vucv8EP4QQ4A8rHfaWhHG3d8nKd sUDESsgh4d7WVRS0UaHoVNU= X-Google-Smtp-Source: ABdhPJyDTHKNg3NgFUG7Kyp5sodkdQheiE4rdVXY7dx+4Y/b1e5AQbj1cd4FxUJbKXqxtuEHuH+OHA== X-Received: by 2002:a5d:6503:: with SMTP id x3mr25221744wru.151.1607890913580; Sun, 13 Dec 2020 12:21:53 -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 25/26] target/mips: Remove unused headers from fpu_helper.c Date: Sun, 13 Dec 2020 21:19:45 +0100 Message-Id: <20201213201946.236123-26-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) Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201206233949.3783184-4-f4bug@amsat.org> --- target/mips/fpu_helper.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index 020b768e87b..956e3417d0f 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -21,15 +21,11 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "cpu.h" #include "internal.h" -#include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" -#include "exec/memop.h" -#include "sysemu/kvm.h" #include "fpu/softfloat.h" =20 =20 --=20 2.26.2 From nobody Tue Nov 18 02:49:14 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) client-ip=209.85.128.48; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f48.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607890920; cv=none; d=zohomail.com; s=zohoarc; b=c8Yq0+TcU91MtL/mSjksc7xhouh5p/sCYAJb53yptmiyi1VICMVwYZggQtbyXl4uqvPsgAqF+AYvHnfArx11K0AM1Qr1814n7K2BLlsK8i7Lv7vvsRToEKES3KLe5w4bS8T6P++csAI1lfnYhoGbJmBrTwGJlm1i9eLP/AZf7Ts= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607890920; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fVAITAmVV88TOoHja8gyTESqhv1q8JBRT/l8262AHZk=; b=Hh9cnb/U4w7XcITfzhUM2LqpSM4HclCRLY6mIW/xTkBoC+4abCsMjOtLmBSDMqEA6JPIAPMTX54SmlMt/NTpPSlcSA6HVBCni9iYZAT5nhekZbXljgZ8O6lCRJy1zoanbh6wcmA+q16LvAxlGW5Q0dJwKEG0hFYfY7GBNnQ4KSA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.48 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.zohomail.com with SMTPS id 1607890920366807.8378657593712; Sun, 13 Dec 2020 12:22:00 -0800 (PST) Received: by mail-wm1-f48.google.com with SMTP id a6so11954272wmc.2 for ; Sun, 13 Dec 2020 12:21:59 -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 f16sm27335349wmh.7.2020.12.13.12.21.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Dec 2020 12:21:58 -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=fVAITAmVV88TOoHja8gyTESqhv1q8JBRT/l8262AHZk=; b=NHiRLFi7tQsiEdJAPcfC0zbPhb6JmiwS/yPCkgmKA9XgHdOL9CAVSFJ33hrEG9NHuk VxTcak9a3ybUtHDn9Qb0ouA4nIAia2K4rA/4l6Ig1P4lPMTng48qsVzi4B7S0hIxSLTm ddoXqoZDDnR5r+msyxywj9pFkwuO8SQ8WQfGjlOowyZPmRVMzEfVyfRIU9bvBg4/pbRJ I/sjyV5KIyMcdT8b1EL3CLmKYB7LO8uRj3yt7Sx46ML2k/59VEmyABz/jy8/TJGc/6kV RAXzO4La7/sbECmoZWL4AGWSXTuA96vW92ne1NtkbXnFaXBBorVRToQyofsAZOz5723t adRw== 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=fVAITAmVV88TOoHja8gyTESqhv1q8JBRT/l8262AHZk=; b=t+x9r8hCJrp/k68t/5k+wl7dVNIRkGpdI1zfGaauEUgSdj+Vkc/6TmrVD1mAqCfUH8 cfZdaaX7Jc5IYg923gyORQOP82mjY4trpTlIJTNmBKxw2devukirIU2SHbgJ6HC30yWY eIdTtCx5CFw5+kB5xVQEnhyRUM+Vstc49xsoPLBKBd8Mpie88vO7kHwerkBJYe1qHwOP H0HtZ7pqd1hBuVTMPxJTsmXNrxbhDH5ZogPYBeEQnPq2+/T0Q6yoyNVFNh4jeNdip+UW 0tA1yLKD7qOtrhC6sP4tH47dRTUBfpf/NJZJkAldhA2ZpEV/2BkxPX0vOzaSR5EfKz5c zdvg== X-Gm-Message-State: AOAM530XZnj3X8or9TbhTCmyprvViNiOvZFluVSmyHMmyP49C0YNfwyt qq27ouP3XhMTDfMKaaT8am0= X-Google-Smtp-Source: ABdhPJz0CPv/da6KphdHRQ8txpNwxGAeqv36g/49a8+2n8jK31ow8jEvleGDUtARLN/jfRXupU+u2w== X-Received: by 2002:a1c:cc19:: with SMTP id h25mr24645226wmb.124.1607890918580; Sun, 13 Dec 2020 12:21:58 -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 26/26] target/mips: Use FloatRoundMode enum for FCR31 modes conversion Date: Sun, 13 Dec 2020 21:19:46 +0100 Message-Id: <20201213201946.236123-27-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) Use the FloatRoundMode enum type introduced in commit 3dede407cc6 ("softfloat: Name rounding mode enum") instead of 'unsigned int'. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20201123204448.3260804-2-f4bug@amsat.org> --- target/mips/internal.h | 3 ++- target/mips/fpu_helper.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 0515966469b..e4d2d9f44f9 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -223,7 +223,8 @@ bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, uint32_t float_class_s(uint32_t arg, float_status *fst); uint64_t float_class_d(uint64_t arg, float_status *fst); =20 -extern unsigned int ieee_rm[]; +extern const FloatRoundMode ieee_rm[4]; + void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagema= sk); =20 static inline void restore_rounding_mode(CPUMIPSState *env) diff --git a/target/mips/fpu_helper.c b/target/mips/fpu_helper.c index 956e3417d0f..bdb65065ee7 100644 --- a/target/mips/fpu_helper.c +++ b/target/mips/fpu_helper.c @@ -38,7 +38,7 @@ #define FP_TO_INT64_OVERFLOW 0x7fffffffffffffffULL =20 /* convert MIPS rounding mode in FCR31 to IEEE library */ -unsigned int ieee_rm[] =3D { +const FloatRoundMode ieee_rm[4] =3D { float_round_nearest_even, float_round_to_zero, float_round_up, --=20 2.26.2