From patchwork Tue Sep 12 14:04:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 721775 Delivered-To: patch@linaro.org Received: by 2002:adf:f64d:0:b0:31d:da82:a3b4 with SMTP id x13csp1666117wrp; Tue, 12 Sep 2023 07:08:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7dEp/J37Om9R+eclEj23yjZmQTTWSNmz2i4A/GvHFEWOA77wgVEfekejBojNUOoEU0LTs X-Received: by 2002:a05:620a:4443:b0:76d:a784:9685 with SMTP id w3-20020a05620a444300b0076da7849685mr3807016qkp.28.1694527707152; Tue, 12 Sep 2023 07:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694527707; cv=none; d=google.com; s=arc-20160816; b=qyjyiJhmdEkdKhS16edrtveFxHMmhlnAkpbsHXmmDQkaJJTzeo+j3dADbAmRN84zRE fsigtJ0MTmyX9+PqnJ6gJbc7tGw2h1jYy2gfDUHYusSSsVvG5OEOM3BNst2H8S3ptb/U /RFOtHnn7GOKgZfVULwZ97rwgz1BlCYvgM0veGRIGNzHIMa08ItDfxEZ080t93igpG5S LaM7JT/TrDwFh+os+hRpYUpt7NZdbTQAwhYCHActoh48NJodbLx8T2q8HJKInvvA8VJE UKW5pb0lUbO3syV1UzKCecMHHqK5J5EGciE1Gwvu7ZHVvtaY/un6J9Jygu192moFgUT4 zJJA== 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=q4Dgx+OSBmpEBFmVsndMXcNNk4c9tAUi91q/Iq2oNR4=; fh=H2AmuqulvQE+T5zu97MCEUC3z9wF9NssS7895NhR/+c=; b=mvgCd6JAK2Uiv+Qa7x6+BK4rZh0g9j6tj6iNq1A6D9WIbJPTfup4ffPh7vH8CgLbfC 62MAh6MBcwjqturIyQcqDwm111MEC42nylGZEL/qS0Tiornwg5uZOvJv/Y0NF5BI6I3D yw28VaHSOUYF+CMKV+sOo0cjlBbWOslf73gApsNIoU5VkgAkqMGcxRKMsX9mYqx4vm4T i4oDzd9BCTbXyq/SC8Zu5VPkMNNOzqHdUauMzaekLAvmg8VDuLpBVIInzd+0CQQtmZvn AzDqqnUfmnASJ/vj75noHx//r6w1OMyeUE1qOuk4ZMKJXt4j/AMW5Vg6+hYStssznNWq ypAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Gbo34vf/"; 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 16-20020a05620a04d000b0076cd82547d6si6132688qks.166.2023.09.12.07.08.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Sep 2023 07:08:27 -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="Gbo34vf/"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qg410-0008OM-DA; Tue, 12 Sep 2023 10:05:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qg40e-00088s-1D for qemu-devel@nongnu.org; Tue, 12 Sep 2023 10:05:01 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qg40P-0003q5-7b for qemu-devel@nongnu.org; Tue, 12 Sep 2023 10:04:51 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-31f7400cb74so4820171f8f.2 for ; Tue, 12 Sep 2023 07:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694527479; x=1695132279; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=q4Dgx+OSBmpEBFmVsndMXcNNk4c9tAUi91q/Iq2oNR4=; b=Gbo34vf/Wvsq5Ttl1uvcIEZ0nlxBsUoznL+ZrWoYBj2mcqV9Kf6iKugNsu3VJTKazx P2YuHPPShGEsBonJedmL6irDnxCDzaYhavnw4dPv4t+1iknCwUYKitVVnJ9iZW4lNamg rNL/Eq37/q3SabYLk68qLo5OSgLPCmnrjq025EDDWZNv/HzUh+/MvRGRuMOPJFDwuQTm IvemU4UhrCc37eSmKeOyIu/gBy4vhCQSI8y+Pql/hhdMyPfNaozNyPS/3VmbY+Qbdc0T VhS4AqfDMRlM1xXZlg98QZPKce5+HYvB3UbHxO4UdF51WSZj644VStk4WESy14bWboXl 1HzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694527479; x=1695132279; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q4Dgx+OSBmpEBFmVsndMXcNNk4c9tAUi91q/Iq2oNR4=; b=Xv/WyevJjYHYIcJgI3labo5g/RNHzBV0LsbmL7RA1NrnDqw/R+rFWYayAz8oNzHSbn 3yDjO8Za7KHKPi6SU5e9CtxtqWVhjprzQ2IJAWVAlkJA6to0heq556sClStoj6skNxIw pxjeQvh+30ggZEPR/XJmtONnSBUyqH3htGxGQ9I5H6PAWT3wYocSZSXLd6bstUkn9T/I Ej6yxHrZSYeuM/KIRCKvNcm4lpnUljTrHu5EIDkh+zBHx++cg7nybsgaBAt+HKrOrHg0 MEAhjLlHHycDkAMimNQGQLiT5xErg40weKAsPwPPN1d0CuTq+85EqeQPeBSh1fo8VFs8 7qBA== X-Gm-Message-State: AOJu0YzRhbQfG+qcDVdCr5MSjuMW7KM7h4JiDjS941TDxrBxIKy5Lecd opbQWF3fj7Bwvlip939tIKkzBgfrgEx/udHa7SE= X-Received: by 2002:a05:6000:1d91:b0:31f:85dc:1114 with SMTP id bk17-20020a0560001d9100b0031f85dc1114mr9593544wrb.33.1694527478634; Tue, 12 Sep 2023 07:04:38 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id r3-20020a5d4983000000b00317ab75748bsm12892672wrq.49.2023.09.12.07.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 07:04:38 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 04/12] target/arm: Define syndrome function for MOPS exceptions Date: Tue, 12 Sep 2023 15:04:26 +0100 Message-Id: <20230912140434.1333369-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912140434.1333369-1-peter.maydell@linaro.org> References: <20230912140434.1333369-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.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, T_SPF_TEMPERROR=0.01 autolearn=unavailable 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-bounces+patch=linaro.org@nongnu.org The FEAT_MOPS memory operations can raise a Memory Copy or Memory Set exception if a copy or set instruction is executed when the CPU register state is not correct for that instruction. Define the usual syn_* function that constructs the syndrome register value for these exceptions. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/syndrome.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index 8a6b8f8162a..5d34755508d 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -58,6 +58,7 @@ enum arm_exception_class { EC_DATAABORT = 0x24, EC_DATAABORT_SAME_EL = 0x25, EC_SPALIGNMENT = 0x26, + EC_MOP = 0x27, EC_AA32_FPTRAP = 0x28, EC_AA64_FPTRAP = 0x2c, EC_SERROR = 0x2f, @@ -334,4 +335,15 @@ static inline uint32_t syn_serror(uint32_t extra) return (EC_SERROR << ARM_EL_EC_SHIFT) | ARM_EL_IL | extra; } +static inline uint32_t syn_mop(bool is_set, bool is_setg, int options, + bool epilogue, bool wrong_option, bool option_a, + int destreg, int srcreg, int sizereg) +{ + return (EC_MOP << ARM_EL_EC_SHIFT) | ARM_EL_IL | + (is_set << 24) | (is_setg << 23) | (options << 19) | + (epilogue << 18) | (wrong_option << 17) | (option_a << 16) | + (destreg << 10) | (srcreg << 5) | sizereg; +} + + #endif /* TARGET_ARM_SYNDROME_H */