qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Aleksandar Markovic <aleksandar.markovic@rt-rk.com>,
	qemu-devel@nongnu.org
Cc: smarkovic@wavecomp.com, arikalo@wavecomp.com,
	amarkovic@wavecomp.com, aurelien@aurel32.net
Subject: Re: [Qemu-devel] [PATCH 4/6] target/mips: Correct the second argument type of cpu_supports_isa()
Date: Mon, 21 Jan 2019 21:23:16 +0100	[thread overview]
Message-ID: <ec573511-8d0d-b2ed-1b50-ea3b0aad0d2c@redhat.com> (raw)
In-Reply-To: <1548097698-28951-5-git-send-email-aleksandar.markovic@rt-rk.com>

On 1/21/19 8:08 PM, Aleksandar Markovic wrote:
> From: Aleksandar Markovic <amarkovic@wavecomp.com>
> 
> "insn_flags" bitfield was expanded from 32-bit to 64-bit at one moment.

"at one moment" -> "in f9c9cd63e3"

> However, this was not reflected at the second argument of the function
> cpu_supports_isa(). By chance, this did not create a wrong behavior,
> since the second argument was always with the left-most half zero, but
> it is still a bug waiting to happen. correct by changint the type of
> the second argument to be 64-bit always.

Oops.

> 
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  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 03c03fd..fd22bd5 100644
> --- a/target/mips/cpu.h
> +++ b/target/mips/cpu.h
> @@ -1011,7 +1011,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 ceaa582..b660235 100644
> --- a/target/mips/translate.c
> +++ b/target/mips/translate.c
> @@ -29803,7 +29803,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;
> 

  reply	other threads:[~2019-01-21 20:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-21 19:08 [Qemu-devel] [PATCH 0/6] target/mips: Misc fixes Aleksandar Markovic
2019-01-21 19:08 ` [Qemu-devel] [PATCH 1/6] target/mips: nanoMIPS: Remove duplicate macro definitions Aleksandar Markovic
2019-01-21 20:19   ` Philippe Mathieu-Daudé
2019-01-21 19:08 ` [Qemu-devel] [PATCH 2/6] target/mips: nanoMIPS: Remove an unused macro Aleksandar Markovic
2019-01-21 20:19   ` Philippe Mathieu-Daudé
2019-01-21 19:08 ` [Qemu-devel] [PATCH 3/6] target/mips: nanoMIPS: Rename macros for extracting 3-bit GPR codes Aleksandar Markovic
2019-01-21 19:08 ` [Qemu-devel] [PATCH 4/6] target/mips: Correct the second argument type of cpu_supports_isa() Aleksandar Markovic
2019-01-21 20:23   ` Philippe Mathieu-Daudé [this message]
2019-01-21 19:08 ` [Qemu-devel] [PATCH 5/6] target/mips: Extend gen_scwp() functionality to support EVA Aleksandar Markovic
2019-01-21 19:08 ` [Qemu-devel] [PATCH 6/6] disas: nanoMIPS: Amend DSP instructions related comments Aleksandar Markovic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec573511-8d0d-b2ed-1b50-ea3b0aad0d2c@redhat.com \
    --to=philmd@redhat.com \
    --cc=aleksandar.markovic@rt-rk.com \
    --cc=amarkovic@wavecomp.com \
    --cc=arikalo@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=smarkovic@wavecomp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).