From nobody Tue Nov 18 02:54:12 2025 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=1607377992; cv=none; d=zohomail.com; s=zohoarc; b=jcyFNa9X3gTEq5I7PLGyz2R+YMCNEPCyNy1WzfRxsqTUTadPzd67rAaxg5OCOQy4lsMH26gbSsp3QBaQwpesXOmz0OnBJo0YSzMMetLnWyUGyV5BHCtX/lexqmQWthVTXOlUvncigHsgV3mBPKB1mmlzQES8BT7pXsLiwuUD3yg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607377992; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NSo7uQw+LW5Zk/MEaurkeWLiqdBxpgOS5sWCOL8p/vU=; b=K8aE8gmFWAGA0KvjImPmYj4o2OaF9t/OB40hWlePTOFbrwKY//1RPiWCBFXo+Clz5sYMgXVl4Ug/bd3pHZOV8YWjllq5hYyotByWLLBA57lOx+nwGY/GX72pWKg7F0fmo0qLb7IAF8WvstNTxrR/4AMTJxqX0JGBtU2r3tS2M80= 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 1607377992261877.0526993613393; Mon, 7 Dec 2020 13:53:12 -0800 (PST) Received: by mail-ed1-f67.google.com with SMTP id cm17so15447841edb.4 for ; Mon, 07 Dec 2020 13:53:11 -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 b9sm13600277ejb.0.2020.12.07.13.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Dec 2020 13:53:09 -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=NSo7uQw+LW5Zk/MEaurkeWLiqdBxpgOS5sWCOL8p/vU=; b=uVNASsgd7RNtDU2zL6jRmIkmmr3sJ46WcV8GezgE+lqTjAaKmFLPa8XfGAlwPBTRlO VrHVxZ9CTA6rAlAxT13yXde6khY+ho5N7WWePq5XHU9GUE8QJjNG7kZLKbHCT5Tojsud EX3CJubpkWmMYKuEWDqOMIzJ6aYpYYtqdZT9AWLW76KOEn1lfttQjghYMhsh5MruNSuM vBpuC0a0Yod2962rncbZ1X8uvUCm518vJoQWuCoa0CgSXs+DtovtbiKJnHLcuR/EKeFA DSDPnXqYDDdUGNBcwyo6Sdsud65mmW5dRSz3qNB/cNXZ1cGxYDblSnGhXT5GoTN3kVni OlxQ== 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=NSo7uQw+LW5Zk/MEaurkeWLiqdBxpgOS5sWCOL8p/vU=; b=sJz5joCxarfsAvO7PC4rjT8R6g2eNM7yXlFxWwuNvCBRsISm4WpNdWyBpV1KJPJ1lt 0VDuNoeneEE0XA2TAUVzQEUDjyUUuenS+B/rBiXORfsVPhIyxQ2wU7S36ribRS/MtTQ4 4hXn1aDtOdvyHWc9Ks7lf3wzdYrXx6Nj0DUjivlpZAHSxGvSd7rNthrUT28/6pYFRJfc AF0V4/P4HuPasltYcUg3tr0VAift3wfLEOP6w1Ur96OoXHaHgE9dD8AShGdIZr9t8yNk y60oPvEUBBVoQ6YsPocRDT+kSyMzXSEh4Q6yX3nZ9vtD3TUcpv4rzUooez9IUMDAx660 OUPA== X-Gm-Message-State: AOAM531DrDyLGmDLP9639xMYGafLQAvvtvBnniBMOe+3iwmt3jEJ22qJ qc7QCD1IadxFAZgx47Oqos0= X-Google-Smtp-Source: ABdhPJwrxXFwsZBsSt3CyQRHyJ/YZkPg7xmr5P1/dEsMXMdHBfoFxdcz4nTwFxVel7SEoLdE+GcC2g== X-Received: by 2002:a05:6402:949:: with SMTP id h9mr21662845edz.301.1607377990442; Mon, 07 Dec 2020 13:53:10 -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, Jiaxun Yang Cc: Richard Henderson , Aurelien Jarno , Paul Burton , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Rikalo Subject: [PATCH 2/2] target/mips: Introduce cpu_supports_isa() taking CPUMIPSState argument Date: Mon, 7 Dec 2020 22:52:57 +0100 Message-Id: <20201207215257.4004222-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201207215257.4004222-1-f4bug@amsat.org> References: <20201207215257.4004222-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 --- 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