[Qemu-devel] [PATCH v5 03/15] target/mips: Access MemoryRegion with MemOp

tony.nguyen@bt.com posted 15 patches 6 years, 6 months ago
Maintainers: Collin Walling <walling@linux.ibm.com>, Aleksandar Rikalo <arikalo@wavecomp.com>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Richard Henderson <rth@twiddle.net>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Aleksandar Markovic <amarkovic@wavecomp.com>, Halil Pasic <pasic@linux.ibm.com>, "Michael S. Tsirkin" <mst@redhat.com>, Stafford Horne <shorne@gmail.com>, Stefan Hajnoczi <stefanha@redhat.com>, Sagar Karandikar <sagark@eecs.berkeley.edu>, Christian Borntraeger <borntraeger@de.ibm.com>, Peter Maydell <peter.maydell@linaro.org>, Laurent Vivier <laurent@vivier.eu>, Andrzej Zaborowski <balrogg@gmail.com>, Palmer Dabbelt <palmer@sifive.com>, Alex Williamson <alex.williamson@redhat.com>, Claudio Fontana <claudio.fontana@huawei.com>, Cornelia Huck <cohuck@redhat.com>, Artyom Tarasenko <atar4qemu@gmail.com>, David Hildenbrand <david@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Aurelien Jarno <aurelien@aurel32.net>
There is a newer version of this series
[Qemu-devel] [PATCH v5 03/15] target/mips: Access MemoryRegion with MemOp
Posted by tony.nguyen@bt.com 6 years, 6 months ago
No-op SIZE_MEMOP macro allows us to later easily convert
memory_region_dispatch_{read|write} paramter "unsigned size" into a
size+sign+endianness encoded "MemOp op".

Being a no-op macro, this patch does not introduce any logical change.

Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 target/mips/op_helper.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c
index 9e2e02f..dccb8df 100644
--- a/target/mips/op_helper.c
+++ b/target/mips/op_helper.c
@@ -24,6 +24,7 @@
 #include "exec/helper-proto.h"
 #include "exec/exec-all.h"
 #include "exec/cpu_ldst.h"
+#include "exec/memop.h"
 #include "sysemu/kvm.h"

 /*****************************************************************************/
@@ -4740,11 +4741,11 @@ void helper_cache(CPUMIPSState *env, target_ulong addr, uint32_t op)
     if (op == 9) {
         /* Index Store Tag */
         memory_region_dispatch_write(env->itc_tag, index, env->CP0_TagLo,
-                                     8, MEMTXATTRS_UNSPECIFIED);
+                                     SIZE_MEMOP(8), MEMTXATTRS_UNSPECIFIED);
     } else if (op == 5) {
         /* Index Load Tag */
         memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo,
-                                    8, MEMTXATTRS_UNSPECIFIED);
+                                    SIZE_MEMOP(8), MEMTXATTRS_UNSPECIFIED);
     }
 #endif
 }
--
1.8.3.1



Re: [Qemu-devel] [PATCH v5 03/15] target/mips: Access MemoryRegion with MemOp
Posted by Richard Henderson 6 years, 6 months ago
On 7/25/19 11:44 PM, tony.nguyen@bt.com wrote:
>          memory_region_dispatch_read(env->itc_tag, index, &env->CP0_TagLo,
> -                                    8, MEMTXATTRS_UNSPECIFIED);
> +                                    SIZE_MEMOP(8), MEMTXATTRS_UNSPECIFIED);

As an example of why I'm not especially keen on the temporary incorrect
implementation of size_memop, you'll need a second pass through these files to
replace this with the proper MO_64.

That said,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~