All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Laurent Desnogues <laurent.desnogues@gmail.com>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [PATCH v3] target/arm: Use correct variable for setting 'max' cpu's MIDR_EL1
Date: Thu, 30 Apr 2020 18:46:28 +0200	[thread overview]
Message-ID: <e904ba34-3a8d-8a69-68cf-6758f3bda1d4@amsat.org> (raw)
In-Reply-To: <CAFEAcA8RymJaowHcp1_Er_GghPAzMV6RTP7jgxNVmZEvR5ssbg@mail.gmail.com>

On 4/30/20 5:59 PM, Peter Maydell wrote:
> On Tue, 28 Apr 2020 at 18:26, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> MIDR_EL1 a 64-bit system register with the top 32-bit being RES0.
>>
>> This fixes when compiling with -Werror=conversion:
>>
>>    target/arm/cpu64.c: In function ‘aarch64_max_initfn’:
>>    target/arm/cpu64.c:628:21: error: conversion from ‘uint64_t’ {aka ‘long unsigned int’} to ‘uint32_t’ {aka ‘unsigned int’} may change value [-Werror=conversion]
>>      628 |         cpu->midr = t;
>>          |                     ^
>>
>> Suggested-by: Laurent Desnogues <laurent.desnogues@gmail.com>
>> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> 
> Applied to target-arm.next, with the commit message fixed
> up to match the patch contents:
> 
>      target/arm: Use uint64_t for midr field in CPU state struct
> 
>      MIDR_EL1 is a 64-bit system register with the top 32-bit being RES0.
>      Represent it in QEMU's ARMCPU struct with a uint64_t, not a
>      uint32_t.
> 
>      This fixes an error when compiling with -Werror=conversion
>      because we were manipulating the register value using a
>      local uint64_t variable:
> 
>        target/arm/cpu64.c: In function ‘aarch64_max_initfn’:
>        target/arm/cpu64.c:628:21: error: conversion from ‘uint64_t’
> {aka ‘long unsigned int’} to ‘uint32_t      ’ {aka ‘unsigned int’} may
> change value [-Werror=conversion]
>          628 |         cpu->midr = t;
>              |                     ^
> 
>      and future-proofs us against a possible future architecture
>      change using some of the top 32 bits.

Thanks Peter for updating the description.

> 
> thanks
> -- PMM
> 


      reply	other threads:[~2020-04-30 16:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 17:26 [PATCH v3] target/arm: Use correct variable for setting 'max' cpu's MIDR_EL1 Philippe Mathieu-Daudé
2020-04-29  6:17 ` Laurent Desnogues
2020-04-30 15:59 ` Peter Maydell
2020-04-30 16:46   ` Philippe Mathieu-Daudé [this message]

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=e904ba34-3a8d-8a69-68cf-6758f3bda1d4@amsat.org \
    --to=f4bug@amsat.org \
    --cc=laurent.desnogues@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.