{"id":2215443,"url":"http://patchwork.ozlabs.org/api/patches/2215443/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260324160321.96347-1-zenghui.yu@linux.dev/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/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":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260324160321.96347-1-zenghui.yu@linux.dev>","list_archive_url":null,"date":"2026-03-24T16:03:21","name":"[v2] target/arm: Don't skip access flag fault for AccessType_AT","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"9a2324ce67b7e1f4ef10ec3692d80424c6639f25","submitter":{"id":85687,"url":"http://patchwork.ozlabs.org/api/people/85687/?format=json","name":"Zenghui Yu","email":"zenghui.yu@linux.dev"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20260324160321.96347-1-zenghui.yu@linux.dev/mbox/","series":[{"id":497311,"url":"http://patchwork.ozlabs.org/api/series/497311/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=497311","date":"2026-03-24T16:03:21","name":"[v2] target/arm: Don't skip access flag fault for AccessType_AT","version":2,"mbox":"http://patchwork.ozlabs.org/series/497311/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2215443/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2215443/checks/","tags":{},"related":[],"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 (1024-bit key;\n unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256\n header.s=key1 header.b=IKDmyoIa;\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=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.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 4fgFHM5H9Zz1y1G\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 25 Mar 2026 03:05:02 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w54F5-0002zL-AY; Tue, 24 Mar 2026 12:04:31 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zenghui.yu@linux.dev>)\n id 1w54Ev-0002wK-47\n for qemu-devel@nongnu.org; Tue, 24 Mar 2026 12:04:25 -0400","from out-173.mta1.migadu.com ([95.215.58.173])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <zenghui.yu@linux.dev>)\n id 1w54Ep-00071y-Db\n for qemu-devel@nongnu.org; Tue, 24 Mar 2026 12:04:17 -0400"],"X-Report-Abuse":"Please report any abuse attempt to abuse@migadu.com and\n include these headers.","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n t=1774368232;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding;\n bh=tggIhwU4ah+M7xrWWbu3SutZ4qjR8wO0kzZh129W/Js=;\n b=IKDmyoIa9QUZtM10EJ0f+1rxICSGldx9DDwzlgsIO4nRsWhHRfeOVxIcBP/jmAwcpCu7I6\n udf4tIRVlR6EAuB4J5Kv6ksq90pr3x7s6GuPhlEAv1zWh90WU2JT/ItMk4Zzxa54VD9x4Q\n jGSSCFCtqBWH/QttQR6uCBNf7VDZIsE=","From":"Zenghui Yu <zenghui.yu@linux.dev>","To":"qemu-arm@nongnu.org,\n\tqemu-devel@nongnu.org","Cc":"peter.maydell@linaro.org, richard.henderson@linaro.org,\n Zenghui Yu <zenghui.yu@linux.dev>","Subject":"[PATCH v2] target/arm: Don't skip access flag fault for AccessType_AT","Date":"Wed, 25 Mar 2026 00:03:21 +0800","Message-ID":"<20260324160321.96347-1-zenghui.yu@linux.dev>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Migadu-Flow":"FLOW_OUT","Received-SPF":"pass client-ip=95.215.58.173;\n envelope-from=zenghui.yu@linux.dev;\n helo=out-173.mta1.migadu.com","X-Spam_score_int":"-27","X-Spam_score":"-2.8","X-Spam_bar":"--","X-Spam_report":"(-2.8 / 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_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-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":"As per the pseudo code from DDI0487 M.a.a (on J1-16021) AArch64.S1Walk():\n\n  // Check descriptor AF bit\n  elsif (descriptor<10> == '0' && walkparams.ha == '0' &&\n          (!accdesc.acctype IN {AccessType_DC, AccessType_IC} ||\n           boolean IMPLEMENTATION_DEFINED \"Generate access flag fault on IC/DC operations\")) then\n      fault.statuscode = Fault_AccessFlag;\n\nan access flag fault should be generated for AccessType_AT, if the AF bit\nis 0 and !param.ha.\n\nBesides, we should continue to not raise the access flag fault for\nin_debug = true which is what we've been doing previously (before commit\nefebeec13d07) for LPAE and is what intention of the debugger access\ncodepath is.\n\nFixes: efebeec13d07 (\"target/arm: Skip AF and DB updates for AccessType_AT\")\nSigned-off-by: Zenghui Yu <zenghui.yu@linux.dev>\n---\n* From v1 [1]:\n  - handles in_debug = true (Peter)\n\n[1] https://lore.kernel.org/r/20260317122517.47627-1-zenghui.yu@linux.dev\n\n target/arm/ptw.c | 18 ++++++++++--------\n 1 file changed, 10 insertions(+), 8 deletions(-)","diff":"diff --git a/target/arm/ptw.c b/target/arm/ptw.c\nindex 8b8dc09e72..fa6db9e5a2 100644\n--- a/target/arm/ptw.c\n+++ b/target/arm/ptw.c\n@@ -2118,6 +2118,14 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,\n     descaddr &= ~(hwaddr)(page_size - 1);\n     descaddr |= (address & (page_size - 1));\n \n+    if (likely(!ptw->in_debug)) {\n+        /* Check descriptor AF bit */\n+        if (!(descriptor & (1 << 10)) && !param.ha) {\n+            fi->type = ARMFault_AccessFlag;\n+            goto do_fault;\n+        }\n+    }\n+\n     /*\n      * For AccessType_AT, DB is not updated (AArch64.SetDirtyFlag),\n      * and it is IMPLEMENTATION DEFINED whether AF is updated\n@@ -2127,15 +2135,9 @@ static bool get_phys_addr_lpae(CPUARMState *env, S1Translate *ptw,\n         /*\n          * Access flag.\n          * If HA is enabled, prepare to update the descriptor below.\n-         * Otherwise, pass the access fault on to software.\n          */\n-        if (!(descriptor & (1 << 10))) {\n-            if (param.ha) {\n-                new_descriptor |= 1 << 10; /* AF */\n-            } else {\n-                fi->type = ARMFault_AccessFlag;\n-                goto do_fault;\n-            }\n+        if (!(descriptor & (1 << 10)) && param.ha) {\n+            new_descriptor |= 1 << 10; /* AF */\n         }\n \n         /*\n","prefixes":["v2"]}