From nobody Tue Nov 18 04:24:28 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