From patchwork Sun Sep 22 03:54:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 174199 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1308632ill; Sat, 21 Sep 2019 21:02:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyggeiQDwpGUslv1LYWpseZbG0niNXPiHTOQWBrXumtCHhIuJ7HIOGsQa2s4+zeP5JSd2Sw X-Received: by 2002:a50:ef02:: with SMTP id m2mr21308565eds.157.1569124965036; Sat, 21 Sep 2019 21:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569124965; cv=none; d=google.com; s=arc-20160816; b=kBVCLDAb3i7FLhoU++UGxU44QahGg4vCL9x6J15YzjKxvpABEZJzsRxBV1ZIceufR2 6A+fODzRzwbHFeE/3hK5SmUOuFXrhz/Yb26y7LBFkLtpNxN25Tg8NSKWi4Tw1T15Tw+A os/7tnCt0GV+v+NBcfCdCsiOSSXc1Ac4tuPCCsBjUx651rPY47Sa28wC/H5gh9s9c/MZ WRJ+BBl3/dt+ftsWkLK8wDsi9WGNWiuZcqsf+29PF5TvycCPdAV9buG17R0ewu6sjjCF IMWtR5c3eLkVXhxni1eGHzygHwpWKUHXphoc6cUae1tbNzIxXqA1Z+fKa4ytGNi0BmPV LOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:references:in-reply-to :message-id:date:subject:to:from:dkim-signature; bh=GvMaV7tcHk1BMJ7VP3GkIN7btKhgbcJH5l/u+8AvH70=; b=QrXphizUO5mk/wsAtw+U7P4JSupbcUskkV7RPSA+sgoSk4hKc/Q8SYFFb/34pAycvJ 9ndy1/3pkVXFKuWNIzcHP4Ck6TvSYeMqBNUgy9POYM7n31T4b/1sQqGhlrRtL1T5ACZk 7MburfZy885uVVzw8ZQ7HTUTmnfRWEzWv7DPEJiTfwLNgyx5T+5Ont/qxXf+sC56URR6 mkOpcq1TcpeJHavENhI8VgDTT9EpZRkMUV31trP9X4cnDu1sEs6tY/4arg+x2qiJfg35 SHNDg3xU1NFB3NLHeltOIoozkKVZlSScsFiqnyUmkQzi7mYP2W5g6mC/oAHsiEQtye4X FPfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cj5ggUHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e23si4242767edq.344.2019.09.21.21.02.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 21 Sep 2019 21:02:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cj5ggUHi; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBt59-0008CH-Aw for patch@linaro.org; Sun, 22 Sep 2019 00:02:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40856) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBsxt-0001Xl-FS for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBsxs-0008DV-5W for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:13 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:34721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBsxr-0008CG-Vd for qemu-devel@nongnu.org; Sat, 21 Sep 2019 23:55:12 -0400 Received: by mail-pf1-x430.google.com with SMTP id b128so7003121pfa.1 for ; Sat, 21 Sep 2019 20:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GvMaV7tcHk1BMJ7VP3GkIN7btKhgbcJH5l/u+8AvH70=; b=cj5ggUHidfOL/BT0sd8EjORAvUhNGdFPkVx2xconxgmgFbD4Yq2vrE3tkMXHaqr6mr 5qlBuqLKALdb8ir71i5e/sWUEeoDbN+JDorpcmBdp+LOZ3jaCkCPQDLNHgCizD/3cmum 49XbqcwUFgDPdXOLS9VC4U1NwXBTOJCj86O1FQVVyH36QhdO0a57NE0RclQacTDz6oXi For1qR7H86kTrKEedWbKfxwpGPUD+dFLwNrrSUakEjhSbkW/0I4jnZp749idp0Fm9toZ Ko42D+HzMhsGD2N1wIfWFdj2rBs7qVueqZ+uP29R8ISboI16dQxZr1ZU/ZQxd3nfAkqg qUnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GvMaV7tcHk1BMJ7VP3GkIN7btKhgbcJH5l/u+8AvH70=; b=ZW95F0H3NJk8XGlLO9O+D58Nr47P6YmzNcvKEv7tOgcGr0DL0clRLwx8tDBZMjUSJ8 a4wibNksTwBJV32PP9DCFEiIbQtKNCGaRoNmXlRk/U4y64utGxlYSd9RZqdQDVxbxTpp zf1NG1TunT+YGATbT5apYO//UgPJpwJeK7JCV0TfOLZO3ftTTwygp2J2PFO5HXMx+r19 bQ0WmlVn0FdA2ym6whgmg1DLfWbJLbTwf8moLh2vNM59Ow8JXZ+xhFGG2jhhDrrPdBev 7DOf8oyNEWqm9JOr62IRTSfZyPBowzAUN47Z5EkIyrnrGMQxekIOr0sTKzI2CLxAQNrq L25Q== X-Gm-Message-State: APjAAAX5Q3N7k2cAd2eaaug08115aLlcS4aJpp5E53+dUpSGvTsTdykv +zz33HfBZ1jXY64Dd+dwbvrLxHmk0SA= X-Received: by 2002:a17:90a:e38b:: with SMTP id b11mr13329399pjz.138.1569124510414; Sat, 21 Sep 2019 20:55:10 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id z4sm6452921pjt.17.2019.09.21.20.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2019 20:55:09 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 08/20] cputlb: Disable __always_inline__ without optimization Date: Sat, 21 Sep 2019 20:54:46 -0700 Message-Id: <20190922035458.14879-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190922035458.14879-1-richard.henderson@linaro.org> References: <20190922035458.14879-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::430 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pbonzini@redhat.com, alex.bennee@linaro.org, stefanha@redhat.com, david@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This forced inlining can result in missing symbols, which makes a debugging build harder to follow. Reviewed-by: David Hildenbrand Reported-by: Peter Maydell Signed-off-by: Richard Henderson --- include/qemu/compiler.h | 11 +++++++++++ accel/tcg/cputlb.c | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 09fc44cca4..d6d400c523 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -170,6 +170,17 @@ # define QEMU_NONSTRING #endif +/* + * Forced inlining may be desired to encourage constant propagation + * of function parameters. However, it can also make debugging harder, + * so disable it for a non-optimizing build. + */ +#if defined(__OPTIMIZE__) && __has_attribute(always_inline) +#define QEMU_ALWAYS_INLINE __attribute__((always_inline)) +#else +#define QEMU_ALWAYS_INLINE +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index abae79650c..2222b87764 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1281,7 +1281,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, typedef uint64_t FullLoadHelper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); -static inline uint64_t __attribute__((always_inline)) +static inline uint64_t QEMU_ALWAYS_INLINE load_helper(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr, MemOp op, bool code_read, FullLoadHelper *full_load) @@ -1530,7 +1530,7 @@ tcg_target_ulong helper_be_ldsl_mmu(CPUArchState *env, target_ulong addr, * Store Helpers */ -static inline void __attribute__((always_inline)) +static inline void QEMU_ALWAYS_INLINE store_helper(CPUArchState *env, target_ulong addr, uint64_t val, TCGMemOpIdx oi, uintptr_t retaddr, MemOp op) {