[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 08/34] cputlb: Replace SHIFT with DATA_SIZE
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [PATCH v3 08/34] cputlb: Replace SHIFT with DATA_SIZE |
Date: |
Mon, 12 Sep 2016 15:22:19 +0100 |
User-agent: |
mu4e 0.9.17; emacs 25.1.12 |
Richard Henderson <address@hidden> writes:
> Signed-off-by: Richard Henderson <address@hidden>
Reviewed-by: Alex Bennée <address@hidden>
> ---
> cputlb.c | 16 ++++++++--------
> softmmu_template.h | 7 ++-----
> 2 files changed, 10 insertions(+), 13 deletions(-)
>
> diff --git a/cputlb.c b/cputlb.c
> index d068ee5..cf68211 100644
> --- a/cputlb.c
> +++ b/cputlb.c
> @@ -529,16 +529,16 @@ static bool victim_tlb_hit(CPUArchState *env, size_t
> mmu_idx, size_t index,
>
> #define MMUSUFFIX _mmu
>
> -#define SHIFT 0
> +#define DATA_SIZE 1
> #include "softmmu_template.h"
>
> -#define SHIFT 1
> +#define DATA_SIZE 2
> #include "softmmu_template.h"
>
> -#define SHIFT 2
> +#define DATA_SIZE 4
> #include "softmmu_template.h"
>
> -#define SHIFT 3
> +#define DATA_SIZE 8
> #include "softmmu_template.h"
> #undef MMUSUFFIX
>
> @@ -549,14 +549,14 @@ static bool victim_tlb_hit(CPUArchState *env, size_t
> mmu_idx, size_t index,
> #define GETRA() ((uintptr_t)0)
> #define SOFTMMU_CODE_ACCESS
>
> -#define SHIFT 0
> +#define DATA_SIZE 1
> #include "softmmu_template.h"
>
> -#define SHIFT 1
> +#define DATA_SIZE 2
> #include "softmmu_template.h"
>
> -#define SHIFT 2
> +#define DATA_SIZE 4
> #include "softmmu_template.h"
>
> -#define SHIFT 3
> +#define DATA_SIZE 8
> #include "softmmu_template.h"
> diff --git a/softmmu_template.h b/softmmu_template.h
> index 284ab2c..3c56df1 100644
> --- a/softmmu_template.h
> +++ b/softmmu_template.h
> @@ -25,8 +25,6 @@
> #include "exec/address-spaces.h"
> #include "exec/memory.h"
>
> -#define DATA_SIZE (1 << SHIFT)
> -
> #if DATA_SIZE == 8
> #define SUFFIX q
> #define LSUFFIX q
> @@ -134,7 +132,7 @@ static inline DATA_TYPE glue(io_read,
> SUFFIX)(CPUArchState *env,
> }
>
> cpu->mem_io_vaddr = addr;
> - memory_region_dispatch_read(mr, physaddr, &val, 1 << SHIFT,
> + memory_region_dispatch_read(mr, physaddr, &val, DATA_SIZE,
> iotlbentry->attrs);
> return val;
> }
> @@ -321,7 +319,7 @@ static inline void glue(io_write, SUFFIX)(CPUArchState
> *env,
>
> cpu->mem_io_vaddr = addr;
> cpu->mem_io_pc = retaddr;
> - memory_region_dispatch_write(mr, physaddr, val, 1 << SHIFT,
> + memory_region_dispatch_write(mr, physaddr, val, DATA_SIZE,
> iotlbentry->attrs);
> }
>
> @@ -512,7 +510,6 @@ void probe_write(CPUArchState *env, target_ulong addr,
> int mmu_idx,
> #endif /* !defined(SOFTMMU_CODE_ACCESS) */
>
> #undef READ_ACCESS_TYPE
> -#undef SHIFT
> #undef DATA_TYPE
> #undef SUFFIX
> #undef LSUFFIX
--
Alex Bennée
- [Qemu-devel] [PATCH v3 04/34] int128: Use __int128 if available, (continued)
- [Qemu-devel] [PATCH v3 04/34] int128: Use __int128 if available, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 09/34] cputlb: Move probe_write out of softmmu_template.h, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 12/34] cputlb: Tidy some macros, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 03/34] exec: Avoid direct references to Int128 parts, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 08/34] cputlb: Replace SHIFT with DATA_SIZE, Richard Henderson, 2016/09/03
- Re: [Qemu-devel] [PATCH v3 08/34] cputlb: Replace SHIFT with DATA_SIZE,
Alex Bennée <=
- [Qemu-devel] [PATCH v3 10/34] cputlb: Remove includes from softmmu_template.h, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 16/34] target-i386: emulate LOCK'ed cmpxchg using cmpxchg helpers, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 14/34] tcg: Add atomic128 helpers, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 18/34] target-i386: emulate LOCK'ed INC using atomic helper, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 17/34] target-i386: emulate LOCK'ed OP instructions using atomic helpers, Richard Henderson, 2016/09/03
- [Qemu-devel] [PATCH v3 13/34] tcg: Add atomic helpers, Richard Henderson, 2016/09/03