* [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks @ 2013-06-04 16:58 Richard Henderson 2013-06-04 16:58 ` [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS Richard Henderson ` (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Richard Henderson @ 2013-06-04 16:58 UTC (permalink / raw) To: qemu-devel; +Cc: aurelien Reviewing the tcg/aarch64 patch set, and comparing that to existing hosts made me remember that I've wanted to do this for quite some time. r~ Richard Henderson (2): tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS tcg: Remove redundant tcg_target_init checks include/exec/cpu-defs.h | 2 +- tcg/arm/tcg-target.c | 6 ------ tcg/i386/tcg-target.c | 6 ------ tcg/s390/tcg-target.c | 7 ------- 4 files changed, 1 insertion(+), 20 deletions(-) -- 1.8.1.4 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS 2013-06-04 16:58 [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks Richard Henderson @ 2013-06-04 16:58 ` Richard Henderson 2013-06-05 1:37 ` li guang 2013-06-04 16:58 ` [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks Richard Henderson 2013-06-04 17:09 ` [Qemu-devel] [PATCH 0/2] " Andreas Färber 2 siblings, 1 reply; 6+ messages in thread From: Richard Henderson @ 2013-06-04 16:58 UTC (permalink / raw) To: qemu-devel; +Cc: aurelien Rather than a hand-coded version of the same thing. Signed-off-by: Richard Henderson <rth@twiddle.net> --- include/exec/cpu-defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index d8c64e9..2e5a9ba 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -99,7 +99,7 @@ typedef struct CPUTLBEntry { sizeof(uintptr_t))]; } CPUTLBEntry; -extern int CPUTLBEntry_wrong_size[sizeof(CPUTLBEntry) == (1 << CPU_TLB_ENTRY_BITS) ? 1 : -1]; +QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry) != (1 << CPU_TLB_ENTRY_BITS)); #define CPU_COMMON_TLB \ /* The meaning of the MMU modes is defined in the target code. */ \ -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS 2013-06-04 16:58 ` [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS Richard Henderson @ 2013-06-05 1:37 ` li guang 0 siblings, 0 replies; 6+ messages in thread From: li guang @ 2013-06-05 1:37 UTC (permalink / raw) To: Richard Henderson; +Cc: qemu-devel, aurelien Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> 在 2013-06-04二的 09:58 -0700,Richard Henderson写道: > Rather than a hand-coded version of the same thing. > > Signed-off-by: Richard Henderson <rth@twiddle.net> > --- > include/exec/cpu-defs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h > index d8c64e9..2e5a9ba 100644 > --- a/include/exec/cpu-defs.h > +++ b/include/exec/cpu-defs.h > @@ -99,7 +99,7 @@ typedef struct CPUTLBEntry { > sizeof(uintptr_t))]; > } CPUTLBEntry; > > -extern int CPUTLBEntry_wrong_size[sizeof(CPUTLBEntry) == (1 << CPU_TLB_ENTRY_BITS) ? 1 : -1]; > +QEMU_BUILD_BUG_ON(sizeof(CPUTLBEntry) != (1 << CPU_TLB_ENTRY_BITS)); > > #define CPU_COMMON_TLB \ > /* The meaning of the MMU modes is defined in the target code. */ \ ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks 2013-06-04 16:58 [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks Richard Henderson 2013-06-04 16:58 ` [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS Richard Henderson @ 2013-06-04 16:58 ` Richard Henderson 2013-06-05 1:38 ` li guang 2013-06-04 17:09 ` [Qemu-devel] [PATCH 0/2] " Andreas Färber 2 siblings, 1 reply; 6+ messages in thread From: Richard Henderson @ 2013-06-04 16:58 UTC (permalink / raw) To: qemu-devel; +Cc: aurelien We've got a compile-time check for the condition in exec/cpu-defs.h. Signed-off-by: Richard Henderson <rth@twiddle.net> --- tcg/arm/tcg-target.c | 6 ------ tcg/i386/tcg-target.c | 6 ------ tcg/s390/tcg-target.c | 7 ------- 3 files changed, 19 deletions(-) diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c index 3d43412..6be736b 100644 --- a/tcg/arm/tcg-target.c +++ b/tcg/arm/tcg-target.c @@ -2053,12 +2053,6 @@ static const TCGTargetOpDef arm_op_defs[] = { static void tcg_target_init(TCGContext *s) { -#if !defined(CONFIG_USER_ONLY) - /* fail safe */ - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) - tcg_abort(); -#endif - tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); tcg_regset_set32(tcg_target_call_clobber_regs, 0, (1 << TCG_REG_R0) | diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 9eec06c..9e95477 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -2283,12 +2283,6 @@ static void tcg_target_init(TCGContext *s) } #endif -#if !defined(CONFIG_USER_ONLY) - /* fail safe */ - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) - tcg_abort(); -#endif - if (TCG_TARGET_REG_BITS == 64) { tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffff); diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index 7d6f777..f229f1c 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -2324,13 +2324,6 @@ static void query_facilities(void) static void tcg_target_init(TCGContext *s) { -#if !defined(CONFIG_USER_ONLY) - /* fail safe */ - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) { - tcg_abort(); - } -#endif - query_facilities(); tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); -- 1.8.1.4 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks 2013-06-04 16:58 ` [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks Richard Henderson @ 2013-06-05 1:38 ` li guang 0 siblings, 0 replies; 6+ messages in thread From: li guang @ 2013-06-05 1:38 UTC (permalink / raw) To: Richard Henderson; +Cc: qemu-devel, aurelien Reviewed-by: liguang <lig.fnst@cn.fujitsu.com> 在 2013-06-04二的 09:58 -0700,Richard Henderson写道: > We've got a compile-time check for the condition in exec/cpu-defs.h. > > Signed-off-by: Richard Henderson <rth@twiddle.net> > --- > tcg/arm/tcg-target.c | 6 ------ > tcg/i386/tcg-target.c | 6 ------ > tcg/s390/tcg-target.c | 7 ------- > 3 files changed, 19 deletions(-) > > diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c > index 3d43412..6be736b 100644 > --- a/tcg/arm/tcg-target.c > +++ b/tcg/arm/tcg-target.c > @@ -2053,12 +2053,6 @@ static const TCGTargetOpDef arm_op_defs[] = { > > static void tcg_target_init(TCGContext *s) > { > -#if !defined(CONFIG_USER_ONLY) > - /* fail safe */ > - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) > - tcg_abort(); > -#endif > - > tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); > tcg_regset_set32(tcg_target_call_clobber_regs, 0, > (1 << TCG_REG_R0) | > diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c > index 9eec06c..9e95477 100644 > --- a/tcg/i386/tcg-target.c > +++ b/tcg/i386/tcg-target.c > @@ -2283,12 +2283,6 @@ static void tcg_target_init(TCGContext *s) > } > #endif > > -#if !defined(CONFIG_USER_ONLY) > - /* fail safe */ > - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) > - tcg_abort(); > -#endif > - > if (TCG_TARGET_REG_BITS == 64) { > tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); > tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I64], 0, 0xffff); > diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c > index 7d6f777..f229f1c 100644 > --- a/tcg/s390/tcg-target.c > +++ b/tcg/s390/tcg-target.c > @@ -2324,13 +2324,6 @@ static void query_facilities(void) > > static void tcg_target_init(TCGContext *s) > { > -#if !defined(CONFIG_USER_ONLY) > - /* fail safe */ > - if ((1 << CPU_TLB_ENTRY_BITS) != sizeof(CPUTLBEntry)) { > - tcg_abort(); > - } > -#endif > - > query_facilities(); > > tcg_regset_set32(tcg_target_available_regs[TCG_TYPE_I32], 0, 0xffff); ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks 2013-06-04 16:58 [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks Richard Henderson 2013-06-04 16:58 ` [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS Richard Henderson 2013-06-04 16:58 ` [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks Richard Henderson @ 2013-06-04 17:09 ` Andreas Färber 2 siblings, 0 replies; 6+ messages in thread From: Andreas Färber @ 2013-06-04 17:09 UTC (permalink / raw) To: Richard Henderson; +Cc: qemu-devel, aurelien Am 04.06.2013 18:58, schrieb Richard Henderson: > Reviewing the tcg/aarch64 patch set, and comparing that to > existing hosts made me remember that I've wanted to do this > for quite some time. > > > r~ > > > > Richard Henderson (2): > tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS > tcg: Remove redundant tcg_target_init checks Reviewed-by: Andreas Färber <afaerber@suse.de> Andreas > > include/exec/cpu-defs.h | 2 +- > tcg/arm/tcg-target.c | 6 ------ > tcg/i386/tcg-target.c | 6 ------ > tcg/s390/tcg-target.c | 7 ------- > 4 files changed, 1 insertion(+), 20 deletions(-) > -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-06-05 2:00 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-04 16:58 [Qemu-devel] [PATCH 0/2] tcg: Remove redundant tcg_target_init checks Richard Henderson 2013-06-04 16:58 ` [Qemu-devel] [PATCH 1/2] tcg: Use QEMU_BUILD_BUG_ON for CPU_TLB_ENTRY_BITS Richard Henderson 2013-06-05 1:37 ` li guang 2013-06-04 16:58 ` [Qemu-devel] [PATCH 2/2] tcg: Remove redundant tcg_target_init checks Richard Henderson 2013-06-05 1:38 ` li guang 2013-06-04 17:09 ` [Qemu-devel] [PATCH 0/2] " Andreas Färber
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).