From patchwork Thu Sep 12 19:59:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173726 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp2599429ilq; Thu, 12 Sep 2019 13:00:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyAXfQ77Wm4urgFmi+Xz1PD4xQr8iJLnvFEdGXwesqjbNFIB7Nok82h0LjmNQRDN2zVQdJ4 X-Received: by 2002:a50:ad2c:: with SMTP id y41mr43586905edc.114.1568318437251; Thu, 12 Sep 2019 13:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568318437; cv=none; d=google.com; s=arc-20160816; b=Tvviqc5u0TvB/rSXL+yqk7NgSmQc9zTmQdRWpj6YOlZXVEJ98lJRU/CJ9PT4ZM6MIx feEPI4gQTtlRPCIma4lg3RAMWC2DFXwJfvtLn2TLHd2B5F5gsOJxUVTPJDktklUIqqdl jo7+Gqr642ibFBlwaio2dlh/gIGilbGeTgNY+gPQIS9AcV9U2lD5U2Uvrqjtn6uZFKfV S4cKJrSOObl2Gm10qG3WCDDvNuBhNvaglDxrnzmxhepp1QalQl8pu0xkquSMf/4KqQb7 rtZ/7tcQQ4REuhG47jBrIZSNluKZfitSgYv7PyZFeccHvBcT02dJ/mNFJuYuCE5p8rDE zX5A== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=GVLFTA60hlmj+H2/7YDDPt5FNC57y3vvDPP1cxQ2fC0=; b=LCeQOc535haIZY8LW92h5TrHdPma5qWNcQzRox6YbdLaJeNG2MY0FZUyqfAbJEQsX8 /en0mByqyIohjJzE13y7ZAXAhqaP+QifZ6zkSiyIy5VjQA41SfAb2QR6jhiN6ACSQpqw I9qT89HaGTKIZLKGlHmetZl2W7VlY8nC+u0ttWxviOPYpjeFKOnjiB5GVHRcI3hAQUcu s7YUTQXrKcNDXvA8cdAfIo9r5Fx9yuul8EnJfSteqwVXRGnWe3maiJ+I7n5SR0unFrrE J3ICeR3MMqO1WIwKI/YZUH4jTWs7CYN6KukFIJzub40OngSdGNAnvH0p9QzBB36KE4py 0GVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UAjkkLxR; 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 z55si6102749edb.41.2019.09.12.13.00.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Sep 2019 13:00:37 -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=UAjkkLxR; 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]:38548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8VGe-00016a-8s for patch@linaro.org; Thu, 12 Sep 2019 16:00:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46116) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i8VFk-00011R-NJ for qemu-devel@nongnu.org; Thu, 12 Sep 2019 15:59:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i8VFj-0005Is-O2 for qemu-devel@nongnu.org; Thu, 12 Sep 2019 15:59:40 -0400 Received: from mail-qk1-x733.google.com ([2607:f8b0:4864:20::733]:32991) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i8VFj-0005Id-Jx for qemu-devel@nongnu.org; Thu, 12 Sep 2019 15:59:39 -0400 Received: by mail-qk1-x733.google.com with SMTP id x134so25784694qkb.0 for ; Thu, 12 Sep 2019 12:59:39 -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=GVLFTA60hlmj+H2/7YDDPt5FNC57y3vvDPP1cxQ2fC0=; b=UAjkkLxRH9fiRL8QLbkLEsnY+SDmrDdWDNJx3wJcdb2Ga9eQl9yuayfALMFNe2gjMu ue5qJaiR/wDLfrLM4I0WDE9U4eLCzg2fK57XdaKI5PX15NikPbbtXXrKZGdBJ57vdxjQ 3+fIPmfxNRGSIbwHn/su8ygSIf4n0JSwf/n5O302Da0ZMSZs+XZLC9chUH8b11bHRjPQ YNP9CRJZ1K/UKOaagjoP4B0IS2jhzYYA1MRt083ywk2/loHZcTOkG/erLGQufpAmnydU q5eWVhD7lGAtbT+g8VbeAUt+GtJYv1ky1WBXVQy29DpMuDtkoF6/1swN1tZL3Ch8G/LD G+vQ== 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=GVLFTA60hlmj+H2/7YDDPt5FNC57y3vvDPP1cxQ2fC0=; b=R+6dJ85/TXKyYWsX1aEK3pvBBLJG+oYKqiy0oi3LwerSvop4upcKlCvQkN18EJP5A/ /Vz0kZZWjhPAvAtwpfV55QIYcfxBwT7V23Xp714CFx8YeY8uiVJ1HBNsLpvs6DhaSRK3 SDPyI9XKIV0oVN+yGIxUyWVwlwduAs6Ixt64IReK3ChLi2PI0R3BUH+6dFmi3dt3mTm3 zWrUlfipITQ99TOUlUbviGmRgj4jIubFywUUwM4olTnl6GcmNp9GzSXQ1AOFz/Jo9QQe ll+YfkOzfcxmRCnTOAccswlqKpUI3HlXwp3YqQ+rOgXl/zcQizY52CY7NzBgWBeljccK cYSw== X-Gm-Message-State: APjAAAUHDyqKLRa/33hHdF8rDAwEZa0Ms5KW3GIQwwhAxikXjcEwCLkl KdFiJ2D/aKy0ZMLouYGkiynM9KL20WyyWw== X-Received: by 2002:a37:a48b:: with SMTP id n133mr37221462qke.398.1568318378422; Thu, 12 Sep 2019 12:59:38 -0700 (PDT) Received: from localhost.localdomain ([67.69.50.154]) by smtp.gmail.com with ESMTPSA id k11sm11140897qtp.26.2019.09.12.12.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Sep 2019 12:59:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 12 Sep 2019 15:59:32 -0400 Message-Id: <20190912195934.13502-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190912195934.13502-1-richard.henderson@linaro.org> References: <20190912195934.13502-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::733 Subject: [Qemu-devel] [PATCH v2 1/3] cputlb: Disable __always_inline__ without optimization 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: tony.nguyen@bt.com, mark.cave-ayland@ilande.co.uk 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. Reported-by: Peter Maydell Reviewed-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 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) {