From patchwork Thu Jun 2 21:48:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578143 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp958560max; Thu, 2 Jun 2022 15:19:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyKlj3Q/32z8hCjToSzyjdIa7FYYs5cQpSaqEAKBwr+YGYYBFwxQzFDxoBuSVxYKnrcUYh X-Received: by 2002:ae9:f310:0:b0:6a6:9b88:7d3b with SMTP id p16-20020ae9f310000000b006a69b887d3bmr254002qkg.164.1654208394855; Thu, 02 Jun 2022 15:19:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654208394; cv=none; d=google.com; s=arc-20160816; b=k5ThGzWcgFzbp69wwaIsIdSoV/BOtuLSTG5n0i4ctUMoS4tnEF0fS7DMV/yASAegVh 5/1G4fBjmrfFtypQ8TwJNkTdCTylDSn8x7EcJW+xqHU/Amp8MPaVTedt5lubOJJA+s7D EwHUcJd8T2ot9vPE9PA1c8Ha2V/bmL962ZqoIimcZ+yU84w3QT/7IP+flroJ2XeZFgUg JIpz929lP++QpiM04V/U43CjQ2nLn5nkoanV+2cWJqqATX6XdtELOEgWFcFNjOSfnSE3 A4VG8p70myUDjkXWebKs4O9guf6vYTviHpYLGMkCzPIMoPrg7Z/L61kAc9BMfxbuGumR snEw== 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=X6UniaTwDbuA5UKJMjAhDBE/HQvImNJGoq3x6BiPqWc=; b=lKcc1G6P1TYphAapPF8ZD9T6pAPQloGfv66fQVkjbJT9ZACLnm0Qwu2xcTjtAjTeKY 3M+6m5R0LT8FZ5Um8WTKIhM8zNoa6BZsPR2es7Dtr4CkH1fq6nNqQ1iQqY3xpMfrhBMg AoOQi1p31J+lxAHnNXi5SvjeFke+YgLjSunB/sHBRm9IC9PE68V0LBpYbnf9OtZ7v707 L0UAkmLiaUNZvJobDsy+hQZxo5ntT1gif7XQoIU70Zr05RL8ZeN8JL5W0lVFUovBlig1 yPpYRZiJoZBQDcT9wdGRMHwxQLxU7lCVnxHPm4UgHvM3zaIyRswZyy5VMLbk/i6keKpk RGZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YtN47zOi; 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 h12-20020a05622a170c00b002f946e7dd50si2332608qtk.442.2022.06.02.15.19.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 02 Jun 2022 15:19:54 -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=YtN47zOi; 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]:55818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwtAY-0000lv-DQ for patch@linaro.org; Thu, 02 Jun 2022 18:19:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwsgv-0004oK-Au for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:49:17 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:37379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwsgt-000059-9T for qemu-devel@nongnu.org; Thu, 02 Jun 2022 17:49:17 -0400 Received: by mail-pf1-x42f.google.com with SMTP id bo5so5798726pfb.4 for ; Thu, 02 Jun 2022 14:49: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=X6UniaTwDbuA5UKJMjAhDBE/HQvImNJGoq3x6BiPqWc=; b=YtN47zOi6GR70z+u5XEwOInZdwUc+wonASgIGlrm8JbWLaUltBuSuqeC0uXCsNGSLO lDYGcFJ1AseqmYJKz5xZnI47fzK/t4O0C2k5fRs7G9eV2Yml+Ldmpsizz7lP0KjqOghQ 5uC4oTm5o078blBIRBMyPM+TFumYQp1qirSHmH0yakAEzMaQMpQ6JhtkBLoYQR9rPvgS 6Xa65U7JraT1XE1thgyD62gR6PUgaGgwMXT3n/GeX7MovkEgceKC36HVJUtJmWhHlrfe 2MguEOC0BzWuAzxxp5U4/RiTrGyGfVdqvMbLy6wcFN41YT2qCNDVRBrtkrUHExGaK78k kSKw== 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=X6UniaTwDbuA5UKJMjAhDBE/HQvImNJGoq3x6BiPqWc=; b=aUcmCNT6qth78upMJxRMb7gIBzdGcKLO2PReykg33HR52W0e7AqXRWjzB9g1k4zIUL 9pcHDUmGDDWAAqIQA2/jI1+aCaaCZWx64moATdNooxPvMWELZxTtlePyaRPAQ4dJxs2V C4hbvRnmHVZB66seVTGwlbDtQsDqV7rXHjfEX56W3y3DPlpNY3IPBlSSHETYl5tTtbK4 cjNrTLJUelYcjF9XZPNrU7IGxHSuFshKniPYGiu/ng/KF026YY1OwXPIAUQMVcKti7Qm iGGkLN9TTXLHWNO/HfcTnaLDxnM0c/yh/5e3WF1kT59OW9b46Y/3HRPL4mGt6whgwSdQ Gb7w== X-Gm-Message-State: AOAM530qBzgoPDxQSdNDrh7p8tDGeoFC60g1H46Q4RArYlrr0c2bygH2 76WOGwBcaviskehNwyWnV80vKTPd3V/YNQ== X-Received: by 2002:a63:ce58:0:b0:3fc:6966:b614 with SMTP id r24-20020a63ce58000000b003fc6966b614mr6095175pgi.234.1654206554509; Thu, 02 Jun 2022 14:49:14 -0700 (PDT) Received: from stoup.. (174-21-71-225.tukw.qwest.net. [174.21.71.225]) by smtp.gmail.com with ESMTPSA id bf7-20020a170902b90700b00163c6ac211fsm3988760plb.111.2022.06.02.14.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 14:49:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 23/71] target/arm: Add syn_smetrap Date: Thu, 2 Jun 2022 14:48:05 -0700 Message-Id: <20220602214853.496211-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220602214853.496211-1-richard.henderson@linaro.org> References: <20220602214853.496211-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/syndrome.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index 0cb26dde7d..4792df0f0f 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 @@ -206,6 +214,11 @@ 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 * ARM_EL_IL) | etype; +} + static inline uint32_t syn_pactrap(void) { return EC_PACTRAP << ARM_EL_EC_SHIFT;