From patchwork Mon Feb 27 23:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 657153 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2616969wrb; Mon, 27 Feb 2023 15:04:18 -0800 (PST) X-Google-Smtp-Source: AK7set8M3bYqRwbOSHEhtyAXnpHKrPBj+HN0ijpNLRC2/Hfuq4eS2lxNRtahsYYn7FoWoAqqrj1C X-Received: by 2002:a05:622a:14f:b0:3bf:d07e:edf6 with SMTP id v15-20020a05622a014f00b003bfd07eedf6mr1550480qtw.36.1677539057826; Mon, 27 Feb 2023 15:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677539057; cv=none; d=google.com; s=arc-20160816; b=Mm1g3aVuHXTRnJ9E8wWC0smNzWCwc/cnebO8pKzwTBEEsdq91ZGXDMSjd2O1gbjYYi MsTBx7Xm/68yDJ6kT3nElHU5cy3YSwrFRX8a4WKbJNapH58WKcj4nkV7efmphoaRhTOP BkCBQnt5D1A2rfmoGCnUwE3FYWKoGiit0tmFeZNNQJ4lS2Dc1G/KZOua3GcPdmG6U0I+ AelmRg79KB5tO5OsIxiyhDtcQg+9jilbKyBywQ48dWKSwnKi1dzhrXZJVdTvMcMAwF8g MJnWNWIu5sCLm3x7F55Lbz879n8IbSOISBOdHGVwyiaOsTTVtCd+BZdYyfD1lXbW/yMH /o2Q== 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=BdnIrBC/vjhypfMOEhRm01STyDVGWe2QDHvXiznUOKk=; b=IP3uhPgM6EhIgnfbKMw0Beyow2CfOejr5XhlQElI29UbZtYn5AchANiB8gsrab/Yu0 yrLRNT1MKi3LlCi9x/jYdyyh8t7MLuUKmWI/bqEY5Hg/R3qUvMHD5LlZoFG+7HIj/6c/ IAClK6D7OYKVKxkSqbN+ssaby7cP759vQgbyvLlObMHYgptLzKG5EBLOna0LnutJ70qH UPMeCPSO+CHv8RKKnR5guvA2VVqgcPVclfY6cXRbjq5ZjCRu/cilQzYhFYzOuvNMFniu BkDeqBcnY7kFuT9CL5LhkYR6BP7SaRt+ZkJs7AtnPQu7ygvkkll+d9xPomF2S0lb6eRn 4JYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TJrGn2ZW; 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 z16-20020ac84310000000b003a689910c02si6364256qtm.746.2023.02.27.15.04.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 15:04:17 -0800 (PST) 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=TJrGn2ZW; 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 1pWmVU-0000EY-T8; Mon, 27 Feb 2023 18:02:08 -0500 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 1pWmVK-0007xQ-RR for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:02:01 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWmVH-000160-RK for qemu-devel@nongnu.org; Mon, 27 Feb 2023 18:01:57 -0500 Received: by mail-pl1-x62b.google.com with SMTP id bh1so8468581plb.11 for ; Mon, 27 Feb 2023 15:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BdnIrBC/vjhypfMOEhRm01STyDVGWe2QDHvXiznUOKk=; b=TJrGn2ZWEhXVIu936f+7Yx3wEJHuml2EvqSC2JEYKiyGyhS9x2yWfuBeZ3jw1QdLYe dneVW4I2ZhsYA4PHG1Zcj8gwiobVjg4TXDpht3Uw1i4RUCl2ZXnfdL+EUGfXXcsPlLtQ dPLkVGvVEgHyvoXPzYy3tjpmfyQRdYBnqf/tLBIwFnCFxP7J0f5wlMRu7oYm8qs2Ll/K KHSBML1CZlxh5TDFDjBk3kYGh8O3J+HRzyylGETkhTGGIYuuHLzPjmf1AA5w01ZovBD3 5nDGhsJ29yezKdL2E2VZrCVdTdsXsfPZkirVbgSvjWmBBOcJbnSle6hoq+yL/bsKXBqy xeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BdnIrBC/vjhypfMOEhRm01STyDVGWe2QDHvXiznUOKk=; b=CZlVseO0SlDVz/pfx3ajC0hXbIMg5xtY6fN83QGARjqmS5FoDgzkSmvOtSDzQupK2L qZz/BvyKz3NStUp9g09oipSgMDqGPe5bjAPbcXX+WxyapUUVQdthJP9IS7uGZ+0UGb8q OaPt5Ykcj36Srl/GhOJkox/ICO/bb474LV7OmDrbLrOyJis2uM6TMZknxvoP1fxRv0IK XrD24J0fAIT5rhBPeGVTda7cS0WcPhKslSyF/xta68QbxKep5eN27Db16I2MBLsXVZRh VwSZ2v0IyMcZBbAc0h6Yvh9IltoipBrW/wuOOpEm79EnQR0/hH9X08KWdEDB0YAOD2aE dDOg== X-Gm-Message-State: AO0yUKU/xGh+nG7I01TpKIbskOQTeiypOIVJC4wiuXcfyTD67nwtfPG+ 6aA3e37wsoIfUHXx736op/5SI8Mj18USny469/A= X-Received: by 2002:a17:90b:1805:b0:234:b2a:8251 with SMTP id lw5-20020a17090b180500b002340b2a8251mr1002546pjb.0.1677538913237; Mon, 27 Feb 2023 15:01:53 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id u2-20020a637902000000b0050301745a5dsm4406130pgc.50.2023.02.27.15.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 15:01:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH for-8.0 v4 17/21] target/arm: Add GPC syndrome Date: Mon, 27 Feb 2023 13:01:18 -1000 Message-Id: <20230227230122.816702-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227230122.816702-1-richard.henderson@linaro.org> References: <20230227230122.816702-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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 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-bounces+patch=linaro.org@nongnu.org The function takes the fields as filled in by the Arm ARM pseudocode for TakeGPCException. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/syndrome.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h index d27d1bc31f..62254d0e51 100644 --- a/target/arm/syndrome.h +++ b/target/arm/syndrome.h @@ -50,6 +50,7 @@ enum arm_exception_class { EC_SVEACCESSTRAP = 0x19, EC_ERETTRAP = 0x1a, EC_SMETRAP = 0x1d, + EC_GPC = 0x1e, EC_INSNABORT = 0x20, EC_INSNABORT_SAME_EL = 0x21, EC_PCALIGNMENT = 0x22, @@ -247,6 +248,15 @@ static inline uint32_t syn_bxjtrap(int cv, int cond, int rm) (cv << 24) | (cond << 20) | rm; } +static inline uint32_t syn_gpc(int s2ptw, int ind, int gpcsc, + int cm, int s1ptw, int wnr, int fsc) +{ + /* TODO: FEAT_NV2 adds VNCR */ + return (EC_GPC << ARM_EL_EC_SHIFT) | ARM_EL_IL | (s2ptw << 21) + | (ind << 20) | (gpcsc << 14) | (cm << 8) | (s1ptw << 7) + | (wnr << 6) | fsc; +} + static inline uint32_t syn_insn_abort(int same_el, int ea, int s1ptw, int fsc) { return (EC_INSNABORT << ARM_EL_EC_SHIFT) | (same_el << ARM_EL_EC_SHIFT)