From nobody Mon Feb 9 13:38:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.208.67 as permitted sender) client-ip=209.85.208.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-ed1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.67 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=1608073099; cv=none; d=zohomail.com; s=zohoarc; b=fZdKmOGe6iYRfXyddpVIKle8oTKZ3jcZg7hyRmnHuAT9rfhA84fbg41csVSsk2TR7fPIy3DoSjE3QLxUBB25+QUhAfUMcsTi9LGMANtt2sDMUjUZ3oFRjAOCQ+ggvyW+NTsnCM6u0h1SvIwugZ7CRHiGUmGgfgdq0Ud/R15Drf8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608073099; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=gfAK/5l8oepBv1m9fLlqhZZJOh/VztlrVhqk0ziS8jY=; b=XRaWpJJJKWdjaXC/8DAroSde2p9KOR8HXO0vjBJ5UVj2d24ydbLp6SlYHOdmyWeGWmKSYOqdQayRnaUnnkxEWB9uCodt0HoFdh2gN6brQpQoy/zXeX/EqrOQPHNM3AoxGQmehOMF4AQcn/83Ax+/4LLZmru1PHcrOaH5CA5DQqw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.208.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by mx.zohomail.com with SMTPS id 1608073099212940.5817933325143; Tue, 15 Dec 2020 14:58:19 -0800 (PST) Received: by mail-ed1-f67.google.com with SMTP id b2so22849062edm.3 for ; Tue, 15 Dec 2020 14:58:18 -0800 (PST) Return-Path: Return-Path: Received: from x1w.redhat.com (101.red-88-21-206.staticip.rima-tde.net. [88.21.206.101]) by smtp.gmail.com with ESMTPSA id g18sm19135013edt.2.2020.12.15.14.58.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Dec 2020 14:58:16 -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=gfAK/5l8oepBv1m9fLlqhZZJOh/VztlrVhqk0ziS8jY=; b=FdLu6d7skwAkLOlWHhnw6CiK9nTmqSFMQ2+f3bQKkxDBeFfIIsep4RJ4VxOZ3Yy17p SGAek2pKHRsx1RZHfY/x/wHRH8f30dESCnX3vmr3QoIk/GXgq/tytDYV8D8tZQHHpEHP 6sl0NKCEuQJoTlEzGwITjQQI3hnDr8e7FSckAnVzfged+2Dv0dtlSlYKPgLd5FLt2fWf icL46mdmQhgYhLDRRRg7AFhiPKLdBTdLWsfb0nEPikLlNnRLt8ANtxLEPeS6IFORnamV Bdd+ZmX04Wlh5Fbu/j7W2Cfhz/g6WuGHhj4JYiT4yzvSx92fmBLqgGw3a5ChUkktz1gP OXXg== 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=gfAK/5l8oepBv1m9fLlqhZZJOh/VztlrVhqk0ziS8jY=; b=B8x7G3WFdNdI1ZkzxDbgyn35RIEppdZMDjc2+KFe1t6UYbWjS22hCPcaRh58bqRuHf CAgAKYCs625qZU8gBxGP/V/IH+hjzHWAEWgIgcvUadzdJTs851ihMGAlRTQiSQuuYLZ5 D3SFL6pGl4TK5WVvU0lxjnG05di1gKn7xXG5xjhJ65cObX7/MN3Frz/o6brh3PC2B4zH LrkY2LlIGMOhF29dP5qarB7a99LWfP9wtWpjZU1ZkUVXIMnYuDxk3cjtP/4ilNtu+h/b WaFKqJIkISKWOfbsRKXC0g+pvzGRGKGHW0rA6A6Ldk9tctk7ewwR+IunTigON0zRqnis LxnQ== X-Gm-Message-State: AOAM5321DYoI1lDY91VCqjfDEBDRiJbfKLH4FE77wSL+HcmXVFL51ySZ HLjWaYEfEhVdKKsiZkZ+VYA= X-Google-Smtp-Source: ABdhPJzMV5ebQ8WKtlqOKKPT4HVLHg+DJtP96dH2LzWIIc/qEDJS0DRMCBuv96y66yLjeOVyXmrpnQ== X-Received: by 2002:a05:6402:30ac:: with SMTP id df12mr32562213edb.175.1608073097456; Tue, 15 Dec 2020 14:58:17 -0800 (PST) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Richard Henderson , qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, Aleksandar Rikalo , Paolo Bonzini , Aurelien Jarno , Jiaxun Yang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Huacai Chen Subject: [PATCH v2 03/24] target/mips/cpu: Introduce isa_rel6_available() helper Date: Tue, 15 Dec 2020 23:57:36 +0100 Message-Id: <20201215225757.764263-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201215225757.764263-1-f4bug@amsat.org> References: <20201215225757.764263-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 the isa_rel6_available() helper to check if the CPU supports the Release 6 ISA. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/mips/cpu.h | 1 + target/mips/cpu.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/target/mips/cpu.h b/target/mips/cpu.h index 3ac21d0e9c0..c6a556efad5 100644 --- a/target/mips/cpu.h +++ b/target/mips/cpu.h @@ -1289,6 +1289,7 @@ int cpu_mips_signal_handler(int host_signum, void *pi= nfo, 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); +bool isa_rel6_available(const CPUMIPSState *env); =20 /* Check presence of multi-threading ASE implementation */ static inline bool ase_mt_available(CPUMIPSState *env) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 4191c0741f4..9f082518076 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -789,6 +789,14 @@ bool cpu_supports_isa(const CPUMIPSState *env, uint64_= t isa_mask) return (env->cpu_model->insn_flags & isa_mask) !=3D 0; } =20 +bool isa_rel6_available(const CPUMIPSState *env) +{ + if (TARGET_LONG_BITS =3D=3D 64) { + return cpu_supports_isa(env, ISA_MIPS64R6); + } + return cpu_supports_isa(env, ISA_MIPS32R6); +} + 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)); --=20 2.26.2