[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] Avoid cpu_physical_memory_rw() with a constant is_write argument



On Tue, Feb 18, 2020 at 6:57 PM Stefan Weil <sw@xxxxxxxxxxx> 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@xxxxxxxxxx>
> > Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
> > ---
> > Based-on: <20200218112457.22712-1-peter.maydell@xxxxxxxxxx>
> [...]
> > 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
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.