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

2020-02-20 Thread Paolo Bonzini
On 18/02/20 19:49, Peter Maydell wrote: > Depending on which way we go we would either want to remove these > casts, or not. > > I guess that we have more cases of 'void*', and that would > certainly be the easier way to convert (otherwise we probably > need to add a bunch of new casts to

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

2020-02-18 Thread Peter Maydell
On Tue, 18 Feb 2020 at 20:07, Philippe Mathieu-Daudé wrote: > I don't understand well cpu_physical_memory*(). Aren't these obsolete? > They confuse me when using multi-core CPUs. They sort of are, but there is no simple mechanical replacement for them -- you need to look at the individual use to

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

2020-02-18 Thread Philippe Mathieu-Daudé
On 2/18/20 7:49 PM, Peter Maydell wrote: On Tue, 18 Feb 2020 at 17:57, Stefan Weil 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 Signed-off-by:

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

2020-02-18 Thread Richard Henderson
On 2/18/20 10:59 AM, Stefan Weil wrote: > Personally I like the way how the standard C library handles such > pointers for functions like memcpy, fread, fwrite and others. > > Therefore I suggest to use `const void *` and `void *` and to avoid type > casts. Seconded. r~

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

2020-02-18 Thread Stefan Weil
Am 18.02.20 um 19:59 schrieb Stefan Weil: > Indeed, fixing such inconsitencies would be good. s/inconsitencies/inconsistencies/ :-) ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

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

2020-02-18 Thread Stefan Weil
Am 18.02.20 um 19:49 schrieb Peter Maydell: > I think that we should fix the inconsistency where these functions > all take "uint8_t* buf": > > - address_space_rw() > - address_space_read() > - address_space_write() > - address_space_write_rom() > - cpu_physical_memory_rw() > -

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

2020-02-18 Thread Peter Maydell
On Tue, 18 Feb 2020 at 17:57, Stefan Weil 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 > > Signed-off-by: Philippe Mathieu-Daudé > >

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

2020-02-18 Thread Philippe Mathieu-Daudé
On Tue, Feb 18, 2020 at 6:57 PM Stefan Weil 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 > > Signed-off-by: Philippe Mathieu-Daudé > >

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

2020-02-18 Thread Stefan Weil
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 > Signed-off-by: Philippe Mathieu-Daudé > --- > Based-on: <20200218112457.22712-1-peter.mayd...@linaro.org>

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

2020-02-18 Thread Richard Henderson
On 2/18/20 5:20 AM, Philippe Mathieu-Daudé wrote: > This commit was produced with the included Coccinelle script > scripts/coccinelle/as-rw-const.patch. > > Inspired-by: Peter Maydell > Signed-off-by: Philippe Mathieu-Daudé > --- > Based-on: <20200218112457.22712-1-peter.mayd...@linaro.org>

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

2020-02-18 Thread Philippe Mathieu-Daudé
This commit was produced with the included Coccinelle script scripts/coccinelle/as-rw-const.patch. Inspired-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- Based-on: <20200218112457.22712-1-peter.mayd...@linaro.org> Maybe can be squashed in Peter's patch? Cocci script can be