qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	QEMU Trivial <qemu-trivial@nongnu.org>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 2/2] register: fix incorrect read mask
Date: Sat, 11 Feb 2017 00:16:54 -0300	[thread overview]
Message-ID: <0bb2d93b-09c5-83f6-dbd1-90b940e96dba@amsat.org> (raw)
In-Reply-To: <CAKmqyKMYmNeOOogS4+yv14M2CWTbBNtBP0jnO0DQEuScSp8eYw@mail.gmail.com>


On 02/10/2017 07:19 PM, Alistair Francis wrote:
> On Mon, Feb 6, 2017 at 3:39 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>> The register_read() function expects a bitmask argument.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
> The functionality of these two patches looks good to me.
>
> I think it's weird that we convert the write function in one patch
> (when we add the function) and the read in another.
>
> I think both patches should just be squashed together. It's a pretty
> small change.
>
> Thanks,
>
> Alistair

Sure, will do in v2.

Thanks!

>
>> ---
>>  hw/core/register.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/core/register.c b/hw/core/register.c
>> index 12f4c1e62d..482e3f827a 100644
>> --- a/hw/core/register.c
>> +++ b/hw/core/register.c
>> @@ -213,6 +213,7 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
>>      RegisterInfoArray *reg_array = opaque;
>>      RegisterInfo *reg = NULL;
>>      uint64_t read_val;
>> +    uint64_t re;
>>      int i;
>>
>>      for (i = 0; i < reg_array->num_elements; i++) {
>> @@ -228,7 +229,10 @@ uint64_t register_read_memory(void *opaque, hwaddr addr,
>>          return 0;
>>      }
>>
>> -    read_val = register_read(reg, size * 8, reg_array->prefix,
>> +    /* Generate appropriate read enable mask */
>> +    re = register_enabled_mask(reg->data_size, size);
>> +
>> +    read_val = register_read(reg, re, reg_array->prefix,
>>                               reg_array->debug);
>>
>>      return extract64(read_val, 0, size * 8);
>> --
>> 2.11.0
>>
>>

  reply	other threads:[~2017-02-11  3:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 23:39 [Qemu-devel] [PATCH 0/2] register: fix incorrect read mask Philippe Mathieu-Daudé
2017-02-06 23:39 ` [Qemu-devel] [PATCH 1/2] register: inline register_enabled_mask Philippe Mathieu-Daudé
2017-02-06 23:39 ` [Qemu-devel] [PATCH 2/2] register: fix incorrect read mask Philippe Mathieu-Daudé
2017-02-10 22:19   ` Alistair Francis
2017-02-11  3:16     ` Philippe Mathieu-Daudé [this message]
2017-02-11  3:43     ` [Qemu-devel] [PATCH v2] " Philippe Mathieu-Daudé
2017-02-14  1:20       ` Alistair Francis

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=0bb2d93b-09c5-83f6-dbd1-90b940e96dba@amsat.org \
    --to=f4bug@amsat.org \
    --cc=alistair.francis@xilinx.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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 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).