From patchwork Tue Aug 5 22:41:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Blake X-Patchwork-Id: 34969 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 791F4202A1 for ; Tue, 5 Aug 2014 22:45:12 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id nu7sf6732554obb.11 for ; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=rRbQQI8MdsH3ntVR5y+bg5hXnNAYjoKRgpJagg/tt+o=; b=kMTUWgHnYHi0jgzQ679zGpGyMJ0sSjHHf4vxKi43RjAwRr+VTWLFU35c/iHntOKoGx /sXAWxWjjCKjlb3y1RZRcxz28fIsM69eZVE9JsLBRgdzuyon8Sj1MwARvfMGng0CNB9b bcfs1fL9ktX5oz87CRD5kpo5cHdGBzQXuQwVrvdQRvu3yglHUa0kB/yeJMgsWfb4HmRL mWlGk31YTc3OGXLojQfpyGF6i9UbN6CMCv0H6Or2/Oe2Kdp2UnhdJzMdef91VFGraGyK Q+oOOxXLZZGQe4l0XbkhuL7D5RnD/OOduLw9yyONlIB1PBG+ZzxdAfBxOVVosfW5K3tr w7ow== X-Gm-Message-State: ALoCoQk4rDUzBzofX5tZRvjPUcpyx2eC/bzP5aW3JJPeXDeIiFsQah+0SJhqnRphtH6SgeN7HNaW X-Received: by 10.182.68.17 with SMTP id r17mr3422824obt.26.1407278711973; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.21.84 with SMTP id 78ls112792qgk.79.gmail; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) X-Received: by 10.52.106.198 with SMTP id gw6mr6014523vdb.23.1407278711884; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) Received: from mail-vc0-x236.google.com (mail-vc0-x236.google.com [2607:f8b0:400c:c03::236]) by mx.google.com with ESMTPS id pa9si2198294veb.79.2014.08.05.15.45.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Aug 2014 15:45:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::236 as permitted sender) client-ip=2607:f8b0:400c:c03::236; Received: by mail-vc0-f182.google.com with SMTP id hy4so2838993vcb.27 for ; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) X-Received: by 10.220.15.8 with SMTP id i8mr7133066vca.45.1407278711819; Tue, 05 Aug 2014 15:45:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp426444vcb; Tue, 5 Aug 2014 15:45:11 -0700 (PDT) X-Received: by 10.224.127.74 with SMTP id f10mr10830252qas.100.1407278710449; Tue, 05 Aug 2014 15:45:10 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id v109si5414812qge.121.2014.08.05.15.45.10 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 05 Aug 2014 15:45:10 -0700 (PDT) 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; Received: from localhost ([::1]:34456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnTi-0001mI-0U for patch@linaro.org; Tue, 05 Aug 2014 18:45:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45300) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnQP-0005Eo-Vy for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEnQJ-0006ED-7B for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:45 -0400 Received: from qmta04.emeryville.ca.mail.comcast.net ([76.96.30.40]:38927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnQI-0006E1-Rr for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:41:39 -0400 Received: from omta09.emeryville.ca.mail.comcast.net ([76.96.30.20]) by qmta04.emeryville.ca.mail.comcast.net with comcast id b7pc1o0020S2fkCA4Ahd3K; Tue, 05 Aug 2014 22:41:37 +0000 Received: from red.redhat.com ([24.10.254.122]) by omta09.emeryville.ca.mail.comcast.net with comcast id bAhT1o00J2fD5rL8VAhckj; Tue, 05 Aug 2014 22:41:37 +0000 From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 5 Aug 2014 16:41:13 -0600 Message-Id: <1407278474-17559-3-git-send-email-eblake@redhat.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1407278346-17427-1-git-send-email-eblake@redhat.com> References: <1407278346-17427-1-git-send-email-eblake@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.96.30.40 Cc: Peter Maydell , Fam Zheng , wenchaoqemu@gmail.com, Markus Armbruster , Luiz Capitulino , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [Qemu-devel] [PATCH v2 13/14] target-arm: don't hardcode mask values in arm_cpu_handle_mmu_fault X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Original-Sender: eblake@redhat.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::236 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=fail header.i=@comcast.net Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Alex Bennée Otherwise we break quickly when we change TARGET_PAGE_SIZE. Signed-off-by: Alex Bennée Message-id: 1406733627-24255-2-git-send-email-alex.bennee@linaro.org Signed-off-by: Peter Maydell --- target-arm/helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index d709285..35c11e7 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -4156,8 +4156,8 @@ int arm_cpu_handle_mmu_fault(CPUState *cs, vaddr address, &page_size); if (ret == 0) { /* Map a single [sub]page. */ - phys_addr &= ~(hwaddr)0x3ff; - address &= ~(target_ulong)0x3ff; + phys_addr &= TARGET_PAGE_MASK; + address &= TARGET_PAGE_MASK; tlb_set_page(cs, address, phys_addr, prot, mmu_idx, page_size); return 0; }