From nobody Tue May 7 11:06:10 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; dkim=fail; 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; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1566496231; cv=none; d=zoho.com; s=zohoarc; b=Alhy4q+HzWEh6P9eX248Pv44Ee1s5/U+FQTwtW6bAhvK785LFUzIDtstwxWlECBg1LborHmLb3cz4WvVP0MrRbglb1eUSvXU5yPOOp/8eW2sVEFiRT/6C4kRvuiJ3xaEU+RWVjwlMeAwCzdtDOBy/dCqBvcE0s3sF65PGFeqKpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566496231; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=umjbQvyNhOeOnMJlj/UuLiaomopZxKybKESiEh98ACs=; b=KHy9ZvZSv63kyDJ1k4eDo1vcIbj+7tHCpyZ3v6XFanXeSi2CpejYCUN76yV4iZ+J1TrPNDKJmGoH3bt4IMIc5sg47Inqst75QcDE7lmp3zpHIdNc/o7M3CyemRQ5bvfgXhZAGgnH0JBsgmjj3nP4DdLefrxoIvEjHlr1pZ8dWzs= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; 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; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566496231132516.0957849775007; Thu, 22 Aug 2019 10:50:31 -0700 (PDT) Received: from localhost ([::1]:46868 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0rE6-0000z2-6U for importer@patchew.org; Thu, 22 Aug 2019 13:50:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45018) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0rD1-0008PA-0T for qemu-devel@nongnu.org; Thu, 22 Aug 2019 13:49:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i0rCz-00085c-1H for qemu-devel@nongnu.org; Thu, 22 Aug 2019 13:49:14 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:39177) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i0rCw-00083m-WB for qemu-devel@nongnu.org; Thu, 22 Aug 2019 13:49:12 -0400 Received: by mail-pf1-x444.google.com with SMTP id f17so4433915pfn.6 for ; Thu, 22 Aug 2019 10:49:08 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id k64sm40469177pgk.74.2019.08.22.10.49.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 10:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=umjbQvyNhOeOnMJlj/UuLiaomopZxKybKESiEh98ACs=; b=dE0DA4SPGerbn4y2RCGP0X8kvObOOlORj5VZGKoZeNOjE589UWR/8l4koJUuH2AYqU XJkWOsEidEgOSXeC3+A2Vp41yGZikzoG8VBkoZLVV4Rc7UjiBvA47ES0OIwRHQBFRWxz EJiAgN24vjNT3kRKUmORi58/HYrklStKxqR0CCpfY0mokobAR+oGh8pduBk3E/y99InL NRhEXtLpF7e1M7gJAoaYZHbjYbqm82ASFXt7yc6dLhFYl884vXlV2TkgERzJ0RllJNW1 YURg8q/bA4mOgulmXDsG+SnSTQX4XkySBSLfvQ+pnvk1mQMIBVdqFjLQAaIpiQ2R6+xE xH+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=umjbQvyNhOeOnMJlj/UuLiaomopZxKybKESiEh98ACs=; b=TupOdPWgT5oBIwCn9HA7MD9yYoKIviFssEncjTzR3riK74My2k7q7qWzP62ZeOgrl6 sAXxlaG10ZEnZyHE9ULzFRjH8yE2f/kVLm40JlWVYIa+7NLABF7n8aEn74FM+VApEydF FUXjXrlXYIV9H9E01IdoCTxuHZUX32eGGjwoCb+LWchOVVFCDGnKJaj8+Ym83oPOb9VJ ZGMHi7FsVb0BMtfuFX0+6od3LRifN6Ft917YN72dVrJBhMdP/YIry6wxEvz4GYb5ERd2 e+D7N/6PYlY+N908A/sQSrEEZei0DWB/E7XQDdkYSSJaHNZnOV3WLnOl2O7Od6FaFluc zoVQ== X-Gm-Message-State: APjAAAXlIa3aTvUopRHqis+WrkHbd0Vi5mO3bqVI7uNjy7By4U35RAZ+ j4WHG391PJeaPkcsIDfzEUVcpscbGBU= X-Google-Smtp-Source: APXvYqzP6X6BaB2oTnXvNz9jlsATcjiMd1/QQ3GTvbgucImEie+nhRAkWg/Ke9ckajMw+8Gif8RTDw== X-Received: by 2002:a17:90a:d343:: with SMTP id i3mr920810pjx.15.1566496146793; Thu, 22 Aug 2019 10:49:06 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 22 Aug 2019 10:49:04 -0700 Message-Id: <20190822174904.11339-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::444 Subject: [Qemu-devel] [PATCH v2] 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: peter.maydell@linaro.org, qemu-stable@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aurelien Jarno 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 [rth: Test MMU_DATA_LOAD and MMU_DATA_STORE instead of implying them.] Signed-off-by: Richard Henderson --- target/alpha/helper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/alpha/helper.c b/target/alpha/helper.c index c6998348df..19cda0a2db 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -283,7 +283,9 @@ 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_DATA_LOAD ? 0ull : + access_type =3D=3D MMU_DATA_STORE ? 1ull : + /* access_type =3D=3D MMU_INST_FETCH */ -1ull); cpu_loop_exit_restore(cs, retaddr); } =20 --=20 2.17.1