From patchwork Mon Nov 20 21:21:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 119332 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4402347qgn; Mon, 20 Nov 2017 13:34:14 -0800 (PST) X-Google-Smtp-Source: AGs4zMbhXOPoF4SEtIMwN6f9DnwsnVcYmXhtnW2hzp9I3W4KojNtV9PSF+AfoXQwlFLoyrCz5BP2 X-Received: by 10.37.172.208 with SMTP id x16mr9293308ybd.386.1511213654590; Mon, 20 Nov 2017 13:34:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511213654; cv=none; d=google.com; s=arc-20160816; b=IZyEUsSWxQSf4Hh9SKYDl/Wy5fnVoP1L1PmCvLgBcfaQ2Sk6K5NJ8iTRSwsXxQRPpr kDmkkAnAqMSvZJTDFH4IdcVUFM70xF2F1zkmxu/gh4dyNTpRfNiCG6FGen3dXHeRz9y4 bC1tQcU7lFuHXbpTHENftiK2uCHwHILW2o/wJg+0l6ShmTTu8v7GNJRo6xsvkN8SrZ9B L4NdFMRy+w90wpBA/vPxr0J0A29qzi2GzJEcHcsv8FS7Uo0PU4xtsV08MIOroAZjVmB1 jYTF1OxAmfI7zKLysdqD75vK2T/XmJpYavi4UqF9FvVXGqtH+wb2hvNdZ8odPNZ9uPCj AGaw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=lkio4QZFrfu5NltsYHQt5TrbNoIlsVtR2oez2AZbbDaKoXt+fTM4kuHPjIXhCgxgAL 9xPgt4CKCP6titd5zuCSxdcDWOsGNY2LtsUSNSQbojKJdLXqEtq++se7ZH9bbSy8NFo6 OOJJVzmb1Qd3GWA323XrzJ8O5uvEjdSGH0M94p1RbJp1U7jrGRsthSSkuUNwVZDt+ufZ PxbHD3o8goSE08dw610urGFJxbMv5HPmDgziDWlK84mPNZhj5T/RvdxmO152tNHZNq+L VxfvgKLpZeA90D1TT71uGHWFzHHpJGLBN1oLTqKchSCtVzi+sXgSpIgkqQos0WnOlFTl pOiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UXQu/7wh; 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 h25si2376284ybj.219.2017.11.20.13.34.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 20 Nov 2017 13:34:14 -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=UXQu/7wh; 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]:59855 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGthm-0005mY-4C for patch@linaro.org; Mon, 20 Nov 2017 16:34:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGtW4-0004vR-WA for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGtW2-00082s-Ex for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:08 -0500 Received: from mail-lf0-x244.google.com ([2a00:1450:4010:c07::244]:36363) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eGtW2-00082H-6o for qemu-devel@nongnu.org; Mon, 20 Nov 2017 16:22:06 -0500 Received: by mail-lf0-x244.google.com with SMTP id k66so11727387lfg.3 for ; Mon, 20 Nov 2017 13:22:06 -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 :mime-version:content-transfer-encoding; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=UXQu/7whbFvaGhYEk2jFR4ULjdTlTnXOBBIswR7VxeLPJz18BI1HuoLJngLgG0mck+ D1SxFvQTr67p9jvDDYiFRZS5CmX9g/d6CYeuFCi9cUIe/UeMuSk9R9je7jteHJSUferj g26ysucJ02NeCECldkhqhPXZAaejRY5NaLmP4= 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:mime-version:content-transfer-encoding; bh=W4VHbrpagaYLA8j/FOA/MBf3OH6euAv9ISEr6iEZ1nY=; b=MMe3vp83/j5aJc/yndvbLZvkMTAKx+FitE/a1K+zjRUyOyMzGtZB8Zta/EWjQ80U3i yM/3UPVtQKB0Ss1Zx9qFVBWnGWlZU+wjzG8rE61Ps+OriP3VbW2XlTGOmZXAi84yXBqD fnhrQzY30Uozy1o85emZtnxG92bStxWoK/74/QM2sZFMV7Wc9bGpifD0nV9fJaS4DVTJ dxUCrHdeFe1TfrFLsnyNJ16wcIxUUDzazfq465q4GQNfV/39KzmZGcicGCMnDlU7s2S2 JohKkZhrv/FfX04bsOyBcvhSiM0qh3yDfIuEv/yD/uD2rNli7Qr1vRE1OQRBWKa06iw4 vYwQ== X-Gm-Message-State: AJaThX7ZN9fvBa4t3HHvGxIiovr9kEuxZY4M+EUhdXdaPWQ6/PfzkVHU zrsZHNKm2rxmvjwT7vQX/r+fXda1lFM= X-Received: by 10.25.225.8 with SMTP id y8mr3767970lfg.209.1511212924689; Mon, 20 Nov 2017 13:22:04 -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.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Nov 2017 13:22:03 -0800 (PST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Mon, 20 Nov 2017 23:21:41 +0200 Message-Id: <8d8cb956e0a679fcf0a8e24f1b2f34e038cdd48e.1511212753.git.riku.voipio@linaro.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 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 13/15] linux-user/sparc: Put address for data faults where linux-user expects it 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 In the user-mode-only version of sparc_cpu_handle_mmu_fault(), we must save the fault address for a data fault into the CPU state's mmu registers, because the code in linux-user/main.c expects to find it there in order to populate the si_addr field of the guest siginfo. Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell Signed-off-by: Riku Voipio --- target/sparc/mmu_helper.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.14.2 diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c index 126ea5e3ee..d5b6c1e48c 100644 --- a/target/sparc/mmu_helper.c +++ b/target/sparc/mmu_helper.c @@ -30,10 +30,18 @@ int sparc_cpu_handle_mmu_fault(CPUState *cs, vaddr address, int rw, int mmu_idx) { + SPARCCPU *cpu = SPARC_CPU(cs); + CPUSPARCState *env = &cpu->env; + if (rw & 2) { cs->exception_index = TT_TFAULT; } else { cs->exception_index = TT_DFAULT; +#ifdef TARGET_SPARC64 + env->dmmu.mmuregs[4] = address; +#else + env->mmuregs[4] = address; +#endif } return 1; }