From patchwork Wed Feb 26 18:10:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 183918 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3456117ile; Wed, 26 Feb 2020 10:13:01 -0800 (PST) X-Google-Smtp-Source: APXvYqxFd7rLPT5keOvaTRIIT8Fm3J9UF4mBHizsZMQHIwfsfn15xjcU3FSZ/Neckx+7I+c7aIvZ X-Received: by 2002:aed:2478:: with SMTP id s53mr67040qtc.292.1582740781727; Wed, 26 Feb 2020 10:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582740781; cv=none; d=google.com; s=arc-20160816; b=hPy8BCciJGoatv+nPqZvdmisy0K/11y6kNlkG7L64KP29M/O/Pr/e7339aGt/t7/p0 jdGqeFWWWMhYAYhkmy4nxbcPduiZF6GNYjTsFEfoevinrXC3WBBaRpIz/Wx3Uif2L0lM Vq9jrhp7fGlQplim+bgwEvv5t6WxZbPWNUjYBjGPpYRmVo1xxhWxqJqwCfO0vChFlEAJ e9d9k+XTlQfp1iHZDwrVHj2XxoRf1jj3rbC0q37zfNwxS9zdNI+dl+CVLQAlw+zgPngQ kPY1tAtZH8CArsQUjTHpj3yOiGu0K92NpKA2G9WIvGfZhN7ecdeW+5febjPqM7nCl/bI MekQ== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hTO2TJKTVn6zYRsBqCfNS47JQf5FFH1MtA261qT+XBk=; b=M/HSDYh39Rf62wEdiadb5MV8iyd/KE6PwGM18qXqT0a1IIgN6Y6N6hmzEPHK7VfXut Muri++1BCFkT8ZAoFLj3mDxI4q6TlOZvqGL7R9MkHtFyBVOOyzGRy6b6do0yiZ+X6Wgq nWbbAOI+i5Jd2Sae++3kIY/ema5x4+oEkOqNJYbbsiuJZdJJktiuZ8GDtoi+HguFoJNj fX9z8SP/qRIVmL5WeOfVQwn0W7o7tztus+MAOa6eHlG8a2ZT0meSYt89r1S58cJ5a3Zh Eo4fKUjT5fMPKw0IYanXIGIb1uev3kML16Mw+4QgIMBeoHNa3QEk/Ttj5/tq51i1LFko 29ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="XhZKl9/y"; 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 m9si130717qkh.284.2020.02.26.10.13.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Feb 2020 10:13:01 -0800 (PST) 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="XhZKl9/y"; 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]:48372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j71B7-0003S1-8s for patch@linaro.org; Wed, 26 Feb 2020 13:13:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40661) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j718d-00077h-UN for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:10:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j718c-00065A-PU for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:10:27 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:50577) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j718c-00064S-Iu for qemu-devel@nongnu.org; Wed, 26 Feb 2020 13:10:26 -0500 Received: by mail-wm1-x341.google.com with SMTP id a5so284128wmb.0 for ; Wed, 26 Feb 2020 10:10:26 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=hTO2TJKTVn6zYRsBqCfNS47JQf5FFH1MtA261qT+XBk=; b=XhZKl9/y1LXlkcu4qnQDHpOSISFfZXX5rZTkBK3XsCMR7LgI/JUaD75+mDloiGDs+T DXpIrXPkXY90+FfirwZzGMYnna1qoqIjQnYRFbTq9zNYGmSXJxAe2cV4Sx+ZFWeSQ5uy 6Fg/RNivdqoJT3z0YPHlO+C4z5UpSDqsGFJWvYKm0BUfKNes/OEc16rr6bYiIlByZ2Yv XOw/lf2pQRxWwVkFScpLm274JOJ8tBR7W/SyED7t7ofrxHj1Y4Y8QtjfxcYfM4z05RFa eWK+wv+PK3az5Ez5I6MD6LlHHe8PAV4Y1Loejl1G34+ceN0QVFM1IY6D3uj+11egqODk Z5/A== 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:mime-version:content-transfer-encoding; bh=hTO2TJKTVn6zYRsBqCfNS47JQf5FFH1MtA261qT+XBk=; b=rA/ZhhilYWaW64TjBv/2haZY/lwBFyMzommhW/4ULX+VQKmOqhgrHvi4LX8j+PiSKc U+IMGxU/sdsiWpETj9XO0r7D9c7aqjKzyp+cWrMP+V3RwTqoq19/SngArF1TisC/TRVd AUWLKfrpJ5RZf5YgcYlcHNmu7D3oeGH53BWGou0CBYX03TQ6gymBTt6KtNxOAVO2boXo h9aoMgfpb9Dd+WmjrPP7CQKPI3lyt1NHNxHqIr9tNy5Bago2gRWgoIkPk3EX3dDLrDjT veCK5e8Whd7V0ZpulvQv9JB6jewfHNCtlIiFTLFPWDgZo6TfuJ49nv9gIEVyiJUPO38z xLow== X-Gm-Message-State: APjAAAWTYvsqnIcl+X7ViSJOnJOq0kaP8ino59LK3KX1zK5Ug1FO3rlI e8XMeKwDs3VUqurVSlZ0a60qWQ== X-Received: by 2002:a1c:a4c3:: with SMTP id n186mr110130wme.25.1582740625545; Wed, 26 Feb 2020 10:10:25 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z10sm3867301wmk.31.2020.02.26.10.10.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 10:10:21 -0800 (PST) Received: from zen.home.arpa (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 08C411FF8F; Wed, 26 Feb 2020 18:10:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 2/4] accel/tcg: remove link between guest ram and TCG cache size Date: Wed, 26 Feb 2020 18:10:18 +0000 Message-Id: <20200226181020.19592-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200226181020.19592-1-alex.bennee@linaro.org> References: <20200226181020.19592-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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: Niek Linnenbank , qemu-arm@nongnu.org, Paolo Bonzini , Igor Mammedov , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Basing the TB cache size on the ram_size was always a little heuristic and was broken by a1b18df9a4 which caused ram_size not to be fully realised at the time we initialise the TCG translation cache. The current DEFAULT_CODE_GEN_BUFFER_SIZE may still be a little small but follow-up patches will address that. Fixes: a1b18df9a4 Signed-off-by: Alex Bennée Cc: Niek Linnenbank Cc: Igor Mammedov --- accel/tcg/translate-all.c | 8 -------- 1 file changed, 8 deletions(-) -- 2.20.1 Tested-by: Niek Linnenbank Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daudé diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 238b0e575bf..5b66af783b5 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -938,15 +938,7 @@ static inline size_t size_code_gen_buffer(size_t tb_size) { /* Size the buffer. */ if (tb_size == 0) { -#ifdef USE_STATIC_CODE_GEN_BUFFER tb_size = DEFAULT_CODE_GEN_BUFFER_SIZE; -#else - /* ??? Needs adjustments. */ - /* ??? If we relax the requirement that CONFIG_USER_ONLY use the - static buffer, we could size this on RESERVED_VA, on the text - segment size of the executable, or continue to use the default. */ - tb_size = (unsigned long)(ram_size / 4); -#endif } if (tb_size < MIN_CODE_GEN_BUFFER_SIZE) { tb_size = MIN_CODE_GEN_BUFFER_SIZE;