From patchwork Mon Jun 20 17:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 583172 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp917622mab; Mon, 20 Jun 2022 10:59:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1syuMIQUzHWsOwhSW7/aDVJAHSk+4IGoNG7/zJHgBuxGxlPL33vrn+1sSnRg9ZIer4kBVed X-Received: by 2002:ac8:5c85:0:b0:305:1ac9:9af3 with SMTP id r5-20020ac85c85000000b003051ac99af3mr20214204qta.210.1655747986536; Mon, 20 Jun 2022 10:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655747986; cv=none; d=google.com; s=arc-20160816; b=pvt2T5w8P6dzSKTZy29Gib3kNgvHrqSnBR4ikXh2k76yb/I2LYje4F7m1067/F2PRb oZtXCnB6HyyuMApByFIgJnxccZAoT4vZXGfBgQlo5rLI/kpIfxdV/3e22PtW9VCQ+hC7 e8P9Bh6sRY6IW3zQMcec+WpnI5jihNjXZgnc/IvhXC/8BSPBTDWD9NyY8oHpTsUdSCbb Mp2AsVc8C2pD1vEQtXqJi70kc4cjvyyvXkRBmWyhR7AKv6caoCrdGNb9DLzR5pxy4dF5 Vs6Y1elekpq/adNZjncHmIviJMWf78/UUOGJoPvQ5KlzHcXQtkUNBLwx0rsdYcogsQhy ZGtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=+C/PGq+HnUIHwmNMLjSjjZWblYyrjc+K5YuntUcgNSg=; b=01hK549qexVZiH7ViYKeUPKzZypXCU7sgUqudzNzy+0HLcYx21LoTWsbhv+n+eB5h0 U7APmjwjCC8aFbca/jSTugEYgA6XEZxlI0OnOqxWhF1ik+GNfcGuLsvdosG4VoSmOIlK 9IEeUqWJBTy7evqmAWLN8tZSu+iOTR8w/W0J7wDafyd+NsOVI2pF/4xAs33J1ZF1dZ9S l9Jsp2EtT1sjOg80EtCKFHDqgKOvdvFS+/ISWS4hBeES5mBfIKJnRWohlq2MQs5vj/vy HYM2hBaNeh1qENTt+MCR1cbE4jXHhRq93qwqE7TYcT+36XcUOm21bzyFRMLvtCtw5vLX mMPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GrXasSHf; 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=pass (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 c18-20020ac87d92000000b00305224c08a3si8967740qtd.22.2022.06.20.10.59.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 Jun 2022 10:59:46 -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=pass header.i=@linaro.org header.s=google header.b=GrXasSHf; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:59598 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3Lgf-0000ea-S9 for patch@linaro.org; Mon, 20 Jun 2022 13:59:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3LZq-0005SF-O5 for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:42 -0400 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:42681) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3LZo-0001Kq-OO for qemu-devel@nongnu.org; Mon, 20 Jun 2022 13:52:42 -0400 Received: by mail-pg1-x52d.google.com with SMTP id d129so10872826pgc.9 for ; Mon, 20 Jun 2022 10:52:40 -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 :mime-version:content-transfer-encoding; bh=+C/PGq+HnUIHwmNMLjSjjZWblYyrjc+K5YuntUcgNSg=; b=GrXasSHfi9NIvoS6x9HwseW4O1ojE/ZP3FoRgi7L9H5E0zKQnf+WiyDGS2KF+WgHUL Zg99uGfSwutgE+3LQzYFz9AqQvdt5T/1KPutM8jMokg8rkkh4zZoZoBxXLI0gIYsbHAZ DENBa7R3aGDHY4WCWbSCL+bndDbkEum0L0SWVlMuWZDo8lkKsGxrD/day3XY01XjTvZ2 0kMrZq+sEV60fBoxLZKIAXyRBq6reNc0ULmyOX4m6HVvPiVNtNUn0ZRbq5KpFiEfEBlH Vkyq0nAC0iOQcvSuEC5e4u6Oz7lIkjn5ofbJYTGg3CXG8n8sCAVRaso7qo9lP48l485h 2uMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+C/PGq+HnUIHwmNMLjSjjZWblYyrjc+K5YuntUcgNSg=; b=52gZc6ZKQbpEoq6USDFqzEhYHzf3qNHRxYYFhVvtv7ZdDnPPL03fpRGgiiY44xaERJ RSP11mvNiJXs74MB5ljtLyfPnUj9aH7BRuwfBGqiLd0fPOB4Agc4vOqzq1vNkx2nT3mr NZP3s6QEBPc0dSG+RvP5xCViYEVj24HXPXid/zmpTjIj/P7eQgBvR8PXWEapIpcpgv6j XtNCoUJi6RdhFdbWu6FODA7m7RPNLRY0/2JqTMzIqZPg6wPKTTKPS5SXiVgPcuqG5SNG eKrDp+JxoHSey/tR7MhKn3EsRUjSTH3jxLe5RCmq9SIyZC8SASDpNwa3Ub45vCiUv/lT F1+g== X-Gm-Message-State: AJIora8csqamfx3pv915KeVChbfO9SFWTDC8nwuAXGJnzX864fWLNEvr 5bqyTo6VSFcMnlagKPIxr0LXn+OhWnyL/Q== X-Received: by 2002:a63:2cd0:0:b0:3fe:2810:ba99 with SMTP id s199-20020a632cd0000000b003fe2810ba99mr22811835pgs.27.1655747559493; Mon, 20 Jun 2022 10:52:39 -0700 (PDT) Received: from stoup.. ([2602:47:d49e:3c01:a3e0:8a80:7b85:aea6]) by smtp.gmail.com with ESMTPSA id j14-20020aa7928e000000b00525133f98adsm5138138pfa.146.2022.06.20.10.52.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 10:52:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 03/51] target/arm: Add syn_smetrap Date: Mon, 20 Jun 2022 10:51:47 -0700 Message-Id: <20220620175235.60881-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220620175235.60881-1-richard.henderson@linaro.org> References: <20220620175235.60881-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will be used for raising various traps for SME. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/syndrome.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index c105f9e6ba..73df5e3793 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -48,6 +48,7 @@ enum arm_exception_class { EC_AA64_SMC = 0x17, EC_SYSTEMREGISTERTRAP = 0x18, EC_SVEACCESSTRAP = 0x19, + EC_SMETRAP = 0x1d, EC_INSNABORT = 0x20, EC_INSNABORT_SAME_EL = 0x21, EC_PCALIGNMENT = 0x22, @@ -68,6 +69,13 @@ enum arm_exception_class { EC_AA64_BKPT = 0x3c, }; +typedef enum { + SME_ET_AccessTrap, + SME_ET_Streaming, + SME_ET_NotStreaming, + SME_ET_InactiveZA, +} SMEExceptionType; + #define ARM_EL_EC_SHIFT 26 #define ARM_EL_IL_SHIFT 25 #define ARM_EL_ISV_SHIFT 24 @@ -207,6 +215,12 @@ static inline uint32_t syn_sve_access_trap(void) return EC_SVEACCESSTRAP << ARM_EL_EC_SHIFT; } +static inline uint32_t syn_smetrap(SMEExceptionType etype, bool is_16bit) +{ + return (EC_SMETRAP << ARM_EL_EC_SHIFT) + | (is_16bit ? 0 : ARM_EL_IL) | etype; +} + static inline uint32_t syn_pactrap(void) { return EC_PACTRAP << ARM_EL_EC_SHIFT;