From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R88mR-0002ne-SV for qemu-devel@nongnu.org; Mon, 26 Sep 2011 06:51:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R88mQ-00019H-NA for qemu-devel@nongnu.org; Mon, 26 Sep 2011 06:51:23 -0400 Received: from goliath.siemens.de ([192.35.17.28]:19453) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R88mQ-000197-Bt for qemu-devel@nongnu.org; Mon, 26 Sep 2011 06:51:22 -0400 Message-ID: <4E805923.50806@siemens.com> Date: Mon, 26 Sep 2011 12:51:15 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4E802DDD.8090100@siemens.com> In-Reply-To: <4E802DDD.8090100@siemens.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2] tcg: Remove stack protection from helper functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , Peter Maydell , Laurent Desnogues , Mulyadi Santosa , qemu-devel This increases the overhead of frequently executed helpers. We need to move rule past QEMU_CFLAGS assignment to ensure that the required simple assignment picks up all bits. The signal workaround is moved just for the sake of consistency. Signed-off-by: Jan Kiszka --- Changes in v2: - unbreak qemu-user build Maybe some real make guru has a nicer solution for removing the switch. Makefile.target | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Makefile.target b/Makefile.target index 88d2f1f..b545161 100644 --- a/Makefile.target +++ b/Makefile.target @@ -89,14 +89,6 @@ translate-all.o: translate-all.c cpu.h tcg/tcg.o: cpu.h -# HELPER_CFLAGS is used for all the code compiled with static register -# variables -op_helper.o user-exec.o: QEMU_CFLAGS += $(HELPER_CFLAGS) - -# Note: this is a workaround. The real fix is to avoid compiling -# cpu_signal_handler() in user-exec.c. -signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) - ######################################################### # Linux user emulator target @@ -387,6 +379,15 @@ obj-y += $(addprefix ../, $(trace-obj-y)) endif # CONFIG_SOFTMMU +# HELPER_CFLAGS is used for all the code compiled with static register +# variables +# NOTE: Must be after the last QEMU_CFLAGS assignment +op_helper.o user-exec.o: QEMU_CFLAGS := $(subst -fstack-protector-all,,$(QEMU_CFLAGS)) $(HELPER_CFLAGS) + +# Note: this is a workaround. The real fix is to avoid compiling +# cpu_signal_handler() in user-exec.c. +signal.o: QEMU_CFLAGS += $(HELPER_CFLAGS) + ifndef CONFIG_LINUX_USER ifndef CONFIG_BSD_USER # libcacard needs qemu-thread support, and besides is only needed by devices -- 1.7.3.4