From nobody Mon Feb 9 13:42:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1765272377; cv=none; d=zohomail.com; s=zohoarc; b=BQxGid28of8TK9RyM4RlUP/Y4Bee1MKi+NAhn3TVE9mbctMiIGesks/N5EMOMs31kLDalgiEzvrtM24RtRfMdO0+rm/2/qBNM66wOSkNl9hy6cqBZuZ1kLHkNWDXQ0tPpsZPxRhIgokfU9IJAFuVuurp19zLsNVRz1W9W2TkPX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765272377; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rMYHo9CKGWoLVCQcgyGnKo7wkmT6Z8PYd+ym/Y4GtS8=; b=jLhZUkgT7xM0qLjtZB7QIzdHhYcDFRStjhXMiPCoVF7QgexUNgf+JqhI4Uk0WdeJdGYd+2FWrT+Yuyb1biB3J6wHuI7m94UbOxxrgmCkP/M1YKAWfVQLlRGykJC+BEqU6Jpne1Unw39sAhdCGV0sPq2IKo0kHg0lOw6L40pnkPc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1765272377404614.7009456092845; Tue, 9 Dec 2025 01:26:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vSty1-0006n0-4Q; Tue, 09 Dec 2025 04:25:09 -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 1vStxy-0006km-Rm for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:06 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vStxw-0002Jr-Ii for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:06 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-47a80d4a065so1421525e9.2 for ; Tue, 09 Dec 2025 01:25:04 -0800 (PST) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a7d6fa121sm28672735e9.5.2025.12.09.01.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 01:25:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8CBB35F747; Tue, 09 Dec 2025 09:24:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765272303; x=1765877103; darn=nongnu.org; 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=rMYHo9CKGWoLVCQcgyGnKo7wkmT6Z8PYd+ym/Y4GtS8=; b=KCHPqWXGU/2dZJ1IH8ktlwgZVyNeNE6zSZ+oJ/vl21wVwI1Th1BLVbvpzJ3qHXJIwn xZHlRI+PUdM+1chcnFXT3dIPfWJvNgiRaPvFRE98CkQtsKMYU5iMZoee9Cu7sKMoiW2Q 0kQl1QnsLFcknqtrg42f27ipQ45/nCSkdAB0Xa4MNPA9V7mFPXy8dPKxMi0fMQmLTJhw YywdjlGOE9Y4Cds6fqJKMqXXkCTEg7dys6uZB82lBPJH1JZPSvIN8j5qzKgwU3wJSw30 JnainY6OkIOtXlVIdk3AExV+JH5d/B1xIG6y7MFSiVAH8+G/o4rDyzDhBRl4cvLWAQAw mgLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765272303; x=1765877103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rMYHo9CKGWoLVCQcgyGnKo7wkmT6Z8PYd+ym/Y4GtS8=; b=GBmhgGvx4Y6esL9p/mDSu8/1kgLZZRwah3K1iMKw6C4wI2vKsfe5V1ildDfsgV5I3E 3jlTWfNrkB7QcBTI1aEh6gbetgBGzEUsyJ+yVWe0j7HlWK5x4rZdLkDhx4cQYbRq4MLp hk9agIl1cU76Grn5UHRKYhL0ZDVmbb2lL75nDjT0g/xzTIAaVP+VWGR7Kgzxgy+lQv3T aJ9/tWvqS4jrEzI91bvEbUwxirEAxQ3u1uoR394E3hARK8UftY1UPI98oLM5VMTpHWOC dhBPYsHX9Xn6tFr9ZDgeY9FymRqws9rbpGA7JUnAAFQmtvKp976oiVLlPTIfXhLekhSu CsCQ== X-Gm-Message-State: AOJu0YyEh7EdRB6utikwOYCEGo4SpaGrA0kOIu2kQ1tp/zdXDyntoud4 dKxS3GAEzm+XDFdZh4/VkbYbvIAWIWNvskBFkbnBZVAsthKLMoI72JSYeVUrXnjnDYE= X-Gm-Gg: ASbGncsCAXipwaGnq0qTUP+fG12wMrU0TlF30FBNb2R0EKWsIeSdvRR8G32E+PWK7kI O2C5fxPCIBZTVr1SldEh1xSBIgfwluN6JvrfiszpUzjVPN5fSDur2oW5curjOmJRDP5BCrL+Fcc Jd3Fov1RgKsPNmD/+VIy4bJUMBKgjohRxTBLopfV38NnIKVtRiEqlEoXeWpXeZFlVjcknaFUyZ+ Jd+k39EI2WdCUkY5efIjbQadcHc2MPN3c9FGiAaTGZcUzLvQAKoyEKsSwrI7Qeei6/lPu8UpXky lsvkza7Kt7TqkjhaCPOwIoZPUKPbgf7SH78MROuX4dEdhWgiPHjjaecmnsftv9obpEag+OZkWwd ym8HV5V/qUDZDCFJsVPXlqTjWWICEmYhquZoSMB1SfL5YCM69vD+nu/uwvkYV+lihGmDWIZHKJT fxxPK08x3XyBc= X-Google-Smtp-Source: AGHT+IEUcYKtImaN+MB6jR+ErxfH9ywEYeN+y7kh/5b8IZ7mKK/9NEqXOrD/m2uKJEz/Nb9gGR63iQ== X-Received: by 2002:a05:600c:529b:b0:479:3a88:de5d with SMTP id 5b1f17b1804b1-4793a88deb1mr102905335e9.36.1765272302827; Tue, 09 Dec 2025 01:25:02 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Alexander Graf , qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Christian Stussak Subject: [PATCH 1/4] Revert "target/arm: Re-use arm_is_psci_call() in HVF" Date: Tue, 9 Dec 2025 09:24:56 +0000 Message-ID: <20251209092459.1058313-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251209092459.1058313-1-alex.bennee@linaro.org> References: <20251209092459.1058313-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765272378248158500 This breaks a pure HVF (--disable-tcg) build because the fallback stub will always report false. This reverts commit 4695daacc068cd0aa9a91c0063c4f2a9ec9b7ba1. Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Christian Stussak --- target/arm/hvf/hvf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index de1e8fb8a05..70d34063df8 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1935,7 +1935,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcp= u_exit_exception_t *excp) break; case EC_AA64_HVC: cpu_synchronize_state(cpu); - if (arm_is_psci_call(arm_cpu, EXCP_HVC)) { + if (arm_cpu->psci_conduit =3D=3D QEMU_PSCI_CONDUIT_HVC) { /* Do NOT advance $pc for HVC */ if (!hvf_handle_psci_call(cpu)) { trace_hvf_unknown_hvc(env->pc, env->xregs[0]); @@ -1949,7 +1949,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcp= u_exit_exception_t *excp) break; case EC_AA64_SMC: cpu_synchronize_state(cpu); - if (arm_is_psci_call(arm_cpu, EXCP_SMC)) { + if (arm_cpu->psci_conduit =3D=3D QEMU_PSCI_CONDUIT_SMC) { /* Secure Monitor Call exception, we need to advance $pc */ advance_pc =3D true; =20 --=20 2.47.3 From nobody Mon Feb 9 13:42:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1765272382; cv=none; d=zohomail.com; s=zohoarc; b=IcwzmSEj8icA8758fxBS/e3j6hv15wflhbJHfY6RITQwaj4cIUiQsD2ySQxOaAVMczDzZke9YFynOz/BZNvjU3RxfEiCO+n2LSDSRQR84SxIY7OWhTjTvOd6xiNyqsXQlKL3wAKluICH+krs7BUmBEb8+NT83l/kT3HImBsTA4o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765272382; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=D32U9cx+cTFgXu76SMf/O5vqmn3V0bDLwJQvk6aC9NQ=; b=Qeqbqa9edETDqgVx0cDQv0yisCQ+t1Ono9Xa9nZG5nYPmhSb2k5/xTKAlXcPB75zOeuM8aigjBXkIovIMJ78tQN+27UYAtHeOlB6vX6Ft+pul2tYTy421ar73cM5jXrLpGTPBk9du1zkL7lnGPN3NAnnIvyqxUfyxGk6NujBV5Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1765272382059480.48126335325514; Tue, 9 Dec 2025 01:26:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vStxy-0006kB-6E; Tue, 09 Dec 2025 04:25:06 -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 1vStxw-0006jb-Kd for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:04 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vStxu-0002HN-SP for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:04 -0500 Received: by mail-wm1-x342.google.com with SMTP id 5b1f17b1804b1-47118259fd8so43791055e9.3 for ; Tue, 09 Dec 2025 01:25:02 -0800 (PST) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47a7da1dff5sm11913265e9.15.2025.12.09.01.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 01:25:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A3E035F87D; Tue, 09 Dec 2025 09:24:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765272301; x=1765877101; darn=nongnu.org; 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=D32U9cx+cTFgXu76SMf/O5vqmn3V0bDLwJQvk6aC9NQ=; b=RreA443tCYB5aB6CwdjVcKTJKc7E9kUnRJNhgoLDob17/UXlwS6AdGGLQ+TkQwPf65 hLvhXe1c75vR30R37gSvPmM9v4e7rYwri4++2EnSchqg4zLs1SVNTQ4gvstr3xjty2Pi Sl8s8OqNC7hw3pukbY384gwv8gDTw8fGioGA9cHThXyOTKm3+v8i2B7fnz7CX2oC1pzZ YezOmTkCut09fHDcs0J3x/QByd0UkaFB5CNLPA9tb58VX8ENyzVpRGE9oX1CTbWxbjXi jL/PRd6VZu/sg6m6f1A6uVL4gkjQdiUjYKD8o1b5ktqnFiNdfREDAzbMrrD2U1iO65I4 mhtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765272301; x=1765877101; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=D32U9cx+cTFgXu76SMf/O5vqmn3V0bDLwJQvk6aC9NQ=; b=Q4x3MPxZjmRfSKlXhf6BThZfRi8Y97oNXjtuW0wPs7qlvfvk4vxiArlgwaSH6+siN7 t+bQn+MXaLj/dEkOOq5l2R+cJgKQZJLeg9ZyC2wmn80vsqhta+PdE9iflzk07WQEcY3H RzaCAYTjy7brO5OApXDNyz5BfeHbx4QVyi392bkP5mIT/b1bifhESY7U5RyPaSURgyz7 rxOEDgFxZ9PhMkzFOxky8juX6BKBWE++4UeicT2yy8lfjON1Jg4yy94g67UbjHl57fvP BIu7TML98qFokezUdI1NrcIO02CFnOnLZ7EYnBcMxr+rFw7IzKDdujYUZGdUM4yNurBq /Oaw== X-Gm-Message-State: AOJu0YzeSMyUjo1ZMR0jgRg5usue3cV1FeQ6ssC8SqXa385tpPThpWDo vMvSOXyLlZ7S7ZupLG2syWFDav7oBedzOLX+26lhLHWfgAB2qIZZICu/Ch0b/bag1eA= X-Gm-Gg: ASbGncuYW4mWpejXPg6yGeUH/OAz7vzZVBaj/B0QWZo2hujRXYagb44is/LyWhj4xO+ aUsxFIoHEMZkFuCFgcbhDCXEGvET5vmn1whQEMLSI3QghQX/Whd1AsPbmU8Sp2kULuMMIYwS7Ld LT5J2QQ1RfvONoiwSxZd5yNl7COJtj2Fv04Lt5dpPwc7PgTn2MVmxZfOpqIc40ImoRnZfWpRSTT qTbQuy/PX1UY8yoWPDex4JiyzFy9dI4BXgFdfq0EoPlpYV1NrD6YGwG9dTiqrBnz2cBTjsgu+uG zEvp5yLyGNAnen5G0bDTaEAX0FTgACQWTYbMuzxfrYAAPlDjP6z6QSyitmYfY2rS2VdMX48k1tU fDnDXTJPWTb2MqsLr2us5gSx+g4JU5zJprKayhV8czUSTtq8NWNAwUSCbeBemwIaOCsEZ6/6DCG gQavIV0ep6LcA= X-Google-Smtp-Source: AGHT+IGakU9p5jhlouHTot85tqzwsJzhkEblpwepO6Jpag6s+Rayam5b/FLx5WaYeV0IqSaV+lNGjw== X-Received: by 2002:a05:600c:458e:b0:477:73e9:dc17 with SMTP id 5b1f17b1804b1-47939e5dad4mr116714185e9.35.1765272301329; Tue, 09 Dec 2025 01:25:01 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Alexander Graf , qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Christian Stussak Subject: [PATCH 2/4] target/arm: ensure PSCI register updates are flushed Date: Tue, 9 Dec 2025 09:24:57 +0000 Message-ID: <20251209092459.1058313-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251209092459.1058313-1-alex.bennee@linaro.org> References: <20251209092459.1058313-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765272384958158500 When we handle a host call we report state back to the caller via registers. Set vcpu_dirty to indicate QEMU is currently the reference and hoist the flush_cpu_state() and make the call unconditional. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228 Signed-off-by: Alex Benn=C3=A9e Tested-by: Christian Stussak Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2 - Fixes->Resolves --- target/arm/hvf/hvf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 70d34063df8..8e2940217a6 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1942,6 +1942,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcp= u_exit_exception_t *excp) /* SMCCC 1.3 section 5.2 says every unknown SMCCC call ret= urns -1 */ env->xregs[0] =3D -1; } + cpu->vcpu_dirty =3D true; } else { trace_hvf_unknown_hvc(env->pc, env->xregs[0]); hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); @@ -1958,6 +1959,7 @@ static int hvf_handle_exception(CPUState *cpu, hv_vcp= u_exit_exception_t *excp) /* SMCCC 1.3 section 5.2 says every unknown SMCCC call ret= urns -1 */ env->xregs[0] =3D -1; } + cpu->vcpu_dirty =3D true; } else { trace_hvf_unknown_smc(env->xregs[0]); hvf_raise_exception(cpu, EXCP_UDEF, syn_uncategorized(), 1); @@ -1980,10 +1982,12 @@ static int hvf_handle_exception(CPUState *cpu, hv_v= cpu_exit_exception_t *excp) error_report("0x%llx: unhandled exception ec=3D0x%x", env->pc, ec); } =20 + /* flush any changed cpu state back to HVF */ + flush_cpu_state(cpu); + if (advance_pc) { uint64_t pc; =20 - flush_cpu_state(cpu); =20 r =3D hv_vcpu_get_reg(cpu->accel->fd, HV_REG_PC, &pc); assert_hvf_ok(r); --=20 2.47.3 From nobody Mon Feb 9 13:42:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1765272361; cv=none; d=zohomail.com; s=zohoarc; b=jhf2h1cPVKmZ+1r6dIUYH5wnpVIlw2kitEqkWj6eK1SoeRGfQdDbt62jumN5jFoHN3Gy3E5DQ50WrRSeT/gdM1csbxkdIOXW22BpUurx2FmfQGCu/EfCWFDTBt6tkJmMgEzrlB54N89g5N8Ct59RFTkEkxCPpCVjBxxwnDao9gA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765272361; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=IZJsc/7zy+r+NN+k7x6+P6QM2USPYl25ybm2MMGme1Y=; b=nBfmcbgwdktU2VLYJI0IWGvAYtFyi2/aVtgOkVTMdxp05+H2UY4hYTGgIGZULt+R9K4dyVQiDhkJIYwIy7H83UxCL1R61cz5mT0emvr9Tps1f3hHx+4cU6WVWrPDVPNO83ohuDXWcER8BhqBELEWvJib++Nak6fSaANW6U+PrwU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1765272361025360.04752789776114; Tue, 9 Dec 2025 01:26:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vSty1-0006nz-Ud; Tue, 09 Dec 2025 04:25:09 -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 1vStxz-0006lF-4k for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:07 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vStxx-0002PJ-3p for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:06 -0500 Received: by mail-wm1-x343.google.com with SMTP id 5b1f17b1804b1-477b5e0323bso32854945e9.0 for ; Tue, 09 Dec 2025 01:25:04 -0800 (PST) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7d2226e7sm31598901f8f.27.2025.12.09.01.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 01:25:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B88EC5F892; Tue, 09 Dec 2025 09:24:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765272303; x=1765877103; darn=nongnu.org; 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=IZJsc/7zy+r+NN+k7x6+P6QM2USPYl25ybm2MMGme1Y=; b=qLQnjK/xn+NeB8CjsmxC66tkvrKYrLMOBC6xyuBj7U6y6sWwnP4pgRlg2eqM6CJCcU l+WlZbjU+cZyRM4qRqt3epxFAdY8h01xBsRHTPyth5XLIoM4lzxXgoyvDa5BR6Ky4RB8 DB918aNgTkqvIYJj+tQJ7RMU5DCtstiEyMuPWVP5zVZCQ+ZhOcJl1f5w4GQwd6xhayps DoatKAM9T+to2ffoc8HwYXNjUwzM5hvjGVGrJp534enm5zcBGF8BboXujk5nXARN4H+l MrhKnWWTsK1fFGsVvwF315aoCCnwMx9eBnXeZAyex1nGNXBkZYKXim3ax0dMagJ709Ct 6aMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765272303; x=1765877103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IZJsc/7zy+r+NN+k7x6+P6QM2USPYl25ybm2MMGme1Y=; b=EkLr/ODLIxocA+LBEtBKAGssfuXyIlvcoUayudi8qbMpDG5P9Hm0XL6njU14qzq0ye /30cCgsbGUHDnjacFtZYsVi04FWTc+HjXd4Y9vAZ5JfT6o0EuSCUDbAPhCesYJ0Ibanr aKJxHbIwQ3ooYcNyNnj0kWQkdofJ+IaMOZUPw611NATdW2KYCZpA4fjYOmj2EtNI/G6+ F7CbmnGHClB+DP++vFR1P9LK0RTicy9Xl2FQ6G+NcVh54PGw4FbQXMaNADncQAT8Hydr SHsivkv4YqS4nIrEmP9rKsB5vetMSoAUwoW2pep1L+/iT5f09nPwwQ0yVxeayvgX5x22 DWQQ== X-Gm-Message-State: AOJu0Yx17pe3IxkO2ggMJCeFErSZZfL7xsNnHUjuk/+Ohi/bLfq/TDef V+fMeBzoC7pPOSS8eFNRxEUNBJODnAIF3Ix56k2z4eddMaKBMryUjJNGN5CUFQDWAgc= X-Gm-Gg: ASbGncvN0XTkueT3ShPyPhLNeeFxzHdfs+kklfOkX3GWoHC29Z0AOcIgJhK2lMXy73y R7mCFEKoV7xD4OenBWimGVn3gXVZqJI8X7z+DQH8njk07mhBZPVPkSiDJ7DbArIRESwDWxL0vEh /CLhSLNh5v8lmjD4YmHbyuXDpTO1xxx8+evbaJqOT3Bueh2ZC/EBbvvfBpEs/l+LRqhn0Q0cK1Z sTbybUaSS7Y+UVhIlUq8RCFrgMUJHLOz8lzRXMIYpWj1DK+mRnNKnDPkVqneAhdIJ/X2FC3k6to zPccJ3IniN5PcnhotXG1zitvKhUCTa+hmGm0GHqgHwmLyFiXY2hmvx/bdFUAidbKlDusp2hmVE7 EK/acMnL0CnhEkrdXk2M+xXsPrEEpRLX7KjNIDq3N9F3XblGnOlRmnB7Wy0mjEZU4xSvKopo60y xZz0DYbgH0rL8= X-Google-Smtp-Source: AGHT+IGzACwnbivZERwEL46t6zyXatTk00Oosxpt0+Dy0ORY3ehssEp7POa43K5jNVNibgBocnlR6g== X-Received: by 2002:a5d:528b:0:b0:42b:3383:bcf4 with SMTP id ffacd0b85a97d-42fa071b8b6mr837358f8f.1.1765272303437; Tue, 09 Dec 2025 01:25:03 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Alexander Graf , qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/4] target/arm: make HV_EXIT_REASON_CANCELED leave hvf_arch_vcpu_exec Date: Tue, 9 Dec 2025 09:24:58 +0000 Message-ID: <20251209092459.1058313-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251209092459.1058313-1-alex.bennee@linaro.org> References: <20251209092459.1058313-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765272362159158500 Without this we can spin tightly in the main HVF dispatch loop and never release the lock long enough. As a result the HMP never gets to run and shutting down the system deadlocks. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3228 Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- v2 - expanded commit summary and contents - added Resolves link --- target/arm/hvf/hvf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index 8e2940217a6..8288b605299 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -2020,6 +2020,7 @@ static int hvf_handle_vmexit(CPUState *cpu, hv_vcpu_e= xit_t *exit) break; case HV_EXIT_REASON_CANCELED: /* we got kicked, no exit to process */ + ret =3D -1; break; default: g_assert_not_reached(); --=20 2.47.3 From nobody Mon Feb 9 13:42:30 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1765272358; cv=none; d=zohomail.com; s=zohoarc; b=X1ozSzvdxC9Ed0WJA1093gmnHq5u8xnaMxKwWNxCFA3F2ZXmOhHmHtEUep4KHkD04/FJgH7ckrpmH95KUELoYBN1wyP7ZkIf2+Y/lj7M2tDO3e9LHdF6nDT3PgG0qrZABCoX5WCNUMcvrCwZ5ZjHTHbyS44qdRfxvCkucQ9FAp8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765272358; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=7RMZHxSEFh1H+EN4/zwFqnLve2WFyXWk67mVJ0UVQEQ=; b=HxIzyDeJQWntS6Ju4OqsY25aAOgO5yb5XOjVorTBNAzaazpD/j4zHF+DwtmXoaOMBzTtzxeVu5zhXRCjp7ennCarpWzwCk+4vWbwucnZgk9eXCQS0xloZdUXgoOQ+GS4qZJ+sz5zV25GZZHpmeIe8cFFAvM5gDd2cy22Y8NE4sc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176527235861148.321505658849674; Tue, 9 Dec 2025 01:25:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vSty0-0006mU-0r; Tue, 09 Dec 2025 04:25: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 1vStxy-0006k5-3K for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:06 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vStxv-0002Hi-Fm for qemu-devel@nongnu.org; Tue, 09 Dec 2025 04:25:05 -0500 Received: by mail-wr1-x442.google.com with SMTP id ffacd0b85a97d-42e2e08b27eso2283885f8f.1 for ; Tue, 09 Dec 2025 01:25:03 -0800 (PST) Received: from draig.lan ([185.126.160.19]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42f7d353f8bsm30858331f8f.43.2025.12.09.01.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Dec 2025 01:25:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CFFA95F898; Tue, 09 Dec 2025 09:24:59 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765272302; x=1765877102; darn=nongnu.org; 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=7RMZHxSEFh1H+EN4/zwFqnLve2WFyXWk67mVJ0UVQEQ=; b=RK8JXedGjqVuus8qdHmD7nTUQjiwBXqPj5BvME7mBAmt6Lg5G8y6fcWAkBBkF8Gv+3 deOwxkU5mpI2aslOeDEh0foGeqc4MamiKhYGs0P0PiohqLbh2LX5XlkFj0TO3wwT7PDJ a4kPPTmQN9/ymPPIwXOiREHxezrasrwZDDf8/C5uz+BID7azONM+Ai/JxLYfLYQaiqU6 j7egNlXdSHt9xc3BMIwWoDap8y+VUKprlh+qQ7ZMg68WnoIIaHIR1AbF8viDiMqrornY TqvFqMoTm4z2ZSxYnXNG8On0GgGiT/nnCTXabCInneBCpheXE9ppicrGt08SgIK7PTt5 1wcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765272302; x=1765877102; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7RMZHxSEFh1H+EN4/zwFqnLve2WFyXWk67mVJ0UVQEQ=; b=tUPqMVmnNXLUTmv0z7RDAXt+rSlw2Z01jeVHLbydF5a8OGC1utt3IZ7PPD8RGH3bWj lT1180qVqoTc02rze8XjwhvjzTCPKV+5ampjA6YpwJOvJSes+zQSrNYPn8zGbnECQx4N 0l2bSrLnOmJTiqJ/dqVEFbthqG7OEGf+8wMsXjB0SlYTMCRDCYUMwKYRm5mMcCOtTmc0 3gdY7yi7d4yVyILuaEZG9O3sU83dbRZWjj6S+oE9w2LHuQiYq3qSUoRdmZOLKNZOW4bO UhHraP1S8HQvDcm8h65DJmMseUCIex+fGfPTLuL6sp18gEOqiqQEygMkeRzhpsPsDzF/ KKTA== X-Gm-Message-State: AOJu0YypehAeN+xvpWmbWfX/ytXedtfKRMAs83F9pOWvy4Xi9+VJLUMF s3HWU0CugfemY/TtUsD+MIYi9Xfc39LJT/SgMN82xu64cJ//llQFVtzZQyw+MASS6nw= X-Gm-Gg: ASbGncuWYn+dwhn3xHbHjj+13x2j2EKOgQkIZSG/Yu0jxPcNk5f0nj6//QXul+QBw7S 6MBl46NbZsZ/402YuAckwButrE/7RYkCZ2BKnkm20mMENBsV7XHIPJSckB3AJPJPxWEIfg4zblj Iz1wgvTgcUPfvO45v0NEoZMJRhMZnzoKcxDXGamPaZSZBNIhBHSQfmYM+S9XxiyINpUe1grJYKm IXM6R47mYA1DfD9L/ecMA7/YsqQTkAeCDSQjM06Lke1sgm/vA4jD5nPEPvffAYREGbtNQ/g7wNW oNG2LgxIw35rHBHOR4IJjFE6i9ikgC8fDBi34uYwmp9V7Y0Q3o6/WYNhsot+1nKZMFEiTaYbCcE HQ2xYy3LO/Gt+dF9JHIx2m+w9HCgtVF8U37ytS27JysVIHiwnDwUsBoJulpSNV90FObsFPpQxd/ QWyIwM2TBbx58= X-Google-Smtp-Source: AGHT+IG7Y9B2K+FlMc1KuDQmJ2LGmOiz/9npsbYAthUvLaA+C4MSJePu0Ze9MziNaXgCNNTPgeDDSg== X-Received: by 2002:a05:6000:613:b0:429:dde3:659d with SMTP id ffacd0b85a97d-42f89f563femr10728348f8f.47.1765272301857; Tue, 09 Dec 2025 01:25:01 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Mads Ynddal , Alexander Graf , qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Jessica Clarke , Richard Henderson Subject: [PATCH 4/4] target/arm: handle unaligned PC during tlb probe Date: Tue, 9 Dec 2025 09:24:59 +0000 Message-ID: <20251209092459.1058313-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251209092459.1058313-1-alex.bennee@linaro.org> References: <20251209092459.1058313-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.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=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765272360899158500 PC alignment faults have priority over instruction aborts and we have code to deal with this in the translation front-ends. However during tb_lookup we can see a potentially faulting probe which doesn't get a MemOp set. If the page isn't available this results in EC_INSNABORT (0x20) instead of EC_PCALIGNMENT (0x22). As there is no easy way to set the appropriate MemOp in the instruction fetch probe path lets just detect it in arm_cpu_tlb_fill_align() ahead of the main alignment check. We also teach arm_deliver_fault to deliver the right syndrome for MMU_INST_FETCH alignment issues. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3233 Tested-by: Jessica Clarke Reviewed-by: Richard Henderson Message-ID: <20251204203540.1381896-1-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e --- v2 - Fixes -> Resolves --- target/arm/tcg/tlb_helper.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c index f1983a5732e..5c689d3b69f 100644 --- a/target/arm/tcg/tlb_helper.c +++ b/target/arm/tcg/tlb_helper.c @@ -250,7 +250,11 @@ void arm_deliver_fault(ARMCPU *cpu, vaddr addr, fsr =3D compute_fsr_fsc(env, fi, target_el, mmu_idx, &fsc); =20 if (access_type =3D=3D MMU_INST_FETCH) { - syn =3D syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc); + if (fi->type =3D=3D ARMFault_Alignment) { + syn =3D syn_pcalignment(); + } else { + syn =3D syn_insn_abort(same_el, fi->ea, fi->s1ptw, fsc); + } exc =3D EXCP_PREFETCH_ABORT; } else { bool gcs =3D regime_is_gcs(core_to_arm_mmu_idx(env, mmu_idx)); @@ -346,11 +350,18 @@ bool arm_cpu_tlb_fill_align(CPUState *cs, CPUTLBEntry= Full *out, vaddr address, } =20 /* - * Per R_XCHFJ, alignment fault not due to memory type has - * highest precedence. Otherwise, walk the page table and - * and collect the page description. + * PC alignment faults should be dealt with at translation time + * but we also need to catch them while being probed. + * + * Then per R_XCHFJ, alignment fault not due to memory type take + * precedence. Otherwise, walk the page table and and collect the + * page description. + * */ - if (address & ((1 << memop_alignment_bits(memop)) - 1)) { + if (access_type =3D=3D MMU_INST_FETCH && !cpu->env.thumb && + (address & 3)) { + fi->type =3D ARMFault_Alignment; + } else if (address & ((1 << memop_alignment_bits(memop)) - 1)) { fi->type =3D ARMFault_Alignment; } else if (!get_phys_addr(&cpu->env, address, access_type, memop, core_to_arm_mmu_idx(&cpu->env, mmu_idx), --=20 2.47.3