Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-20 Thread Paolo Bonzini
On 18/02/20 14:13, Laurent Vivier wrote: > There is one in target/i386/hvf/vmx.h: macvm_set_cr0() you didn't change. > > You must update the script name in the script comment (as suggested by > Philippe) and in the commit message. > > Anyway: > > Reviewed-by: Laurent Vivier Thanks, I squashed

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-20 Thread Philippe Mathieu-Daudé
On 2/18/20 1:56 PM, Philippe Mathieu-Daudé wrote: On 2/18/20 12:24 PM, Peter Maydell wrote: The address_space_rw() function allows either reads or writes depending on the is_write argument passed to it; this is useful when the direction of the access is determined programmatically (as for instan

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Edgar E. Iglesias
On Tue, Feb 18, 2020 at 11:24:57AM +, Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread David Gibson
On Tue, Feb 18, 2020 at 11:24:57AM +, Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Alistair Francis
On Tue, Feb 18, 2020 at 3:25 AM Peter Maydell wrote: > > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM_EXIT_M

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Cornelia Huck
On Tue, 18 Feb 2020 11:24:57 + Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM_EXIT

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Christian Borntraeger
On 18.02.20 12:24, Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM_EXIT_MMIO exit reas

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Peter Maydell
On Tue, 18 Feb 2020 at 13:33, Eric Blake wrote: > > On 2/18/20 6:56 AM, Philippe Mathieu-Daudé wrote: > > >> +++ b/scripts/coccinelle/as_rw_const.cocci > >> @@ -0,0 +1,30 @@ > >> +// Avoid uses of address_space_rw() with a constant is_write argument. > >> +// Usage: > >> +// spatch --sp-file as-r

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Eric Blake
On 2/18/20 6:56 AM, Philippe Mathieu-Daudé wrote: +++ b/scripts/coccinelle/as_rw_const.cocci @@ -0,0 +1,30 @@ +// Avoid uses of address_space_rw() with a constant is_write argument. +// Usage: +//  spatch --sp-file as-rw-const.spatch --dir . --in-place Nitpick, script is now scripts/coccinelle

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Cédric Le Goater
On 2/18/20 12:24 PM, Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM_EXIT_MMIO exit reaso

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Peter Maydell
On Tue, 18 Feb 2020 at 13:14, Laurent Vivier wrote: > There is one in target/i386/hvf/vmx.h: macvm_set_cr0() you didn't change. It turns out that "spatch --dir ." only looks at .c files, and you need to add --include-headers to get it to look at .h files too. The only extra change is this one: d

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Laurent Vivier
On 18/02/2020 12:24, Peter Maydell wrote: > The address_space_rw() function allows either reads or writes > depending on the is_write argument passed to it; this is useful > when the direction of the access is determined programmatically > (as for instance when handling the KVM_EXIT_MMIO exit reaso

Re: [PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Philippe Mathieu-Daudé
On 2/18/20 12:24 PM, Peter Maydell wrote: The address_space_rw() function allows either reads or writes depending on the is_write argument passed to it; this is useful when the direction of the access is determined programmatically (as for instance when handling the KVM_EXIT_MMIO exit reason). Un

[PATCH v2] Avoid address_space_rw() with a constant is_write argument

2020-02-18 Thread Peter Maydell
The address_space_rw() function allows either reads or writes depending on the is_write argument passed to it; this is useful when the direction of the access is determined programmatically (as for instance when handling the KVM_EXIT_MMIO exit reason). Under the hood it just calls either address_sp