From patchwork Fri Oct 18 17:44:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176918 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1180228ill; Fri, 18 Oct 2019 10:45:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtXtxRml77NTdaXskoHMqO+HqDGYV/3ZMs+kDSrdRi2dE4/1eYhdNX/s+ktYH6gtE2rzLr X-Received: by 2002:ac8:6782:: with SMTP id b2mr3941041qtp.184.1571420728890; Fri, 18 Oct 2019 10:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571420728; cv=none; d=google.com; s=arc-20160816; b=qNbUcOhDOIRUz+KJIH6+M+E5vtI7CkDi548XfMSgVzLxWw2xnTVAx2Z1I7G0Kl7c/l itVGuLwHe19nh48Fgx/X1JETJPXLrsKLxC2P28pzyq2/t5ab4um5HXpDfNsfLWgj19jf AGV7yGGGeAoCTZx47f8ou2EIWtZzWq2EmowcM0wcZ8WT8rKKx0OamWpO5HseIMmvw6Rh +d+NQJmUboC3k+VGa9wlIiunsv7WwY8yH+2Yn/YDIfXZXFWzf17d4OhOMVyiALM02Fs2 PFBGOh/X+kfANWHxX+V0M7iRIkmxHN2bNnwE017LTmSYqL+XjLg6AgDzW5HWRpeMxwYg I53g== 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:message-id:date:subject:to:from:dkim-signature; bh=Idl8sKo+MyTPxfki1g38jo0djbqo1vGnN91+OptSag0=; b=gn1JZJmjQZYocQiyAGU2Xnvkyotk/TNSAmuQhUHk6id98EO7YcG5zYHKQmUPgQQTQQ 4l1opbrq035ncPzgA2c/dWUbPbrOMseQ8T6rohwYFvp7r4ZT0M+u+QoKsmsZSE+KWLp/ OM8mcFrHGMuEzFXYxnMDExFoyn6OZQzrefjOI4o1shsxqIEgjHddiBKp9bPpPsvi+fqx R9fH5GWJayyMFPXdM4T8Hb69TgxiOnrbcUxa5U1VegPcslRcicW1GD4buwJeMRwJSutq ZVvyJAR0wAaq9ZorUpj2tkD5IJrjc8FX9MyewhW9wK5cqK918wJ+TTlCTuBBmZZ/PJ5H whig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=HKe30JEt; 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 i2si6902135qvd.85.2019.10.18.10.45.28 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Oct 2019 10:45:28 -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=HKe30JEt; 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]:43938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWJb-0006R9-Rd for patch@linaro.org; Fri, 18 Oct 2019 13:45:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59009) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLWIl-0006On-V6 for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLWIk-0005Iw-Gj for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:35 -0400 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:45757) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLWIk-0005IJ-Af for qemu-devel@nongnu.org; Fri, 18 Oct 2019 13:44:34 -0400 Received: by mail-pl1-x62d.google.com with SMTP id u12so3174042pls.12 for ; Fri, 18 Oct 2019 10:44:34 -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:mime-version :content-transfer-encoding; bh=Idl8sKo+MyTPxfki1g38jo0djbqo1vGnN91+OptSag0=; b=HKe30JEtyjBtIxjAtp+/GAoa0jb+rryOZTp/GNwwPSlG4ovdTD33pq7PgN7jF0nfex oErWxayL5t+fnMJ2RqzaI/z5uDcl1ExRKXLBQFfGE/9Sar31+uelXSsdbdvwSzy33ugR fokRP2VEQlRMZXZnd4lhEhY3MdxttTzRKrQ/YIAdP0MeK2XvcKHHvYIhxUM/Yl+tIvDG OyC8lvJQ8NQyKSQEQhT8Fuh6qLGeckG3BtafJ1XExconNYsWtNSUjrQfCn6lSDjrOqe0 Mh2mZn6rZ0fTpNA5MLmy4nURDpgsawWcwUoSvnzS05THolOP4+QBSJCwpj1MVEWM48xQ kiWA== 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=Idl8sKo+MyTPxfki1g38jo0djbqo1vGnN91+OptSag0=; b=huej+z1g4BeUk6+W670TJB/ITJowS5Wspp7qPKGq9TguIbqFCBw5sJLvyz6nHfN6Of CRHt2gYerXQuLusw4C24Fx3rwEwcgze/t0mLqla3nEYcWoXvLOoYQbVVzuP28rUxxX4E PNEOw4Jg7N1PnNgp1Q/Fekvt2MvToWnCO8XlNabo8VUtsivk65sMYBaxOn8cZfWNZp3n /tMqMJ949eEyoHwNWg81208EUsX4EQFPAKzs6wU78BrKbZZv9VzA/0/SF12K6SN8AdFs tOHi8/vVT9hleblVgqxwdF9PHNWSxGJcnfdcVkz4M+oPbkJ+RIZd8h7CuoKuWUFzdxJl 33bQ== X-Gm-Message-State: APjAAAWJX4Whyihrh3GoYvdvF/lyaR2Gc04yQ6vhPA5i7npLdJ4qGzc3 nFwbGKsbCmVg/0YraT8BWXnUvCISFl0= X-Received: by 2002:a17:902:7208:: with SMTP id ba8mr11152737plb.305.1571420672612; Fri, 18 Oct 2019 10:44:32 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id d20sm7857534pfq.88.2019.10.18.10.44.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 10:44:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v8 00/22] target/arm: Reduce overhead of cpu_get_tb_cpu_state Date: Fri, 18 Oct 2019 10:44:09 -0700 Message-Id: <20191018174431.1784-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::62d 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: peter.maydell@linaro.org, qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Changes since v7: * Rebuild hflags for all successful nvic writes (Peter). * Rebuild hflags for Xscale sctlr writes (Peter). Changes since v6: * Regen hflags in two more places for m-profile (patch 19). Changes since v5: * Fix the debug assertion ifdef in the final patch. * Add more calls to arm_rebuild_hflags: CPSR and M-profile These become two new patches, 18 & 19. * Update some comments per review. (Alex) Changes since v4: * Split patch 1 into 15 smaller patches. * Cache the new DEBUG_TARGET_EL field. * Split out m-profile hflags separately from a-profile 32-bit. * Move around non-cached tb flags as well, avoiding repetitive checks for m-profile or other mutually exclusive conditions. I haven't officially re-run the performance test quoted in the last patch, but I have eyeballed "perf top", and have dug into the compiled code a bit, which resulted in a few of the new cleanup patches (e.g. cs_base, arm_mmu_idx_el, and arm_cpu_data_is_big_endian). ... r~ Richard Henderson (22): target/arm: Split out rebuild_hflags_common target/arm: Split out rebuild_hflags_a64 target/arm: Split out rebuild_hflags_common_32 target/arm: Split arm_cpu_data_is_big_endian target/arm: Split out rebuild_hflags_m32 target/arm: Reduce tests vs M-profile in cpu_get_tb_cpu_state target/arm: Split out rebuild_hflags_a32 target/arm: Split out rebuild_hflags_aprofile target/arm: Hoist XSCALE_CPAR, VECLEN, VECSTRIDE in cpu_get_tb_cpu_state target/arm: Simplify set of PSTATE_SS in cpu_get_tb_cpu_state target/arm: Hoist computation of TBFLAG_A32.VFPEN target/arm: Add arm_rebuild_hflags target/arm: Split out arm_mmu_idx_el target/arm: Hoist store to cs_base in cpu_get_tb_cpu_state target/arm: Add HELPER(rebuild_hflags_{a32,a64,m32}) target/arm: Rebuild hflags at EL changes target/arm: Rebuild hflags at MSR writes target/arm: Rebuild hflags at CPSR writes target/arm: Rebuild hflags at Xscale SCTLR writes target/arm: Rebuild hflags for M-profile target/arm: Rebuild hflags for M-profile NVIC target/arm: Rely on hflags correct in cpu_get_tb_cpu_state target/arm/cpu.h | 84 +++++--- target/arm/helper.h | 4 + target/arm/internals.h | 9 + hw/intc/armv7m_nvic.c | 22 ++- linux-user/syscall.c | 1 + target/arm/cpu.c | 1 + target/arm/helper-a64.c | 3 + target/arm/helper.c | 393 ++++++++++++++++++++++++------------- target/arm/m_helper.c | 6 + target/arm/machine.c | 1 + target/arm/op_helper.c | 4 + target/arm/translate-a64.c | 13 +- target/arm/translate.c | 33 +++- 13 files changed, 390 insertions(+), 184 deletions(-) -- 2.17.1