From patchwork Mon Nov 20 21:21:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119319 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4393284qgn; Mon, 20 Nov 2017 13:25:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMawW1QT7ZO7rpEl4ByzU5+tqLD7QKm3edmMereHi2OdvqwpoBfOmqdxyNVzR4a8KTn6fhvL X-Received: by 10.37.139.133 with SMTP id j5mr9500997ybl.4.1511213123434; Mon, 20 Nov 2017 13:25:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213123; cv=none; d=google.com; s=arc-20160816; b=USiYdCHOW2qEeI+PR/9hRyWJi6CblWaiFHIlKDfQvcck/TNvKPo+DP1YwuFuq1FiLP 8CWa0XlJFO6fsnSyOoQ/Xxr7KTB+ZuserE3g8fKIE3yhdQVyKN7T6XQDfHC9+ymrdh9C XQNZ0aG1jFfbkAf8d4fS0jApMYTHv3WzQG0o058K3ZyWnW5u4ExJ52mH2ywTPfQIPO7T K5eTrP/wHGFBYp7bXkFbHJ5DK20JcPhXzrSMilbvAl/NF1g2VxvWPlPIjLBN4SSlr76I l0CIbEFCoVXKE0oKWclvvU+5p3RAJWTkc208gz5H9pmI3isPXRDmzPjfTYKX7zMZ4Bzk 2JGw== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=wO/I+iBXxmpIDkKJm5IPYWXq8skOuwwthWdWImDTHd3WGwl3ADklzOCpZay0C2R8vZ 5h/BAwblLKMWzQlm1tACY/RHgi9c/oXBbl4ytfEN6YHTUyWKVLTIpP0FWm1e+qboo/zI GrnSrCQ4T+07WlLjTcRXwFcZ+cTgTakfYPtgV7VCaNYju5jCi/ZVMZlFX2bdxueP+1rn s6Ns1PWAR0rzOb8Aumo7py0wrgZTSQmgP710W0Mw0fa2s9FkII9UwqGy+GT3RU1hUN64 MuYI301LyqNg65SKuya2ILhMf02tNAtbLnShhh9qm79MqYFco+bkex22CNo2JJpMR0w+ GMUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BCxcSyA4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x127si2364890ybg.139.2017.11.20.13.25.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:25:23 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BCxcSyA4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:59814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtZC-00075k-Tx for patch@linaro.org; Mon, 20 Nov 2017 16:25:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58264) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW1-0004nM-Nx for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW0-000827-Tn for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:05 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:37686) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW0-0007yn-Mk for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:04 -0500 Received: by mail-lf0-x244.google.com with SMTP id y2so10781007lfj.4 for ; Mon, 20 Nov 2017 13:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=BCxcSyA4tyRc6BZgom6ZVxXfRmuZPk7Qc2k3RE+I18+W/GQwdqIXA3QSriCMBgrddi PYFJnGADElFOj/DHLBuCI3cTjVaBwt7jvhQCHWYJkVFbU66SlWLFAAcHRnm/XWlM+5/6 fPUzxNcYyiTvup1WbTgBXMKDKoql6+eApTx+g= 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:in-reply-to :references; bh=SwkXu0fPmqui88eJDIiUHicKxDg2XKWY1onT5RhrQxA=; b=mhrCRqXi7Cb03eqN1bI9UALIG7EsNdN+lLszQno2+nq1IP2DXJqciCbAVp+1juWIM3 MPpXcA+M8kANhHHntw/aWY9Q4txANk9kF3XZ7/ltJKSNLcYwXaxbGLlXZ797WZp4ap1s iZ8xjHVLvhp2nRriSAaGm1L83hT6t6SeiQVLfg0Tjt02ega99t1BA31SJIsOufw531Pl 6/TKRvfcSKWDx7g2HIMBWLSFr8vgGrzvowY1pFtYZbR53JnmXUfxYQqbRfXI2TeUcMko vgd2szNN+Hd9anEzgaxEjOaV295Wx/w2vo4ZmZa/hYMESVbkYCZVN9XqwvMCPkx+cvMg gD2w== X-Gm-Message-State: AJaThX7uhrm28FIKIAhkJj1n5jSik2Q9g2zur8yGkxx83SJk01LrGP1O SORH41lO5EHY/yNzICL7dYMn4kH3TyI= X-Received: by 10.25.203.2 with SMTP id b2mr3190785lfg.94.1511212923281; Mon, 20 Nov 2017 13:22:03 -0800 (PST) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id v63sm1645409lje.39.2017.11.20.13.22.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:02 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:40 +0200 Message-Id: <15e692a6fc716f32976eea47946a4892e8ad7a3f.1511212753.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::244 Subject: [Qemu-devel] [PULL 12/15] linux-user/ppc: Report correct fault address for data faults X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell For faults on loads and stores, ppc_cpu_handle_mmu_fault() in target/ppc/user_only_helper.c stores the offending address in env->spr[SPR_DAR]. Report this correctly to the guest in si_addr, rather than incorrectly using the address of the instruction that caused the fault. This fixes the test case in https://bugs.launchpad.net/qemu/+bug/1077116 for ppc, ppc64 and ppc64le. Reviewed-by: Laurent Vivier Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.14.2 diff --git a/linux-user/main.c b/linux-user/main.c index b6dd9efd2d..6286661bd3 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1420,7 +1420,7 @@ void cpu_loop(CPUPPCState *env) info.si_code = TARGET_SEGV_MAPERR; break; } - info._sifields._sigfault._addr = env->nip; + info._sifields._sigfault._addr = env->spr[SPR_DAR]; queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info); break; case POWERPC_EXCP_ISI: /* Instruction storage exception */