configure: Define target access alignment in configure
PATCH 1/1 configure: Define target access alignment in configure
This patch moves the define of target access alignment earlier from target/foo/cpu.h to configure.
Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp"
--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)
configure +10 -2
@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in + alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) + target_aligned_only="yes" + ;; +esac target_bigendian="no" - case "$target_name" in armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) - target_bigendian=yes + target_bigendian="yes" ;; esac target_softmmu="no"
@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fi
include/exec/poison.h +1 -0
@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCG
include/qom/cpu.h +1 -1
@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed instead) * @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory transactions * (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which supports
target/alpha/cpu.h +0 -2
@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
target/hppa/cpu.h +0 -1
@@ -30,7 +30,6 @@basis. It's probably easier to fall back to a strong memory model. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4
target/mips/cpu.h +0 -2
@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h"
target/sh4/cpu.h +0 -2
@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)
target/sparc/cpu.h +0 -2
@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else
target/xtensa/cpu.h +0 -2
@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
tcg/tcg.c +1 -1
@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #else
tcg/tcg.h +5 -3
@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines ALIGNED_ONLY. +* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access.
@@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else
Signature · 1 line
2.17.2
Quoted 31 lines · On 7/18/19 8:01 AM, [email protected] wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)configure +2
-0@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in
configure for target in $target_list; do · line 7436
Quoted 10 lines
configure +5
-2+ alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) + target_aligned_only="yes" + ;; +esac target_bigendian="no" - case "$target_name" in armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) - target_bigendian=yes + target_bigendian="yes"
This change seems unrelated, good cleanup otherwise!
Quoted 157 lines
configure +3
-0;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +1
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +1
-1@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed instead) * @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory transactions * (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which supports target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)target/hppa/cpu.h +0
-1@@ -30,7 +30,6 @@basis. It's probably easier to fall back to a strong memory model. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)tcg/tcg.c +1
-1@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #elsetcg/tcg.h +5
-3@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines ALIGNED_ONLY. +* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access. @@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else
Paolo Bonzini
AppliedQuoted 190 lines · On 18/07/19 08:01, [email protected] wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)configure +10
-2@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in + alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) + target_aligned_only="yes" + ;; +esac target_bigendian="no" - case "$target_name" in armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb) - target_bigendian=yes + target_bigendian="yes" ;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +1
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +1
-1@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed instead) * @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory transactions * (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which supports target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)target/hppa/cpu.h +0
-1@@ -30,7 +30,6 @@basis. It's probably easier to fall back to a strong memory model. */ #define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)tcg/tcg.c +1
-1@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #elsetcg/tcg.h +4
-2@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines ALIGNED_ONLY. +* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access.
tcg/tcg.h typedef enum TCGMemOp { · line 361
Quoted 8 lines
tcg/tcg.h +1
-1@@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else
Queued for 4.2, thanks.
Paolo
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · On 18/07/19 08:01, [email protected] wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is
now
Quoted 17 lines
Quoted 17 lines
accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)
Quoted 11 lines
configure for target in $target_list; do · line 7429
Quoted 11 lines
configure +3
-0@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in +
alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb)
Quoted 7 lines
configure for target in $target_list; do
Quoted 7 lines
configure +3
-1+ target_aligned_only="yes" + ;; +esac target_bigendian="no" - case "$target_name" in
armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
Quoted 23 lines
Quoted 23 lines
configure +4
-1- target_bigendian=yes + target_bigendian="yes" ;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +0
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA
Quoted 11 lines
include/qom/cpu.h struct TranslationBlock; · line 90
Quoted 11 lines
include/exec/poison.h +1
-0+#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +0
-0@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed
instead)
Quoted 4 lines
include/qom/cpu.h struct TranslationBlock;
Quoted 4 lines
include/qom/cpu.h +1
-1* @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory
transactions
Quoted 2 lines
include/qom/cpu.h struct TranslationBlock; · line 95
Quoted 2 lines
include/qom/cpu.h +0
-0* (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which
supports
Quoted 13 lines
Quoted 13 lines
target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
Quoted 6 lines
target/hppa/cpu.h line 30
Quoted 6 lines
target/hppa/cpu.h +0
-0@@ -30,7 +30,6 @@ basis. It's probably easier to fall back to a strong memory
model. */
Quoted 58 lines
Quoted 58 lines
target/hppa/cpu.h +0
-1#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
Quoted 8 lines
tcg/tcg.c static const char * const ldst_name[] = · line 1928
Quoted 8 lines
tcg/tcg.c +0
-0@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ]
= {
Quoted 13 lines
Quoted 13 lines
tcg/tcg.c +1
-1-#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >> MO_ASHIFT] = "un+", [MO_ALIGN >> MO_ASHIFT] = "", #elsetcg/tcg.h +0
-0@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif
Quoted 6 lines
tcg/tcg.h typedef enum TCGMemOp {
Quoted 6 lines
tcg/tcg.h +2
-2-/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines
ALIGNED_ONLY.
Quoted 4 lines
tcg/tcg.h typedef enum TCGMemOp {
Quoted 4 lines
tcg/tcg.h +2
-0+* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is
aligned
Quoted 5 lines
Quoted 5 lines
tcg/tcg.h +0
-0* to a size more than the size of the memory access. @@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT =4 , MO_AMASK = 7 << MO_ASHIFT,
Quoted 9 lines
tcg/tcg.h typedef enum TCGMemOp { · line 361
Quoted 6 lines
tcg/tcg.h +1
-1-#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #elseQueued for 4.2, thanks.
Paolo, your queueing was premature, just hours after the submission, practically not allowing review to happen.
Please have some time cushion, and especially for the changes that affect multiple targets.
Thanks, Aleksandar
Quoted 2 lines
Paolo
Quoted 218 lines · Aleksandar Markovic
Quoted 6 lines · On Jul 18, 2019 11:55 AM, "Paolo Bonzini" <[email protected]…
Quoted 4 lines · On 18/07/19 08:01, [email protected] <mailto:[email protected]> wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp
is now
Quoted 3 lines
Quoted 3 lines
accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]<mailto:[email protected]>>
Quoted 14 lines
Quoted 14 lines
---
configure | 12 ++++++++++--
include/exec/poison.h| 1 +
include/qom/cpu.h | 2 +-
target/alpha/cpu.h | 2 --target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 --target/sparc/cpu.h | 2 --
target/xtensa/cpu.h | 2 --
tcg/tcg.c | 2 +-
tcg/tcg.h | 8 +++++---11 files changed, 18 insertions(+), 18 deletions(-)Quoted 11 lines
configure for target in $target_list; do
Quoted 11 lines
configure +0
-0@@ -7424,11 +7424,16 @@ for target in $target_list; dotarget_dir="$target"
config_target_mak=$target_dir/config-target.mak
target_name=$(echo $target | cut -d '-' -f 1)configure +3
-0+target_aligned_only="no" +case "$target_name" in +alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb)
Quoted 7 lines
Quoted 7 lines
+ target_aligned_only="yes"
+ ;;
+esac
target_bigendian="no"
-
case "$target_name" inarmeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
Quoted 26 lines
Quoted 26 lines
- target_bigendian=yes
+ target_bigendian="yes"
;;
esac
target_softmmu="no"configure +0
-0@@ -7710,6 +7715,9 @@ fiif
supported_whpx_target$target; then
echo "CONFIG_WHPX=y" >> $config_target_mak
ficonfigure +3
-0+if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fiif test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fi
include/exec/poison.h +0
-0@@ -35,6 +35,7 @@ #pragma GCC poison TARGET_UNICORE32 #pragma GCC poison TARGET_XTENSA
+#pragma GCC poisonTARGET_ALIGNED_ONLY
#pragma GCC poisonTARGET_HAS_BFLT
#pragma GCC poisonTARGET_NAMEQuoted 8 lines
include/qom/cpu.h struct TranslationBlock; · line 90
Quoted 8 lines
#pragma GCC poison
TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +0
-0@@ -89,7 +89,7 @@ struct TranslationBlock; * @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use
do_transaction_failedinstead)Quoted 4 lines
include/qom/cpu.h struct TranslationBlock;
Quoted 4 lines
include/qom/cpu.h +1
-1* @do_unaligned_access: Callback for unaligned access handling, if - * the target defines #ALIGNED_ONLY. + * the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memorytransactions
Quoted 2 lines
include/qom/cpu.h struct TranslationBlock; · line 95
Quoted 2 lines
include/qom/cpu.h +0
-0* (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU whichsupports
Quoted 11 lines
Quoted 11 lines
target/alpha/cpu.h +0
-0@@ -23,8 +23,6 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h"target/alpha/cpu.h +0
-2-#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */
Quoted 8 lines
Quoted 8 lines
#define TCG_GUEST_DEFAULT_MO (0)
target/hppa/cpu.h +0
-0@@ -30,7 +30,6 @@basis. It's probably easier to fall back to a strong memory
model. */
Quoted 58 lines
Quoted 58 lines
#define TCG_GUEST_DEFAULT_MO
TCG_MO_ALL
-#defineALIGNED_ONLY
#define MMU_KERNEL_IDX 0
#define MMU_USER_IDX 3
#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-0@@ -1,8 +1,6 @@ #ifndef MIPS_CPU_H #define MIPS_CPU_Htarget/mips/cpu.h +0
-2-#define ALIGNED_ONLY -#include "
cpu-qom.h"
#include "exec/cpu-defs.h"
#include "fpu/softfloat.h"target/sh4/cpu.h +0
-0@@ -23,8 +23,6 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h"target/sh4/cpu.h +0
-2-#define ALIGNED_ONLY -/* CPU Subtypes */
#define SH_CPU_SH7750 (1 << 0)
#defineSH_CPU_SH7750S(1 << 1)target/sparc/cpu.h +0
-0@@ -5,8 +5,6 @@ #include "cpu-qom.h" #include "exec/cpu-defs.h"target/sparc/cpu.h +0
-2-#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64)
#defineTARGET_DPREGS16
#elsetarget/xtensa/cpu.h +0
-0@@ -32,8 +32,6 @@ #include "exec/cpu-defs.h" #include "xtensa-isa.h"target/xtensa/cpu.h +0
-2-#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)
Quoted 8 lines
Quoted 8 lines
tcg/tcg.c +0
-0@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };
static const char * const alignment_name[(MO_AMASK >>MO_ASHIFT) +1] = {
Quoted 11 lines
Quoted 11 lines
tcg/tcg.c +1
-1-#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [
MO_UNALN>> MO_ASHIFT] = "un+",
[MO_ALIGN>> MO_ASHIFT] = "",
#elsetcg/tcg.h +0
-0@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,Quoted 8 lines
Quoted 8 lines
tcg/tcg.h +0
-0#endif
- /*MO_UNALNaccesses are never checked for alignment. + /*
+ *MO_UNALNaccesses are never checked for alignment.
*MO_ALIGNaccesses will result in a call to the CPU's
*do_unaligned_accesshook if the guest address is not aligned. - * The default depends on whether the target CPU defines
ALIGNED_ONLY.Quoted 4 lines
Quoted 4 lines
+ * The default depends on whether the target CPU defines + *
TARGET_ALIGNED_ONLY.
*
* Some architectures (e.g. ARMv8) need the address which isaligned
Quoted 5 lines
Quoted 5 lines
* to a size more than the size of the memory access.
tcg/tcg.h +0
-0@@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT,Quoted 9 lines
tcg/tcg.h typedef enum TCGMemOp { · line 361
Quoted 6 lines
tcg/tcg.h +1
-1-#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN = 0, MO_UNALN = MO_AMASK, #elseQueued for 4.2, thanks.
Quoted 5 lines
Paolo, your queueing was premature, just hours after the submission, practically not allowing review to happen.
Please have some time cushion, and especially for the changes that affect multiple targets.
It's for 4.2, so there's weeks before the queuing transforms into a pull request.
Paolo
Quoted 7 lines · On 7/17/19 11:01 PM, [email protected] wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is now accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>
Quoted 13 lines
--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)
Thanks for this.
r~
Quoted 5 lines · On Jul 18, 2019 8:02 AM, <[email protected]> wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is
now
Quoted 4 lines
accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>---
Tony,
No matter how small the change is, while sending patches, you must cc corresponding maintainers, if your change includes the code in files they maintain.
Thanks, Aleksandar
Quoted 18 lines
configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)configure +0
-0
configure for target in $target_list; do · line 7429
Quoted 6 lines
configure +3
-0@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in +
alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) > + target_aligned_only="yes" > + ;;
configure for target in $target_list; do
Quoted 5 lines
configure +1
-1+esac target_bigendian="no" - case "$target_name" in
armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
Quoted 32 lines
configure +4
-1- target_bigendian=yes + target_bigendian="yes" ;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +1
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +0
-0
include/qom/cpu.h struct TranslationBlock; · line 90
Quoted 2 lines
include/qom/cpu.h +0
-0@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed
instead)
include/qom/cpu.h struct TranslationBlock;
Quoted 4 lines
include/qom/cpu.h +1
-1* @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory
transactions
include/qom/cpu.h struct TranslationBlock; · line 95
Quoted 2 lines
include/qom/cpu.h +0
-0* (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which
supports
Quoted 18 lines
target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)target/hppa/cpu.h +0
-0
target/hppa/cpu.h line 30
Quoted 1 line
target/hppa/cpu.h +0
-0@@ -30,7 +30,6 @@ basis. It's probably easier to fall back to a strong memory model.
*/
Quoted 76 lines
target/hppa/cpu.h +0
-1#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)tcg/tcg.c +1
-1@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #elsetcg/tcg.h +0
-0
tcg/tcg.h typedef enum TCGMemOp { · line 339
Quoted 9 lines
tcg/tcg.h +2
-2@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines
ALIGNED_ONLY.
Quoted 18 lines
tcg/tcg.h +3
-2+* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access. @@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else --2.17.2
Quoted 5 lines · On Jul 18, 2019 8:02 AM, <[email protected]> wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is
now
Quoted 22 lines
accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>--- configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)configure +0
-0
configure for target in $target_list; do · line 7429
Quoted 6 lines
configure +3
-0@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in +
alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) > + target_aligned_only="yes" > + ;;
configure for target in $target_list; do
Quoted 5 lines
configure +1
-1+esac target_bigendian="no" - case "$target_name" in
armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
configure for target in $target_list; do · line 7436
Quoted 2 lines
configure +1
-1- target_bigendian=yes + target_bigendian="yes"
This line should be in a separate patch. What is the difference between yes and “yes”? Does this fix a bug, or is just a cosmetic thing?
Thanks, Aleksandar
Quoted 30 lines
configure +3
-0;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +1
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +0
-0
include/qom/cpu.h struct TranslationBlock; · line 90
Quoted 2 lines
include/qom/cpu.h +0
-0@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed
instead)
include/qom/cpu.h struct TranslationBlock;
Quoted 4 lines
include/qom/cpu.h +1
-1* @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory
transactions
include/qom/cpu.h struct TranslationBlock; · line 95
Quoted 2 lines
include/qom/cpu.h +0
-0* (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which
supports
Quoted 18 lines
target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)target/hppa/cpu.h +0
-0
target/hppa/cpu.h line 30
Quoted 1 line
target/hppa/cpu.h +0
-0@@ -30,7 +30,6 @@ basis. It's probably easier to fall back to a strong memory model.
*/
Quoted 76 lines
target/hppa/cpu.h +0
-1#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)tcg/tcg.c +1
-1@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #elsetcg/tcg.h +0
-0
tcg/tcg.h typedef enum TCGMemOp { · line 339
Quoted 9 lines
tcg/tcg.h +2
-2@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines
ALIGNED_ONLY.
Quoted 18 lines
tcg/tcg.h +3
-2+* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access. @@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else --2.17.2
Quoted 5 lines · On Jul 18, 2019 8:02 AM, <[email protected]> wrote:
This patch moves the define of target access alignment earlier from
target/foo/cpu.hto configure.Suggested in Richard Henderson's reply to "[PATCH 1/4] tcg: TCGMemOp is
now
Quoted 4 lines
accelerator independent MemOp"
Signed-off-by Tony Nguyen <[email protected]>---
Hi, Tony.
In this patch you considered ALIGNED_ONLY, and proposed improvement. Do you see in the related code other preprocessor constants that should be treated in a similar way? If yes, perhaps we should do the same for them. Please analyse a little more.
Yours, Aleksandar
Quoted 18 lines
configure | 12 ++++++++++-- include/exec/poison.h | 1 + include/qom/cpu.h | 2 +- target/alpha/cpu.h | 2 -- target/hppa/cpu.h | 1 - target/mips/cpu.h | 2 -- target/sh4/cpu.h | 2 -- target/sparc/cpu.h | 2 -- target/xtensa/cpu.h | 2 -- tcg/tcg.c | 2 +- tcg/tcg.h | 8 +++++--- 11 files changed, 18 insertions(+), 18 deletions(-)configure +0
-0
configure for target in $target_list; do · line 7429
Quoted 6 lines
configure +3
-0@@ -7424,11 +7424,16 @@ for target in $target_list; do target_dir="$target" config_target_mak=$target_dir/config-target.mak target_name=$(echo $target | cut -d '-' -f 1) +target_aligned_only="no" +case "$target_name" in +
alpha|hppa|mips64el|mips64|mipsel|mips|mipsn32|mipsn32el|sh4|sh4eb|sparc|sparc64|sparc32plus|xtensa|xtensaeb) > + target_aligned_only="yes" > + ;;
configure for target in $target_list; do
Quoted 5 lines
configure +1
-1+esac target_bigendian="no" - case "$target_name" in
armeb|aarch64_be|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or1k|ppc|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
Quoted 32 lines
configure +4
-1- target_bigendian=yes + target_bigendian="yes" ;; esac target_softmmu="no"@@ -7710,6 +7715,9 @@ fi if supported_whpx_target $target; then echo "CONFIG_WHPX=y" >> $config_target_mak fi +if test "$target_aligned_only" = "yes" ; then + echo "TARGET_ALIGNED_ONLY=y" >> $config_target_mak +fi if test "$target_bigendian" = "yes" ; then echo "TARGET_WORDS_BIGENDIAN=y" >> $config_target_mak fiinclude/exec/poison.h +1
-0@@ -35,6 +35,7 @@#pragma GCC poison TARGET_UNICORE32#pragma GCC poison TARGET_XTENSA +#pragma GCC poison TARGET_ALIGNED_ONLY#pragma GCC poison TARGET_HAS_BFLT#pragma GCC poison TARGET_NAME#pragma GCC poison TARGET_SUPPORTS_MTTCGinclude/qom/cpu.h +0
-0
include/qom/cpu.h struct TranslationBlock; · line 90
Quoted 2 lines
include/qom/cpu.h +0
-0@@ -89,7 +89,7 @@ struct TranslationBlock;* @do_unassigned_access: Callback for unassigned access handling. * (this is deprecated: new targets should use do_transaction_failed
instead)
include/qom/cpu.h struct TranslationBlock;
Quoted 4 lines
include/qom/cpu.h +1
-1* @do_unaligned_access: Callback for unaligned access handling, if -* the target defines #ALIGNED_ONLY. +* the target defines #TARGET_ALIGNED_ONLY. * @do_transaction_failed: Callback for handling failed memory
transactions
include/qom/cpu.h struct TranslationBlock; · line 95
Quoted 2 lines
include/qom/cpu.h +0
-0* (ie bus faults or external aborts; not MMU faults) * @virtio_is_big_endian: Callback to return %true if a CPU which
supports
Quoted 18 lines
target/alpha/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* Alpha processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)target/hppa/cpu.h +0
-0
target/hppa/cpu.h line 30
Quoted 1 line
target/hppa/cpu.h +0
-0@@ -30,7 +30,6 @@ basis. It's probably easier to fall back to a strong memory model.
*/
Quoted 76 lines
target/hppa/cpu.h +0
-1#define TCG_GUEST_DEFAULT_MO TCG_MO_ALL -#define ALIGNED_ONLY #define MMU_KERNEL_IDX 0#define MMU_USER_IDX 3#define MMU_PHYS_IDX 4target/mips/cpu.h +0
-2@@ -1,8 +1,6 @@#ifndef MIPS_CPU_H #define MIPS_CPU_H -#define ALIGNED_ONLY -#include "cpu-qom.h" #include "exec/cpu-defs.h" #include "fpu/softfloat.h" target/sh4/cpu.h +0
-2@@ -23,8 +23,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -/* CPU Subtypes */ #define SH_CPU_SH7750 (1 << 0)#define SH_CPU_SH7750S (1 << 1)target/sparc/cpu.h +0
-2@@ -5,8 +5,6 @@#include "cpu-qom.h" #include "exec/cpu-defs.h" -#define ALIGNED_ONLY -#if !defined(TARGET_SPARC64 )#define TARGET_DPREGS 16#else target/xtensa/cpu.h +0
-2@@ -32,8 +32,6 @@#include "exec/cpu-defs.h" #include "xtensa-isa.h" -#define ALIGNED_ONLY -/* Xtensa processors have a weak memory model */ #define TCG_GUEST_DEFAULT_MO (0)tcg/tcg.c +1
-1@@ -1926,7 +1926,7 @@ static const char * const ldst_name[] = };static const char *const alignment_name[(MO_AMASK >>MO_ASHIFT ) +1 ] = { -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY [MO_UNALN >>MO_ASHIFT ] ="un+" , [MO_ALIGN >>MO_ASHIFT ] ="" , #elsetcg/tcg.h +0
-0
tcg/tcg.h typedef enum TCGMemOp { · line 339
Quoted 9 lines
tcg/tcg.h +2
-2@@ -333,10 +333,12 @@ typedef enum TCGMemOp { MO_TE = MO_LE,#endif -/* MO_UNALN accesses are never checked for alignment. +/* +* MO_UNALN accesses are never checked for alignment. * MO_ALIGN accesses will result in a call to the CPU's * do_unaligned_access hook if the guest address is not aligned. -* The default depends on whether the target CPU defines
ALIGNED_ONLY.
Quoted 18 lines
tcg/tcg.h +3
-2+* The default depends on whether the target CPU defines +* TARGET_ALIGNED_ONLY. * * Some architectures (e.g. ARMv8) need the address which is aligned * to a size more than the size of the memory access. @@ -353,7 +355,7 @@ typedef enum TCGMemOp {*/ MO_ASHIFT = 4, MO_AMASK = 7 << MO_ASHIFT, -#ifdef ALIGNED_ONLY +#ifdef TARGET_ALIGNED_ONLY MO_ALIGN =0 , MO_UNALN = MO_AMASK, #else --2.17.2