From nobody Mon Nov 23 04:26:17 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1795129383; cv=none; d=zohomail.com; s=zohoarc; b=Gsv3EWBEAro6vKMdVd4o9ZHJ/NgFJU7VF9kpeRAU0RDB4OMzI4C6ujMFcvR4ehWGyyYpuETr3bor6XL5MJAVlErJtVAgE68O/EG6ZEacaozA/Wag71JtU8F3Wpd9liScwlNea6si+DAFrWU1zK2p2CtKHCeau9ahmbPgdg45B7I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795129383; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RtsI/XIT+6rH2gx7TOK1YxLGOMRr//idZuN+pb4yhUg=; b=YetXO7iNIWHT6lwY02m2JocIc6eFYAnVhfooYalOTwONbPTieHYIoJUNlEaZUwAxHCawVbscurQ1gYp9FAGR0jtZHi556WfJqTmz7iq5lj3TxqZELYGZCIPBJXFLQlscad0bKEklc63mlLZFwtXBqw2cEAft4gBnkCdaYGFY7O8= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795129383341165.77993712881357; Thu, 19 Nov 2026 15:03:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xUB95-0003VE-7N; Thu, 19 Nov 2026 18:02:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xUB93-0003Um-N5 for qemu-devel@nongnu.org; Thu, 19 Nov 2026 18:02:21 -0500 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xUB91-0001AP-Hs for qemu-devel@nongnu.org; Thu, 19 Nov 2026 18:02:21 -0500 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AJJUcBD3367594 for ; Thu, 19 Nov 2026 23:02:17 GMT Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j27b5ruh3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 19 Nov 2026 23:02:17 +0000 (GMT) Received: by mail-vk1-f197.google.com with SMTP id 71dfb90a1353d-5eacc615f73so210620e0c.1 for ; Thu, 19 Nov 2026 15:02:17 -0800 (PST) Received: from localhost.localdomain (pmd666.hd.free.fr. [82.67.153.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb85399d52sm65268935e9.6.2026.11.19.15.02.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Nov 2026 15:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= RtsI/XIT+6rH2gx7TOK1YxLGOMRr//idZuN+pb4yhUg=; b=ebgUQkfR79djZsP5 Ca36sryLCfRgYCm6eKjfnLvUbLGvUrAeicPTBKm+iGEP1DI7Hj4M172IHNLvejzY DuULFls+2FsvCQ+f+6OzCh7DgIZlzhbZAjx7gLt0TPyZRTfv3zhVxRufvUbk/Fcx HipJAziiSMyDWJxM+To3xinm6en3D9eGmR5XcFU6F2/4ruk9PH17J/YGz4oySz8R ytGOlqAoEVKaOD+mk5KogJxH9yny2WLdbnPw9jgnt5E5zJfJYgOOeyNFADML9O2o eCmWUR/wDzSLws0eHXp36/T4UZuxjJeUH/9XtsVJsHus8XlOqcPDygPse6r5rfs2 MDdZ9g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795129337; x=1795734137; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=RtsI/XIT+6rH2gx7TOK1YxLGOMRr//idZuN+pb4yhUg=; b=B2WxYT7O7BnZ8IyyrfJiRPa4U3vOKkrgYj6RpLmUvbfGFHSWk2v8sBjPn8W7dkkggl +81fn+9Rwi+npfBBvPAmXir9y7XzYh3MvWpub8yt0KIHYQ4/vPcciYymaTI9RtNiLWvb uNOemER8MNP/WBWttPJsPc2NlSGANgG6SqC4iIIRYlJyG2cZ8eGiU20wVOtVQeWjpFVC PA7vNwCQkWoO57xmBKAMGUU2USHqKiblxVTNo2cvAe52Zm6MOEXGTELGyyik7Wykomtu 2/7hFofZ8T/EZiewNGJjm1shHMFv56YtRMb+Ri8OWTubKS4UM1wtloL3ZLH/tq6acawH dBXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795129337; x=1795734137; h=content-transfer-encoding:content-type: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 :content-type; bh=RtsI/XIT+6rH2gx7TOK1YxLGOMRr//idZuN+pb4yhUg=; b=Wg6trHGMCylYoFNUO/jxz8Hh71zQzNzx0IDolidlOpv2d16ZrNbY0vkFCbQKmYlBVw tgS2Ls3SeMuCH1ySnOBhMA3VoIDlrQyIDrkRn6FsXAfUVgZP8nCzz3M+KjHKkChPO+ti 7bTh/A4j/6HNpQ+5+c0C2xQHOPnIBGy6oT+g48Qhvo5AIshjV1+sMUIeSKVDBOHkeuzf Ee4elf59yA9Avw5Z9/e+/1jfBzqhK+VvQqBDx23Zw+7WR2qitWLxZDXyjSl4n031u0JH yyhMfrhn6Xa3df2jjreJVyiIRLJFCgpqACPbvQ47Te2zAWkzZvQzZbz5Sx3tjWy/6lbG TSjw== X-Gm-Message-State: APuU4Z8VONI+hO+lcU9TRk0XkZ/ivsM17sV0N8qvHCm35VMhNLLVgXlT OIOyQAJngMaBcnsEjpFg9jLVWrtNPQEf89Zv2n1zTUeF51xNhezlr2No/2CQD0NBoKsk+A0OHwv TwBKUysHycgREYNGeD8WsWU5ROZJHwq5emsWXPayoAFRkUxTySqEEaUFx+WnnasB1uK0m X-Gm-Gg: AYBFou20OFsPrtwwfDaN5IzfEaYr4QzoMHeTya8vIBvAEvvKRzK63Inb/q23pFJtIs+ N40GCxJiXEboK9cyVxdzWiLTi5bvfFFigvyvIUdLTjuRRQWFu2XssFdOZSMLlhtWpd8mRGhcyPF 0tZhz2YnOenaqFPLbnjvQvL/cLFVlk/9CWNCMAWpQ1WE7tZzXCjkgIbtPPFTSursXlNZmmPvES8 08mDuDQ7Q6Zki5vKVUCLEOkBxQZBhTlXHn9E3bEoYcYJxNFF241TbtvDayHY9Lbw20rhUY+pSGw FAzJlcxTasiNiXHeQNlZPno+hzswFrjBoD8RY8sWTuZlOFdDoZ786A59quX3NqI1hWVjrHwwcq1 tSLeZYIJdtqvjwS62NG/y8MGml9ab5WCL6OGEy4M6JQBf6+EF5mV+AIsDLNzQO4ryhQnTlVhu/P djZV3T9melWwuD0Q== X-Received: by 2002:a05:6123:110:b0:5ea:c3bc:c567 with SMTP id 71dfb90a1353d-5ee8aefbd39mr806586e0c.9.1795129336840; Thu, 19 Nov 2026 15:02:16 -0800 (PST) X-Received: by 2002:a05:6123:110:b0:5ea:c3bc:c567 with SMTP id 71dfb90a1353d-5ee8aefbd39mr806501e0c.9.1795129336266; Thu, 19 Nov 2026 15:02:16 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Max Filippov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/2] target/xtensa: Describe RER and WER register operands Date: Fri, 20 Nov 2026 00:02:04 +0100 Message-ID: <20261119230205.4744-2-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261119230205.4744-1-philmd@oss.qualcomm.com> References: <20261119230205.4744-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTE5MDA5MiBTYWx0ZWRfX1JTOouR5WZq7 lnBvQQ+Fiok3RqaKqZ9FngCj98oHR8jCgBBF2n4PXQnt36VPGJkET/7H2pjFIKOl1GqfSEc/TjU qU7Tcx4lfVHyy9NPKXHjRJAempiBIq0= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTE5MDA5MiBTYWx0ZWRfX+p4nu9M6MScc 40KNpX7ZHEo0z4Xhz4zMHDB5j54TdRMLHI4ow2zqGTaG4luuzb/b6EtyknCUbXprjj1NEQdPfrQ Cagcap+/68YUZ1+qWgOIJhBDA9tJWJZj9ua2cCwCz5G+QMLhHL1ningUI+1cxaXVB+Rn8R97xeA ufA13a78EUJ/62+KanO2BoACg+/fsPX9ZARmfkqyCD3XVywNzAikYC+qABdV0oidvs2EIstez1U bWv3dA4HUgUdyRKA8Qde73OKiOL//4C1tPxZ0IaIOWcSA+ou4q86sLTRlS4nDS7LkQWH218TL62 C/zYHec8W9CN1cJHp4aSLxPNgik/Skr7oUX1oUDgvA4lYACiZAH8a9+M7HlGvq+HultmabXpT0f UnjaAmH1gMtn02SsFvoyH3VostGD0IxxlzDsYkZ0EDiWQ4HF6c8UzSM7aZOvY2S99qMubJpZPLn ejcwUofjqt3HEIE8E7w== X-Proofpoint-GUID: PKaFsiV2DUOodY6fP47EecZcvC7TCPXc X-Proofpoint-ORIG-GUID: PKaFsiV2DUOodY6fP47EecZcvC7TCPXc X-Authority-Analysis: v=2.4 cv=LPTz05W9 c=1 sm=1 tr=0 ts=6aff7ff9 cx=c_pps a=JIY1xp/sjQ9K5JH4t62bdg==:117 a=nz36NW0qrpeEijYxj/H2Ew==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=H1htKhyfUzTIpUZEvLMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=tNoRWFLymzeba-QzToBc:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-19_05,2026-11-19_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611190092 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.180.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0b-0031df01.pphosted.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1795129383625158500 Supply the two register operands missing from the dc233c, lx106 and dsp3400 ISA tables. RER writes its destination and reads its address; WER reads both. The translator expects these operands and otherwise consumes uninitialized arguments when a guest accesses an external register. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/xtensa/core-dc233c/xtensa-modules.c.inc | 14 ++++++++++++-- target/xtensa/core-dsp3400/xtensa-modules.c.inc | 14 ++++++++++++-- target/xtensa/core-lx106/xtensa-modules.c.inc | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/target/xtensa/core-dc233c/xtensa-modules.c.inc b/target/xtensa= /core-dc233c/xtensa-modules.c.inc index 0f32f0804ab3..30a7970207cb 100644 --- a/target/xtensa/core-dc233c/xtensa-modules.c.inc +++ b/target/xtensa/core-dc233c/xtensa-modules.c.inc @@ -5814,6 +5814,16 @@ static xtensa_arg_internal Iclass_xt_iclass_div_args= [] =3D { { { OPERAND_art }, 'i' } }; =20 +static xtensa_arg_internal Iclass_xt_iclass_rer_args[] =3D { + { { OPERAND_art }, 'o' }, + { { OPERAND_ars }, 'i' } +}; + +static xtensa_arg_internal Iclass_xt_iclass_wer_args[] =3D { + { { OPERAND_art }, 'i' }, + { { OPERAND_ars }, 'i' } +}; + static xtensa_arg_internal Iclass_xt_iclass_rer_stateArgs[] =3D { { { STATE_PSEXCM }, 'i' }, { { STATE_PSRING }, 'i' } @@ -6519,9 +6529,9 @@ static xtensa_iclass_internal iclasses[] =3D { 4, Iclass_xt_iclass_xsr_atomctl_stateArgs, 0, 0 }, { 3, Iclass_xt_iclass_div_args, 0, 0, 0, 0 }, - { 0, 0 /* xt_iclass_rer */, + { 2, Iclass_xt_iclass_rer_args, 2, Iclass_xt_iclass_rer_stateArgs, 0, 0 }, - { 0, 0 /* xt_iclass_wer */, + { 2, Iclass_xt_iclass_wer_args, 2, Iclass_xt_iclass_wer_stateArgs, 0, 0 }, { 1, Iclass_rur_expstate_args, 2, Iclass_rur_expstate_stateArgs, 0, 0 }, diff --git a/target/xtensa/core-dsp3400/xtensa-modules.c.inc b/target/xtens= a/core-dsp3400/xtensa-modules.c.inc index 28ea3d75fef0..5c358207ed69 100644 --- a/target/xtensa/core-dsp3400/xtensa-modules.c.inc +++ b/target/xtensa/core-dsp3400/xtensa-modules.c.inc @@ -54194,6 +54194,16 @@ static xtensa_arg_internal Iclass_wur_phasor_offse= t_stateArgs[] =3D { { { STATE_CPENABLE }, 'i' } }; =20 +static xtensa_arg_internal Iclass_xt_iclass_rer_args[] =3D { + { { OPERAND_art }, 'o' }, + { { OPERAND_ars }, 'i' } +}; + +static xtensa_arg_internal Iclass_xt_iclass_wer_args[] =3D { + { { OPERAND_art }, 'i' }, + { { OPERAND_ars }, 'i' } +}; + static xtensa_iclass_internal iclasses[] =3D { { 0, 0 /* xt_iclass_excw */, 0, 0, 0, 0 }, @@ -54719,9 +54729,9 @@ static xtensa_iclass_internal iclasses[] =3D { 2, Iclass_xt_iclass_wsr_atomctl_stateArgs, 0, 0 }, { 1, Iclass_xt_iclass_xsr_atomctl_args, 2, Iclass_xt_iclass_xsr_atomctl_stateArgs, 0, 0 }, - { 0, 0 /* xt_iclass_rer */, + { 2, Iclass_xt_iclass_rer_args, 0, 0, 0, 0 }, - { 0, 0 /* xt_iclass_wer */, + { 2, Iclass_xt_iclass_wer_args, 0, 0, 0, 0 }, { 1, Iclass_rur_fcr_args, 9, Iclass_rur_fcr_stateArgs, 0, 0 }, diff --git a/target/xtensa/core-lx106/xtensa-modules.c.inc b/target/xtensa/= core-lx106/xtensa-modules.c.inc index f2b5efc6ec88..d7889e707932 100644 --- a/target/xtensa/core-lx106/xtensa-modules.c.inc +++ b/target/xtensa/core-lx106/xtensa-modules.c.inc @@ -3291,6 +3291,16 @@ static xtensa_arg_internal Iclass_xt_iclass_nsa_args= [] =3D { { { OPERAND_ars }, 'i' } }; =20 +static xtensa_arg_internal Iclass_xt_iclass_rer_args[] =3D { + { { OPERAND_art }, 'o' }, + { { OPERAND_ars }, 'i' } +}; + +static xtensa_arg_internal Iclass_xt_iclass_wer_args[] =3D { + { { OPERAND_art }, 'i' }, + { { OPERAND_ars }, 'i' } +}; + static xtensa_iclass_internal iclasses[] =3D { { 0, 0 /* xt_iclass_excw */, 0, 0, 0, 0 }, @@ -3606,9 +3616,9 @@ static xtensa_iclass_internal iclasses[] =3D { 0, 0, 0, 0 }, { 2, Iclass_xt_iclass_nsa_args, 0, 0, 0, 0 }, - { 0, 0 /* xt_iclass_rer */, + { 2, Iclass_xt_iclass_rer_args, 0, 0, 0, 0 }, - { 0, 0 /* xt_iclass_wer */, + { 2, Iclass_xt_iclass_wer_args, 0, 0, 0, 0 } }; =20 --=20 2.55.0 From nobody Mon Nov 23 04:26:17 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=oss.qualcomm.com ARC-Seal: i=1; a=rsa-sha256; t=1795129377; cv=none; d=zohomail.com; s=zohoarc; b=Re6lqj+wts+QT3JWKMNpIlgYXEkWvnELvVyszTbwQVt+XXzY8PYNdg4uo8NZ0IPdnqJWJX+dBE2kV8B5YpujG9Se7xZFOrVGv00n+rktl6rQwk8iBRPVcgmNiOMypRrsog3K0q6lWpfHRthyISCLfGJrkkb0tWqWFMR9oRXV08o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795129377; 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:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ziKX5Nh7dHHbXokqq4Vyei4+RcagCspq6GVX+mTB/iU=; b=KLIaDUHZsoYIFv0cBzLSly0ieJke39Lb4tCURI/4BO7hwJwt5w2bz4dMU69/uOGyP12ZQsYtXhkmoHB+4g7QgoNE+FMyEtVr5vlsBXo1r0aDI3zMIQugOjoRS9zIfDnXpeBEaVV7Sw8+5ZKW4qND8z1iHdKZ679Gpcrf/cseMPY= 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 lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1795129376910207.98173750489138; Thu, 19 Nov 2026 15:02:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1xUB9F-0003Vm-Ro; Thu, 19 Nov 2026 18:02:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xUB9C-0003VR-8Z for qemu-devel@nongnu.org; Thu, 19 Nov 2026 18:02:31 -0500 Received: from mx0a-0031df01.pphosted.com ([205.220.168.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xUB9A-0001An-98 for qemu-devel@nongnu.org; Thu, 19 Nov 2026 18:02:29 -0500 Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6AJJ1ICk373622 for ; Thu, 19 Nov 2026 23:02:27 GMT Received: from mail-yw1-f198.google.com (mail-yw1-f198.google.com [209.85.128.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j1xymkgpm-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 19 Nov 2026 23:02:26 +0000 (GMT) Received: by mail-yw1-f198.google.com with SMTP id 00721157ae682-836c416b236so5148607b3.0 for ; Thu, 19 Nov 2026 15:02:26 -0800 (PST) Received: from localhost.localdomain (pmd666.hd.free.fr. [82.67.153.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab69bf629dsm1923576f8f.9.2026.11.19.15.02.22 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 19 Nov 2026 15:02:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= ziKX5Nh7dHHbXokqq4Vyei4+RcagCspq6GVX+mTB/iU=; b=Sb1j1/ukKlOTAmE2 aZ98M8tbdbFNjkDLbgOq5MVrk5xjo85CqwAIzv46zfQYN8pkXeGw+Detb8bJlPGs xdMrHNI++0lvz9IUWnjMc3X8lDKYcD8pbOSPyLCXT4j7Rx+joG06wcSenYee8wfH tK6i6U8wySjjUAGsKobUPp56i7w4JuLEr6s36yMbgy13r8UIqdd+IuLlDELELtVH nXAg93SiYUncpfVp7yRgZk8ZZjYRkitrJ21AXKqXmjND+BF5ODMME6a9JFwE2JSn wyQUnsXvQ1/X8xHiQu0y4X4M06OHVWtmorfjs2KbUP/mavay2OVhVzSEiUcJMRvS XJnJCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795129346; x=1795734146; darn=nongnu.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ziKX5Nh7dHHbXokqq4Vyei4+RcagCspq6GVX+mTB/iU=; b=W7tt6O7/oitsV6o/7Z3jJtAK2PLSCBy9kd7gsG78PVl3Yx7srmCWpBXZdtE3Cm9mHt jrL7jmeOh25SAtuqvGDiqVZYVYgJpB1Uh8hiP9awaCHvxWmUAQzJNY5qwp0Gj369lCOl DwMc+O+FxF1dzyi1hYroyJwn0w+sPq9ga/udAp1ehczG1e1n9tZpEcQ9tM/wnsv/E+V6 Vq1mn1E4G55VDKGrHASVSyzarfyLmW2SNDt+iZRRvIbvzmwOy4eVCOqBk1xrzma23s0X 50M9hnHuovYv0Q6gP2693stWoVA74otaI/iD+fDtLWvmW6QmRENPAE8/98VCLWlI0D/y kz7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795129346; x=1795734146; h=content-transfer-encoding:content-type: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 :content-type; bh=ziKX5Nh7dHHbXokqq4Vyei4+RcagCspq6GVX+mTB/iU=; b=uK6iVkRxfkEYX24orYwUhcmhy7FsKEADLXTymr+m8mw2Wr5H7QK4XwlxP6cfilPgg7 Fh9hE3nbQPr4DSAxK4NfrXWyLz8XG0UVprgMWsp+ut+jq/IUi122fRyCBU3G65L83s6W iRRpNR6MnMzrJr1fsJ+WOYcgTGaINJIbAkflJSHsCsiOXkQaxlu1BfBVr131TbnLBO1a QGS4ADOAw14R0t85zziXo6d6knMQfXtxa6YIc3SpSnFyR9KZUecahFinPshnATFDXNRs HCzqXUATvYKq8rbuTI71QMwfeD7pbUBJ0yoyZ8LKbB2/J6Ovjp/QoGx+Fl59ae8MlEyk EqUQ== X-Gm-Message-State: APuU4Z8UAUPQFeWfba47VgQeNT/Tjk16fdvpXj/+HDCr31QQExQp7tZA jiDL1DqqpNI3ao+TwBZUesBB0n6ek8PGx7kjWyqR7TCYyYGN+vY/ZQOjhOPN5t7sOyZRgfMHSZI ErcxYHot6/X7dpYu5c35OH1ePfXEuRg55y/S0SVJ3MqeSV5Wjkj/CMOYGsHgAe5CFILE/ X-Gm-Gg: AZFdTZfXywK/wE0jFn+AA0amHJqR8Yc8fGbMkCmf+vEWo6ovvXZqlafcecchgszCLEL GrhCXiERX+Eg3cwDagiTzcH1TSh7GvniHtCRm2pFgGAJPLMrIwHNYtjNlQxdyDouxlKQNSx7gzm Bowys2JN/QFRTS3j5WGJ+zVnuOH89pWB1LyC8r0+35pVY1NGwACRoMGQKhz3imw4Wh/41g2Wro9 dnj+j/kRoyROEAs+1u3+krffC3D/1KzdBV8wma9vCrUudEw4I+s3UqIwtQImQxGBW3RRhwrAexN pw6j/ZnwEz6hIrQQudZPSGjVTVsDaoYDsofZ2exGSMAVPSUSJwNHj5K9K7PDLpG/Me4OaHbRI4+ 5VKg2t0iuez+rNrT3+Ln00xJB1zlDcCJ/bvn82OWySpxAmEYKH9MLdlLwaS/m7CfmP9oOdk9kLx BjYGFdGh6gFhX/Fg== X-Received: by 2002:a05:690c:a:b0:8b1:2db3:b845 with SMTP id 00721157ae682-8b520435b3emr5101687b3.14.1795129345769; Thu, 19 Nov 2026 15:02:25 -0800 (PST) X-Received: by 2002:a05:690c:a:b0:8b1:2db3:b845 with SMTP id 00721157ae682-8b520435b3emr5101417b3.14.1795129345247; Thu, 19 Nov 2026 15:02:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Laurent Vivier , Max Filippov , Fabiano Rosas , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/2] tests/qtest: Execute Xtensa external register instructions Date: Fri, 20 Nov 2026 00:02:05 +0100 Message-ID: <20261119230205.4744-3-philmd@oss.qualcomm.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261119230205.4744-1-philmd@oss.qualcomm.com> References: <20261119230205.4744-1-philmd@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYxMTE5MDA5MiBTYWx0ZWRfX8Cons3Wcid89 kv/LrnbpBb0Lp+ccbSAI+fyRb5HUrKxfVOLw4S4n2DeuV7obFNr7tgKX2aRJO1FWK1f2LbusPy+ tGkSKKCTdwOV0FsmdcDjjNLzNYC0qBw= X-Proofpoint-GUID: e8tnOk0XsxA-XxszPBgG9Ga_Ie8T951t X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTE5MDA5MiBTYWx0ZWRfX0RHqe6cYv1Q2 MYl7o5Me5jMqA5GjOLPc/NfF6F6Eyorue8zRfaZN0Qx9iZUVm2to4h81Q2X7yEtw94WhpUCq3p2 hVRTl9u5oImYx5Jvxu1T3XyeuE1Gg9jGXRacImXTn87iG4r+qoGlY/Kyo8eXYb3xOU6cBn8QHqe +EgTSFKpe6KUjd8jKnJhf9BHSuFwxpE6em0dyGVtTFPagAQpcDy7+RxPVExblmBj/sYFJqTnbFe ly3w4vIG8E1xCfGC6Gtjig7aA28kevU0SBi8dUS7NdNFlyrd/AFP+/SV5ip5o1+iHPs5mXEhi16 hS/+Efi32Thzy6ktd8rxnmDK2AWkKgsX6HxWYaiwkVkJK6sJ2w1S1996Z52JQavlgraUKRGOf5e jhnd+MMUlC7xtR3iEAlKmaf+ZehqQu4vZ7Ai76kMyoyR/1ETogEyjIe5fa4Sv1f417t+/Uh6tLo PC++TNe+WnVJz7q5IYg== X-Proofpoint-ORIG-GUID: e8tnOk0XsxA-XxszPBgG9Ga_Ie8T951t X-Authority-Analysis: v=2.4 cv=WKPqzXsR c=1 sm=1 tr=0 ts=6aff8002 cx=c_pps a=g1v0Z557R90hA0UpD/5Yag==:117 a=nz36NW0qrpeEijYxj/H2Ew==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=M51BFTxLslgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=DbhnK5fyqX9BP6mFjmkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=MFSWADHSvvjO3QEy5MdX:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-19_05,2026-11-19_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 adultscore=0 spamscore=0 impostorscore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611190092 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=lists1p.gnu.org; Received-SPF: pass client-ip=205.220.168.131; envelope-from=philmd@oss.qualcomm.com; helo=mx0a-0031df01.pphosted.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, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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: qemu development 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 @qualcomm.com) X-ZM-MESSAGEID: 1795129379968158500 Run a minimal dc233c ELF that executes RER and WER on an unmapped external register and then writes a RAM marker. Require the marker while checking that QEMU stays alive. The embedded guest covers the missing-operand translation crash without requiring a cross assembler at test runtime. AI-used-for: Regression tests Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- tests/qtest/xtensa-extreg-test.c | 81 ++++++++++++++++++++++++++++++++ tests/qtest/meson.build | 2 + 2 files changed, 83 insertions(+) create mode 100644 tests/qtest/xtensa-extreg-test.c diff --git a/tests/qtest/xtensa-extreg-test.c b/tests/qtest/xtensa-extreg-t= est.c new file mode 100644 index 000000000000..10fde7461384 --- /dev/null +++ b/tests/qtest/xtensa-extreg-test.c @@ -0,0 +1,81 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * QTest for the RER/WER (external register) instructions of the dc233c co= re. + * + * The core's ISA tables used to describe RER and WER without operands, so + * translating them read uninitialised operands and crashed QEMU. The gue= st + * executes RER then WER on an unmapped external register address, then + * writes a marker to RAM, which the test polls. + */ + +#include "qemu/osdep.h" +#include "libqtest.h" + +#define MARKER_ADDR 0x100 +#define MARKER_VAL 0x123 + +/* + * Guest ELF, assembled with xtensa-dc233c-elf-gcc (whose assembler has the + * same operand-less RER/WER, hence the raw bytes) at the reset vector + * 0xfe000000, then reduced to one PT_LOAD segment: + * + * _start: + * movi.n a2, 0x40 + * .byte 0x30, 0x62, 0x40 # rer a3, a2 + * .byte 0x30, 0x72, 0x40 # wer a3, a2 + * movi a4, 0x100 + * movi a5, 0x123 + * s32i.n a5, a4, 0 + * 1: j 1b + */ +static const uint8_t xtensa_guest[] =3D { + 0x7f, 0x45, 0x4c, 0x46, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x5e, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x34, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0xfe, 0x14, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x4c, 0x02, 0x30, 0x62, 0x40, 0x30, 0x72, 0x40, 0x42, 0xa1, 0x00, 0x52, + 0xa1, 0x23, 0x59, 0x04, 0x06, 0xff, 0xff, 0x00, +}; + +static void test_extreg(void) +{ + g_autofree char *elf =3D NULL; + QTestState *qts; + int fd; + + fd =3D g_file_open_tmp("qtest-xtensa-extreg-XXXXXX", &elf, NULL); + g_assert(fd !=3D -1); + g_assert_cmpint(write(fd, xtensa_guest, sizeof(xtensa_guest)), =3D=3D, + sizeof(xtensa_guest)); + close(fd); + + qts =3D qtest_initf("-M sim -cpu dc233c -accel tcg -no-shutdown " + "-kernel %s", elf); + unlink(elf); + + /* The harness enforces a timeout; stop if QEMU died */ + while (qtest_readl(qts, MARKER_ADDR) !=3D MARKER_VAL + && qtest_probe_child(qts)) { + g_usleep(10000); + } + g_assert_cmpint(qtest_readl(qts, MARKER_ADDR), =3D=3D, MARKER_VAL); + + qtest_quit(qts); +} + +int main(int argc, char **argv) +{ + g_test_init(&argc, &argv, NULL); + + if (!qtest_has_accel("tcg")) { + g_test_skip("TCG not available"); + return g_test_run(); + } + qtest_add_func("xtensa/extreg", test_extreg); + + return g_test_run(); +} diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build index 6e2938d913ef..c0de1df2530f 100644 --- a/tests/qtest/meson.build +++ b/tests/qtest/meson.build @@ -328,6 +328,8 @@ qtests_riscv64 =3D ['riscv-csr-test'] + \ ['k230-ddr-test', 'k230-wdt-test', 'k230-gsdma-test', 'k230-decomp-gzip= -test'] : []) + \ ['milkv-duo-test'] =20 +qtests_xtensa =3D ['xtensa-extreg-test'] + qtests_hexagon =3D ['boot-serial-test', 'hexagon-config-test', 'l2vic-test= ', 'qcom-dsp-test', 'qct-qtimer-test'] --=20 2.55.0