From patchwork Mon Jun 27 10:22:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 585280 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2954983mab; Mon, 27 Jun 2022 03:38:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sRLWhyxIm5FnuOOQSn3eqMQD2jz2ri7oVPS6TyDtcsCm7LqAqUU07A2c0llfUNiG3dZFAw X-Received: by 2002:ae9:ec19:0:b0:6ae:e43b:80ff with SMTP id h25-20020ae9ec19000000b006aee43b80ffmr7425187qkg.324.1656326299386; Mon, 27 Jun 2022 03:38:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656326299; cv=none; d=google.com; s=arc-20160816; b=p9R9Gs2LersVFrodXAkMPUtRMDwS05pPC6kQ3gUOmX+do9PoA44tKxzIJAE0N4GpIr 2rpLVRC8YVqXzxppATxc/QxiY7KFNteJYwlZYnfFS+FaASA63+EvGBoicH5jAupFR+ti 97Mb9BbO9CwvqGj3e18cNL0TAfsS1xNhutM5K0yaU6g4yodZAMcCYtwWDoIeu6/bjaoZ CvU9Y8ZwfH2GeQT+SfkhcMwMfXcIDeWxNYLgBwXRlFo+NRqa3tcRrB9cSw3IQn8x2q16 sI+75riHJZbY3R9zRhS8LBr8NgnxrHEClkoTzWT3h3PdXdE7u+z/r69bkF/47Dqlps3Q n1PQ== 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:to:from :dkim-signature; bh=mo4a3ghMukRKZTagsQFpVCwO5R9nPbKULZ+sDL0pomM=; b=ODwaPrwe1H+rnVeNe+A8zSxbdeLtS+9p0+zKnzAllrVe0NxDnzA0ywXkRcG8eJqKM8 4+LADZWbjVjZnxlL4KiEVgRZxnudg9wPJ/OSvovA4jFMhy3xRzrh+3WcSoANDT+ltFRP ynWYiKuijEYO2dAmpcvgskV4qZDT9dbkGFrhXhEQzKuUhmEopGv6824fm4oQPYslVA2q HgO+RNghXJN7OWAdNnTwllcQHbKb00mmAKWBDtTJKSjMmaBYm/IbLxGCbAGzOoTpWyEw E3jHmSq8s0Y6RFxBewtWbTbY4FbxMU6Rn+qjiBs9nMKL+L0tR6/j0fTgfhfaGemCuC5v VS5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n1pKZ2BR; 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 im5-20020a056214246500b004727d025d2esi77651qvb.229.2022.06.27.03.38.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jun 2022 03:38:19 -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=n1pKZ2BR; 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]:49894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5m8I-00034p-VA for patch@linaro.org; Mon, 27 Jun 2022 06:38:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41410) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5ltJ-0002JL-2w for qemu-devel@nongnu.org; Mon, 27 Jun 2022 06:22:49 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:33876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o5ltG-0004s9-5R for qemu-devel@nongnu.org; Mon, 27 Jun 2022 06:22:48 -0400 Received: by mail-wm1-x332.google.com with SMTP id m6-20020a05600c3b0600b003a0489f412cso1151850wms.1 for ; Mon, 27 Jun 2022 03:22:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=mo4a3ghMukRKZTagsQFpVCwO5R9nPbKULZ+sDL0pomM=; b=n1pKZ2BRXC70h1ue4c1A4udzo/6vOUGBuUbZlJy9jqsOCXENpsEwwdj1MYcY99R7yN TOkngBdjKX9VbSbXvMFmCwsuDK1hMpHMXJkEWnoNHmXTmMvn20OjqCHXWCwiUnno5X6f EF/3F1/hGWnGefGB3S/mwGIHgIBH5ZWhfhdCbbZ02PUKUspHVNgsAZF4A0rgsfgJcjEw peD7Ya6gHRc2gA3Z8W+YYxHflWrwY/DDo0vmXXxaVjESgkCj9qHpEIkGhe5yfi+KyoOA 3AE1yNZj6p+fLV5eHBWPFI927vJ0wpgKqw+o0EtkqDriec9+CMQXMbvO8zcEKzClvwsx WVkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mo4a3ghMukRKZTagsQFpVCwO5R9nPbKULZ+sDL0pomM=; b=I5xv6hpNN8Z3MneDRq+0Sl1cu7q/TGREEppE4uL2d+cRESICgSXS8HdRuz9wEmgHyz OdiwtB4Dd6Dt00chqZayoLxgJ1dZ+aEwe4zxUU+ct8sTaP9zPlTTA0jQJtSJuRorStHU gP9C8GrJYruUnaejzJT7AKQ0JKo1yK6EBGD+LxJrJ9b6GqFzmT8duVW2BfZCE+3Sdu2P p5/TiIeUt3IDVbgZjJdx9Q3JbA4Epnpwh0qV4uTGBo0QHFBt8kj+Je3WvbAqzbQzDq62 KvN8VejR+06CF3nyEENZ47wy7bDN6QsraOWbG98SIMx3/pkDNfDgyDRLa33Hi2WzvCWa 4gxw== X-Gm-Message-State: AJIora/ETXjecUaIk3LfOEqtsJ4MOK8Z+neV0gqwNP7D7Mjr2jdoA7HK 9I5E8+tNb620MntuO27cr3Ugg1Dnd0giVg== X-Received: by 2002:a05:600c:a47:b0:39e:f953:84e2 with SMTP id c7-20020a05600c0a4700b0039ef95384e2mr19168615wmq.202.1656325362997; Mon, 27 Jun 2022 03:22:42 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d11-20020a5d6dcb000000b0020e6ce4dabdsm9754335wrz.103.2022.06.27.03.22.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jun 2022 03:22:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 06/25] target/arm: Add syn_smetrap Date: Mon, 27 Jun 2022 11:22:17 +0100 Message-Id: <20220627102236.3097629-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220627102236.3097629-1-peter.maydell@linaro.org> References: <20220627102236.3097629-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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" From: Richard Henderson This will be used for raising various traps for SME. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20220620175235.60881-4-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/syndrome.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index c105f9e6ba5..73df5e37938 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;