From patchwork Thu Oct 17 18:50:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 176684 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1338117ill; Thu, 17 Oct 2019 11:52:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPJGzyxwSCS06hev1UfHRZJkg3I4SUKj66r6U0vERRzqcfdEFrkbwxBf2WjBGOooIGX4me X-Received: by 2002:a05:6402:13d6:: with SMTP id a22mr5441626edx.165.1571338337474; Thu, 17 Oct 2019 11:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571338337; cv=none; d=google.com; s=arc-20160816; b=ER41UXb82LZozRiejWARD8wouE511LMh2mLkFJu3Z8R9Hh/hAKRKe7mWaICj/ZwIOZ zReVpY41BGsmyCbAudMKUkAAZ3aE4yLKt/vDELuZkdFUfIPuIXnsk1G/gtgZdg/+/iUK 6nyB30IqB4hNXjxxfI/hunYmQRKey27TcNwFyFqbVqSMkyfRl22gWhgYrIqB48thuNyE 6ymAkr9tLs1o/l3jYogLRcZwagxtsbFcDPO7+Ho2vHg42icFXTRvqmYpXsP95W1ed5NN wyP974A6/LxuV2+9EvCAZpQ5d2EFjfqwHbnYI0DyY89uZtP0WpTDomH4My8VLUG0jY2Q 58oA== 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=1nvchNn+VWtn/WVfmFkMyvJoEKsssvYDkhUOA8bdyeU=; b=tYcxaa+d+KCo/2AHgKwpRFH55PqSy68peRx1vQ3jBIhdnzYbKtXRgcqDCgBp/AqeHY E4EOzIY8lyIg+EeDSYOV1ySemqZkrA2GjDm1FNd/Vf22wBo6xxsuwRYVBZ/oXjzezyMg CL4mDOG6UVcn7NwZtzeNranCh1oIJOx8yWBSMjLJThr7C1jHZcNLN7CNaHxOFl/bq2Cl SFVLU8GQR19PNDZ32gW+zIQ8dkJ0ZxI2U2deiFdxBhH/thFLM/PF+xaSIxJlN8cROxhh X5mmCIBwRwXIaa63nUvJuKs6HuQxXfcIQ96yd7BENhAgc1FxkhiM+ccswHR1ecnPCxOj WA2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pjFbZYsH; 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 w30si2296520edd.137.2019.10.17.11.52.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 17 Oct 2019 11:52:17 -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=pjFbZYsH; 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]:56922 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLAsh-0001Sq-Qd for patch@linaro.org; Thu, 17 Oct 2019 14:52:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34963) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iLArk-000125-4L for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iLAri-0000oK-Ox for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:15 -0400 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]:41127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iLAri-0000nx-Gp for qemu-devel@nongnu.org; Thu, 17 Oct 2019 14:51:14 -0400 Received: by mail-pf1-x432.google.com with SMTP id q7so2206578pfh.8 for ; Thu, 17 Oct 2019 11:51:14 -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=1nvchNn+VWtn/WVfmFkMyvJoEKsssvYDkhUOA8bdyeU=; b=pjFbZYsHERgxd0UTphjzgIl1XGCwLM9sm0zge6jhrNA5FoAbgAIAGlgXOPacrBR7VZ a7+LXPT9k/9cXBjB9rCUMN2itliSMl2+Sz3haIPLBT7KOd+2pxylbPfw+tUY8cTSBeK+ W0a6DeoKFq3LFJWolQzQt+Qr3CZFKp0OmdXYYF1knCNWgtEw9GRlaawrVLKVEFudiLSt 6EC2O6LNl5GnpWwQDA0TMwoUbWyssKm189E+qG9nC70d1zE8cYNXWKd9A8MVsdDLtsyI b04B8wZthi7cJUapq/NsNF3nDtD1u75iWGxKQZnccxt2IrTV+KXnxrEwbQMENM9ahcvZ dd1w== 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=1nvchNn+VWtn/WVfmFkMyvJoEKsssvYDkhUOA8bdyeU=; b=ARP/fSzsGTwtEYOv2yZhkMPzPZa1GUIsXWktRkUrb3/ZaUizE2qvvNh8fh7Ds4FUo3 yoX8ebNrca6XIs8/Sqy6LedQRISXACdyIDQwUlT1K3VRIzraOtAobmFw+cQC2ssUexNT ltAkOqCzlxkz5BwVA9byJU3vI9qN2vk0PncP/VwXLOmGsi+5h/hH+7YjJftuSjKTlnmK +ZHejfa4QVx3wr3CKcMmcSf36nsQi/KMpxU0AyrORArEk99OCPaJMTDpC4xis4YtWFI0 Y5XCFciK7qDmUz7CrMp7Ics6lcIVfVRy62vCYhrJn2mGK+VQLX8ROLvlGx1nV17pV2MR TTGA== X-Gm-Message-State: APjAAAUB0nvtm3OyekO0ffwLgWEaV4v24QL5GpbA5PATIz3dhEseaqtr TQ/B+qhCoD32O1eNtzPnZ/juXyFLWxk= X-Received: by 2002:aa7:9f9b:: with SMTP id z27mr1826642pfr.65.1571338272750; Thu, 17 Oct 2019 11:51:12 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id s97sm5009256pjc.4.2019.10.17.11.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 11:51:11 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 00/20] target/arm: Reduce overhead of cpu_get_tb_cpu_state Date: Thu, 17 Oct 2019 11:50:50 -0700 Message-Id: <20191017185110.539-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::432 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 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 (20): 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 for M-profile. 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 | 1 + linux-user/syscall.c | 1 + target/arm/cpu.c | 1 + target/arm/helper-a64.c | 3 + target/arm/helper.c | 383 ++++++++++++++++++++++++------------- 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, 368 insertions(+), 175 deletions(-) -- 2.17.1