[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/14] target/mips: Correct the second argument type
From: |
Aleksandar Markovic |
Subject: |
[Qemu-devel] [PULL 04/14] target/mips: Correct the second argument type of cpu_supports_isa() |
Date: |
Fri, 25 Jan 2019 14:31:28 +0100 |
From: Aleksandar Markovic <address@hidden>
"insn_flags" bitfield was expanded from 32-bit to 64-bit in commit
f9c9cd63e3. However, this was not reflected on the second argument
of the function cpu_supports_isa(). By chance, this did not create
some wrong behavior, since the left-most halves of all instances of
the second argument are currently all zeros. However, this is still
a bug waiting to happen. Correct this by changing the type of the
second argument to be always 64-bit.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
---
target/mips/cpu.h | 2 +-
target/mips/translate.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index c4da7df..473d26d 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1173,7 +1173,7 @@ int cpu_mips_signal_handler(int host_signum, void *pinfo,
void *puc);
#define CPU_RESOLVING_TYPE TYPE_MIPS_CPU
bool cpu_supports_cps_smp(const char *cpu_type);
-bool cpu_supports_isa(const char *cpu_type, unsigned int isa);
+bool cpu_supports_isa(const char *cpu_type, uint64_t isa);
void cpu_set_exception_base(int vp_index, target_ulong address);
/* mips_int.c */
diff --git a/target/mips/translate.c b/target/mips/translate.c
index 2140ecd..b362b03 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -29883,7 +29883,7 @@ bool cpu_supports_cps_smp(const char *cpu_type)
return (mcc->cpu_def->CP0_Config3 & (1 << CP0C3_CMGCR)) != 0;
}
-bool cpu_supports_isa(const char *cpu_type, unsigned int isa)
+bool cpu_supports_isa(const char *cpu_type, uint64_t isa)
{
const MIPSCPUClass *mcc = MIPS_CPU_CLASS(object_class_by_name(cpu_type));
return (mcc->cpu_def->insn_flags & isa) != 0;
--
2.7.4
- [Qemu-devel] [PULL 00/14] MIPS queue for January 25, 2019, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 04/14] target/mips: Correct the second argument type of cpu_supports_isa(),
Aleksandar Markovic <=
- [Qemu-devel] [PULL 02/14] target/mips: nanoMIPS: Remove an unused macro, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 08/14] target/mips: Add I6500 core configuration, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 01/14] target/mips: nanoMIPS: Remove duplicate macro definitions, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 09/14] MAINTAINERS: Update MIPS sections, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 11/14] tests: tcg: mips: Add two new Makefiles, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 03/14] target/mips: nanoMIPS: Rename macros for extracting 3-bit-coded GPR numbers, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 07/14] target/mips: nanoMIPS: Fix branch handling, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 13/14] qemu-doc: Add nanoMIPS ISA information, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 14/14] docs/qemu-cpu-models: Add MIPS/nanoMIPS QEMU supported CPU models, Aleksandar Markovic, 2019/01/25
- [Qemu-devel] [PULL 05/14] target/mips: Extend gen_scwp() functionality to support EVA, Aleksandar Markovic, 2019/01/25