{"id":2226460,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2226460/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260422125250.1303100-10-alex.bennee@linaro.org/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/1.1/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260422125250.1303100-10-alex.bennee@linaro.org>","date":"2026-04-22T12:52:26","name":"[v3,09/32] target/arm: migrate Granule Protection traps to registerfields","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"77041ea755dffc195936be51b771ebf61d6bc317","submitter":{"id":39532,"url":"http://patchwork.ozlabs.org/api/1.1/people/39532/?format=json","name":"Alex Bennée","email":"alex.bennee@linaro.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260422125250.1303100-10-alex.bennee@linaro.org/mbox/","series":[{"id":501008,"url":"http://patchwork.ozlabs.org/api/1.1/series/501008/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=501008","date":"2026-04-22T12:52:20","name":"target/arm: fully model WFxT instructions for A-profile","version":3,"mbox":"http://patchwork.ozlabs.org/series/501008/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2226460/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2226460/checks/","tags":{},"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=nfTCAJXH;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists1p.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0zhQ1bSWz1yD5\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 22:54:46 +1000 (AEST)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists1p.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wFX4i-0005yq-Hv; Wed, 22 Apr 2026 08:53:04 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <alex.bennee@linaro.org>)\n id 1wFX4e-0005wr-CJ\n for qemu-devel@nongnu.org; Wed, 22 Apr 2026 08:53:01 -0400","from mail-wm1-x331.google.com ([2a00:1450:4864:20::331])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <alex.bennee@linaro.org>)\n id 1wFX4c-0005T5-Q3\n for qemu-devel@nongnu.org; Wed, 22 Apr 2026 08:53:00 -0400","by mail-wm1-x331.google.com with SMTP id\n 5b1f17b1804b1-488a9033b2cso60858675e9.2\n for <qemu-devel@nongnu.org>; Wed, 22 Apr 2026 05:52:58 -0700 (PDT)","from draig.lan ([185.124.0.195]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488fc17f642sm409465985e9.5.2026.04.22.05.52.54\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 22 Apr 2026 05:52:55 -0700 (PDT)","from draig.lan (localhost [IPv6:::1])\n by draig.lan (Postfix) with ESMTP id A537460ED5;\n Wed, 22 Apr 2026 13:52:51 +0100 (BST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1776862377; x=1777467177; darn=nongnu.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=OMEvstJVHgigEudV5H559dC48ky9GaKFB5z4g04o+Y4=;\n b=nfTCAJXHBB07zPe5kNdFBJgkDpSYx09+12VC9s7H7yhGxzOJoRtUHPVWE9E5j4msfW\n +g8vN3Fm6Xt6T+tatZ9IerwMQ5Vl4Y0cb6mBJSYmFQqCTO6LmgQjAFJHqbEF1FAdi1zb\n sa+TDJGyWOULOcGQX5Ej02NgH2UnjYx4gjShsMJHEb8qwEkP7beOSVmSjmnereIAmDh7\n Eb8gXQ0qVHp17FO6KAAWFS1tUlcyfJ8O5MrTlpXk2d+wUkwO/h/ObIqLRUVn467Uw4Ja\n znsThmpQQRurGSeowCcWDiIissZbOpSHYkx/FO+7FVFnTZO4Ewr78Ppwy6xn8s0pjHQm\n mKag==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776862377; x=1777467177;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=OMEvstJVHgigEudV5H559dC48ky9GaKFB5z4g04o+Y4=;\n b=H98cu/YuwHtMiGsFMrCZiKXCwe7utCnnV0fwkU6rAdUtsLd1vfkANm3Nczc6eunAaT\n wbKWIGJq6UNHkbjvNx7Z+pv+xIj/XTJWwuh2icgU02XJpO0utnnQKAUeGS4lY9QCixfA\n 9jGvBcXpkA6ttAwvTBpbDEEDr1THogY02L4plFqPuT9W3dPubQKrqf86fCEFNDX1tF5L\n VCCo9NoSNtXoScrv007o7o0Ci7O9c65zAUn9H0lgTA3LCaV0q7DZeOgYJtrVerLdQXG8\n b7gF6woxQok4ejZh3r9uyipd9Bt0DohmBOXODj8fjf/RgnVfEhCeJi+yDjCayVn9OVPi\n mqNw==","X-Gm-Message-State":"AOJu0YxPoOHjm9RuE3F4E1wYStM1NmBlZLhKD1Z/bx970EOic6Q4LvmU\n +69JqKl0V3s+8Fkfe/CtiIcBOGyJxxEDAPzAAyMeZj2ClBqG633Z5VaCN+4DKfSOGws=","X-Gm-Gg":"AeBDievPNk58eZ/09pp5v+ZPC0w3YHNEJt05IdH3jEWA25tob58+rSXAl0YSJobeccn\n VfVVBRfVlVgkDyazy1lKubOibItI6BTSx8BQw25RntggkN68H2EsWXdkHqw1UYqOU3hucoCY7Gv\n Z1jqS2iC1nVJwpyTzM3G61NhZHVz9AQAPtke4waV3zocgHvkauLWnX/dKEDWMBBTZXyldlJhU4j\n tCoGaHtN/Ig30/ryvuRvOkt6eQoOS4TloJUdTrOWUSqNvLKRHbDjmmY2VfzVb2gkxxupYT0FpDv\n ZdjqlfdLM5JvFhD00gUCOtSJUPbUzUE1CbAZXpQTomY4duinuajRzYW9ypb40ZvOU0PndOVsdOO\n h7xYjUAqv7J6GkANJdRvxEz5o2mVXpVIezWFGMyNtJqdWRbuw+6RCw9UXODsaUiA7xqdkbLmjME\n isfnT9Ezf4R2CwsG5vxhDksw3WbKolnQMIYw==","X-Received":"by 2002:a05:600c:4e4c:b0:48a:58ae:9938 with SMTP id\n 5b1f17b1804b1-48a58ae9f69mr79775915e9.19.1776862377319;\n Wed, 22 Apr 2026 05:52:57 -0700 (PDT)","From":"=?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>","To":"qemu-devel@nongnu.org","Cc":"Pedro Barbuda <pbarbuda@microsoft.com>, Alexander Graf <agraf@csgraf.de>,\n Peter Maydell <peter.maydell@linaro.org>,\n Paolo Bonzini <pbonzini@redhat.com>,\n Mohamed Mediouni <mohamed@unpredictable.fr>, kvm@vger.kernel.org,\n qemu-arm@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>,\n Richard Henderson <richard.henderson@linaro.org>","Subject":"[PATCH v3 09/32] target/arm: migrate Granule Protection traps to\n registerfields","Date":"Wed, 22 Apr 2026 13:52:26 +0100","Message-ID":"<20260422125250.1303100-10-alex.bennee@linaro.org>","X-Mailer":"git-send-email 2.47.3","In-Reply-To":"<20260422125250.1303100-1-alex.bennee@linaro.org>","References":"<20260422125250.1303100-1-alex.bennee@linaro.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Received-SPF":"pass client-ip=2a00:1450:4864:20::331;\n envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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,\n DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n 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":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"Reviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Alex Bennée <alex.bennee@linaro.org>\n---\n target/arm/syndrome.h | 30 +++++++++++++++++++++++++++---\n 1 file changed, 27 insertions(+), 3 deletions(-)","diff":"diff --git a/target/arm/syndrome.h b/target/arm/syndrome.h\nindex 6fcf0ac7572..bc65106c61a 100644\n--- a/target/arm/syndrome.h\n+++ b/target/arm/syndrome.h\n@@ -462,12 +462,36 @@ static inline uint32_t syn_bxjtrap(int cv, int cond, int rm)\n     return res;\n }\n \n+/*\n+ * ISS encoding for a Granule Protection Check exception\n+ *\n+ * These are only reported to EL3\n+ */\n+FIELD(GPC_ISS, xFSC, 0, 6)\n+FIELD(GPC_ISS, WnR, 6, 1) /* Write not Read */\n+FIELD(GPC_ISS, S1PTW, 7, 1)\n+FIELD(GPC_ISS, CM, 8, 1)\n+FIELD(GPC_ISS, VNCR, 13, 1)\n+FIELD(GPC_ISS, GPCSC, 14, 6)\n+FIELD(GPC_ISS, InD, 20, 1) /* Instruction not Data access */\n+FIELD(GPC_ISS, S2PTW, 21, 1)\n+\n static inline uint32_t syn_gpc(int s2ptw, int ind, int gpcsc, int vncr,\n                                int cm, int s1ptw, int wnr, int fsc)\n {\n-    return (EC_GPC << ARM_EL_EC_SHIFT) | ARM_EL_IL | (s2ptw << 21)\n-        | (ind << 20) | (gpcsc << 14) | (vncr << 13) | (cm << 8)\n-        | (s1ptw << 7) | (wnr << 6) | fsc;\n+    uint32_t res = syn_set_ec(0, EC_GPC);\n+    res = FIELD_DP32(res, SYNDROME, IL, 1);\n+\n+    res = FIELD_DP32(res, GPC_ISS, S2PTW, s2ptw);\n+    res = FIELD_DP32(res, GPC_ISS, InD, ind);\n+    res = FIELD_DP32(res, GPC_ISS, GPCSC, gpcsc);\n+    res = FIELD_DP32(res, GPC_ISS, VNCR, vncr);\n+    res = FIELD_DP32(res, GPC_ISS, CM, cm);\n+    res = FIELD_DP32(res, GPC_ISS, S1PTW, s1ptw);\n+    res = FIELD_DP32(res, GPC_ISS, WnR, wnr);\n+    res = FIELD_DP32(res, GPC_ISS, xFSC, fsc);\n+\n+    return res;\n }\n \n static inline uint32_t syn_insn_abort(int same_el, int ea, int s1ptw, int fsc)\n","prefixes":["v3","09/32"]}