From patchwork Thu Aug 22 17:49:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172056 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1218180ily; Thu, 22 Aug 2019 10:49:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzr8nU7gWUxXWJsh+9tchWQTXkXGwBzbFjEC9tzSm4RYH5cc/4Nm2lon1c4Q28c8dKJf+wt X-Received: by 2002:a50:c19a:: with SMTP id m26mr63918edf.184.1566496170944; Thu, 22 Aug 2019 10:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566496170; cv=none; d=google.com; s=arc-20160816; b=yuifzuPfxHfsWI0LSnclJlJFafdnXB/VfhFSf7kaCkUpNMpBofz8jr3JW+uRKvNTzX oaapVNMUsdr30Fr6ox7StowqT151FOlcRr1DwTjSbVd4ZHPMRE/zJNe4dP93GgVUbc3X Jv48z+cFulCzBeGnhSWbWFEAiygXJkttjpteF1IlEkczfmSdouBVH+EbzcyK8QJabjQZ E3law1j23/x6IyMhaQf2eNkPnolJ2Nzlhf8jzcTX0I9kZDIey9c78EPiC6b14lmEBeFB bt8e06I6wNkrpUV6n2h+VxggVYks5BPemrrQiiDrRFxNPZjOaxkUNgG1j71klE46r0ee moMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:to:from :dkim-signature; bh=umjbQvyNhOeOnMJlj/UuLiaomopZxKybKESiEh98ACs=; b=ayxzEwFe6oiwo1SE+8YdWmwy4lN8mK8vJO+1ksxrdvZaIY1HXHm6yukxtIVYQPFQ9y aaGzbxSZ3GW6+k+5Q04ogoI2p/rQY3rJuK8+reyFmLSZPxVTq5bqD/+O67ikef1dzDbR iBZfyGYx1ExkAfmhOUcejsQ1bFRQt9oGMP63pLI6Mg1RjdIBkILVIjBJgVbGtBh8rziu 11zuGQp6EYALMjfusiwiXXei/r7+xQRNovLVonnDhD4INr49QMHCXwTZOqMcL68ZB3LA SkuqDSS9QYkg7XrtjGq3szihWfirP/shjryyJit955R4iKCLxkm/AtG8PnuGfBceXJ9g yXOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dE0DA4SP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i44si267510ede.37.2019.08.22.10.49.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2019 10:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=dE0DA4SP; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i0rDF-0008TR-Q3 for patch@linaro.org; Thu, 22 Aug 2019 13:49:29 -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) 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-Received: by 2002:a17:90a:d343:: with SMTP id i3mr920810pjx.15.1566496146793; Thu, 22 Aug 2019 10:49:06 -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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.17.1 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 size, cs->exception_index = EXCP_MMFAULT; env->trap_arg0 = addr; env->trap_arg1 = fail; - env->trap_arg2 = (access_type == MMU_INST_FETCH ? -1 : access_type); + env->trap_arg2 = (access_type == MMU_DATA_LOAD ? 0ull : + access_type == MMU_DATA_STORE ? 1ull : + /* access_type == MMU_INST_FETCH */ -1ull); cpu_loop_exit_restore(cs, retaddr); }