qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Paul Durrant <paul@xen.org>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"open list:X86" <xen-devel@lists.xenproject.org>,
	Anthony Perard <anthony.perard@citrix.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argument
Date: Tue, 18 Feb 2020 19:13:14 +0100	[thread overview]
Message-ID: <CAP+75-W5kdPAz0HZqz+XxRg3RfkosFG4ptcu3o_jYBE26ZhkQw@mail.gmail.com> (raw)
In-Reply-To: <87e06de3-179b-54a1-3451-39a0a30b65f0@weilnetz.de>

On Tue, Feb 18, 2020 at 6:57 PM Stefan Weil <sw@weilnetz.de> wrote:
> Am 18.02.20 um 14:20 schrieb Philippe Mathieu-Daudé:
>
> > This commit was produced with the included Coccinelle script
> > scripts/coccinelle/as-rw-const.patch.
> >
> > Inspired-by: Peter Maydell <peter.maydell@linaro.org>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> > ---
> > Based-on: <20200218112457.22712-1-peter.maydell@linaro.org>
> [...]
> > diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
> > index a8b6e5aeb8..f5971ccc74 100644
> > --- a/target/i386/hax-all.c
> > +++ b/target/i386/hax-all.c
> > @@ -376,8 +376,8 @@ static int hax_handle_fastmmio(CPUArchState *env, struct hax_fastmmio *hft)
> >           *  hft->direction == 2: gpa ==> gpa2
> >           */
> >          uint64_t value;
> > -        cpu_physical_memory_rw(hft->gpa, (uint8_t *) &value, hft->size, 0);
> > -        cpu_physical_memory_rw(hft->gpa2, (uint8_t *) &value, hft->size, 1);
> > +        cpu_physical_memory_read(hft->gpa, (uint8_t *)&value, hft->size);
> > +        cpu_physical_memory_write(hft->gpa2, (uint8_t *)&value, hft->size);
>
>
> Maybe those type casts could be removed, too. They are no longer needed
> after your modification.

Good catch, thanks Stefan!

>
> Stefan
>
>



  reply	other threads:[~2020-02-18 18:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 13:20 [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argument Philippe Mathieu-Daudé
2020-02-18 17:39 ` Richard Henderson
2020-02-18 17:57 ` Stefan Weil
2020-02-18 18:13   ` Philippe Mathieu-Daudé [this message]
2020-02-18 18:49   ` Peter Maydell
2020-02-18 18:59     ` Stefan Weil
2020-02-18 19:00       ` Stefan Weil
2020-02-18 19:14       ` Richard Henderson
2020-02-18 20:07     ` Philippe Mathieu-Daudé
2020-02-18 21:16       ` Peter Maydell
2020-02-20 11:32     ` Paolo Bonzini

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=CAP+75-W5kdPAz0HZqz+XxRg3RfkosFG4ptcu3o_jYBE26ZhkQw@mail.gmail.com \
    --to=philmd@redhat.com \
    --cc=anthony.perard@citrix.com \
    --cc=ehabkost@redhat.com \
    --cc=paul@xen.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sstabellini@kernel.org \
    --cc=sw@weilnetz.de \
    --cc=xen-devel@lists.xenproject.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).