From nobody Wed Nov 5 06:44:48 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 149969708719662.589671731883186; Mon, 10 Jul 2017 07:31:27 -0700 (PDT) Received: from localhost ([::1]:41083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUZie-0000Kd-HC for importer@patchew.org; Mon, 10 Jul 2017 10:31:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUZho-0008KW-J8 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 10:30:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUZhl-0006cN-HR for qemu-devel@nongnu.org; Mon, 10 Jul 2017 10:30:32 -0400 Received: from mail-wr0-f180.google.com ([209.85.128.180]:32937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUZhl-0006br-AR for qemu-devel@nongnu.org; Mon, 10 Jul 2017 10:30:29 -0400 Received: by mail-wr0-f180.google.com with SMTP id r103so141347350wrb.0 for ; Mon, 10 Jul 2017 07:30:29 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 3sm5512727wrs.18.2017.07.10.07.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 07:29:26 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 4E99F3E0157; Mon, 10 Jul 2017 15:29:26 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=9ghkIFhkGKX++ZLRubxIAyFqtuoLGJOCOd3QveV11vs=; b=aLLpu0KPaYVmYR2C7BWnEnhGUE7RxNuD+IYs9iMxVn3ITVA5VgNrJfv0AB7VnQp5RO wHnJvf/NWeGZpEB9/+9fsAwcGOkL0U4UYwJWAjkyRHrPz5zolLjA7iXeYTZM6zQ3f4pd uJXPUCZuToCgt6s/TijNEXmPJHNeJDN7hoSUk= 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:mime-version :content-transfer-encoding; bh=9ghkIFhkGKX++ZLRubxIAyFqtuoLGJOCOd3QveV11vs=; b=COxK+I1Bznk7bM05IOUKxNnRnk6WHyr29oum5kj+JJz90UX0IvzNNFvrFD+qnKgYMh E/FtW4dlgUGxW6DhGIBCM8saov0rDg+iZSkoTOEABTCdzbN57XdAQsz7drY32oSbHoKi Frf1HhuB3GhNHA5Ew+qlfQYl+/TZAqgk4qj5tfHSOa56MASI3sEx4uqZG4my8KeRF7uL TEHqxI1UH5awtkkTbOHHVbcQ7S7bTEOu8983Z+3MhJ2f8sUg9zx7KKFqKHQng0GLJ3z/ ylZOyfobON1+5+d/l6W8mv7eC70t/Y6fHlpqLC3MyRvDTkLSzysfmTM5KFGB6z0Twh7Y kcsw== X-Gm-Message-State: AIVw110Xb1YtuwmYh0iVbhO5SQsv3E5T8Sm7kPSoWFF24UKYpZEpdzlD IqdJRZZdFghbNb9j X-Received: by 10.28.128.67 with SMTP id b64mr8062379wmd.79.1499696967927; Mon, 10 Jul 2017 07:29:27 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org, bobby.prani@gmail.com Date: Mon, 10 Jul 2017 15:28:49 +0100 Message-Id: <20170710142850.10468-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.128.180 Subject: [Qemu-devel] [RFC PATCH] include/exec/cpu-defs.h: try and make SoftMMU page size match target X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Crosthwaite , qemu-devel@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 While the SoftMMU is not emulating the target MMU of a system there is a relationship between its page size and that of the target. If the target MMU is full featured the functions called to re-fill the entries in the SoftMMU entries start moving up the perf profiles. If we can we should try and prevent too much thrashing around by having the page sizes the same. Ideally we should use TARGET_PAGE_BITS_MIN but that potentially involves a fair bit of #include re-jigging so I went for 10 bits (1k pages) which I think is the smallest of all our emulated systems. Some quick numbers show a reasonable performance win on an x86_64 host: ./aarch64-softmmu/qemu-system-aarch64 -machine type=3Dvirt \ -display none -m 16384 -cpu cortex-a57 -serial mon:stdio \ -drive file=3D../jessie-arm64.qcow2,id=3Dmyblock,index=3D0,if=3Dnone \ -device virtio-blk-device,drive=3Dmyblock \ -append "console=3DttyAMA0 root=3D/dev/vda1 systemd.unit=3Dbenchmark-bui= ld.service" \ -kernel ../aarch64-current-linux-kernel-only.img -machine gic-version=3D= 3 -smp 4 8 bit TLB: run 1: ret=3D0 (PASS), time=3D425.202797 (1/1) run 2: ret=3D0 (PASS), time=3D410.421742 (2/2) run 3: ret=3D0 (PASS), time=3D417.666752 (3/3) run 4: ret=3D0 (PASS), time=3D411.158793 (4/4) run 5: ret=3D0 (PASS), time=3D417.133068 (5/5) Results summary: 0: 5 times (100.00%), avg time 416.317 (35.70 varience/5.98 deviation) 10 bit TLB run 1: ret=3D0 (PASS), time=3D359.310380 (1/1) run 2: ret=3D0 (PASS), time=3D387.826981 (2/2) run 3: ret=3D0 (PASS), time=3D381.097123 (3/3) run 4: ret=3D0 (PASS), time=3D393.826197 (4/4) run 5: ret=3D0 (PASS), time=3D384.340781 (5/5) Results summary: 0: 5 times (100.00%), avg time 381.280 (173.08 varience/13.16 deviation) CC: Pranith Kumar Signed-off-by: Alex Benn=C3=A9e --- 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 bc8e7f848d..a0f9249752 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -89,7 +89,7 @@ typedef uint64_t target_ulong; * of tlb_table inside env (which is non-trivial but not huge). */ #define CPU_TLB_BITS \ - MIN(8, \ + MIN(10, \ TCG_TARGET_TLB_DISPLACEMENT_BITS - CPU_TLB_ENTRY_BITS - \ (NB_MMU_MODES <=3D 1 ? 0 : \ NB_MMU_MODES <=3D 2 ? 1 : \ --=20 2.13.0