From nobody Fri May 3 08:25:22 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1566394967; cv=none; d=zoho.com; s=zohoarc; b=CEtbri6IfriYBzcIB4IZf9mtFvKw7iEFfUBWFtd+ImI9xEvl3ILFp4M4sccGStFYLLhoi9+gzLhXK0H2FBd/dKTchA+ibzzIZMOphxULjjGyu/o1PhTAOCT3AnYLFjQyerYVy3Atl5F2gXtaudFBnV3jEKHwz2Aru5Xf9R2HwUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566394967; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=gDDrFLOu1SmUPeE5jWCZrGXUCOXT2g6Rh6o5us951sE=; b=AOLjQPT9eFyD4iPk63EZI9dEupR/wADT5/b2ITnM+ZJegCT+mtVJDeIuF3NczBrKOpjVxFo3OyQMPuVOwmORHxx2j57VhgmRptknd1g9frtoZ7jUXa9hi3SiGUfqWWqjGj5BoNBzpm5ATJUoS6UEOIoLivl9hOuQ1uyGpJ8RzLM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566394967113980.5545219170623; Wed, 21 Aug 2019 06:42:47 -0700 (PDT) Received: from localhost ([::1]:48632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Qsm-0000yO-1Y for importer@patchew.org; Wed, 21 Aug 2019 09:42:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50733) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0Qq3-0008Hf-4X for qemu-devel@nongnu.org; Wed, 21 Aug 2019 09:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0Qq2-0008EB-2y for qemu-devel@nongnu.org; Wed, 21 Aug 2019 09:39:46 -0400 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]:44190) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i0Qq1-00088I-SY; Wed, 21 Aug 2019 09:39:46 -0400 Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i0Qpq-0001HK-8i; Wed, 21 Aug 2019 15:39:34 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.92.1) (envelope-from ) id 1i0Qpp-0001wb-HP; Wed, 21 Aug 2019 15:39:33 +0200 From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Wed, 21 Aug 2019 15:39:32 +0200 Message-Id: <20190821133932.7428-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:bc8:30d7:100::1 Subject: [Qemu-devel] [PATCH] target/alpha: fix tlb_fill trap_arg2 value for instruction fetch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-stable@nongnu.org, Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Commit e41c94529740cc26 ("target/alpha: Convert to CPUClass::tlb_fill") slightly changed the way the trap_arg2 value is computed in case of TLB fill. The type of the variable used in the ternary operator has been changed from an int to an enum. This causes the -1 value to not be sign-extended to 64-bit in case of an instruction fetch. The trap_arg2 ends up with 0xffffffff instead of 0xffffffffffffffff. Fix that by changing the -1 into -1LL. This fixes the execution of user space processes in qemu-system-alpha. Fixes: e41c94529740cc26 Cc: qemu-stable@nongnu.org Signed-off-by: Aurelien Jarno --- target/alpha/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 93b8e788b1..9e9d880c1a 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -283,7 +283,7 @@ bool alpha_cpu_tlb_fill(CPUState *cs, vaddr addr, int s= ize, cs->exception_index =3D EXCP_MMFAULT; env->trap_arg0 =3D addr; env->trap_arg1 =3D fail; - env->trap_arg2 =3D (access_type =3D=3D MMU_INST_FETCH ? -1 : acces= s_type); + env->trap_arg2 =3D (access_type =3D=3D MMU_INST_FETCH ? -1LL : acc= ess_type); cpu_loop_exit_restore(cs, retaddr); } =20 --=20 2.23.0.rc1