From patchwork Wed Jul 30 15:20:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 34540 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F3CC720792 for ; Wed, 30 Jul 2014 15:24:20 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id eu11sf8722922pac.7 for ; Wed, 30 Jul 2014 08:24:20 -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=21ijpv5TNBI+v2gEc5ZH2zrs+CcphHloNxUYnE4xqvE=; b=JPRrNMcEPqYdxfeTt9eLMc+sE9J2aDMJ2WHgmu8zHlEhx1QKpd/eJwQWzoc94QzzQN TuZ/SgGR8gAZdXqIPhyV4wjW2trs8yBM/7bVR6AFacg1rB71IX0hM7l6Cppy3CVJFOa8 IpJQOXD1wmK2qRZdyDJ+2vbau+nYWiQouNdXt9uouJP+jFMy2yepvH/7R8GRG+qfE//t boQK4chLJdODrS6ExpGbicya7twlsWoG4MmB2F+I6o3XIs8/10TveLCST5jSOMD8hRMr /hX5cjtfvIe1BBCCrh0bVF7J5hpk6JZsUs1trCNUCdtpz4+bmkEJavBBCis2YrJogZJX PFwQ== X-Gm-Message-State: ALoCoQn2D2kC6WzESASoaCmpYbcWbNwDMdYE5f8DtgpndVbXFTqgdKPC/CobmrAE1lDGR5/Sf87/ X-Received: by 10.66.145.33 with SMTP id sr1mr1964624pab.18.1406733860291; Wed, 30 Jul 2014 08:24:20 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.37.142 with SMTP id r14ls578388qgr.16.gmail; Wed, 30 Jul 2014 08:24:20 -0700 (PDT) X-Received: by 10.220.175.70 with SMTP id w6mr2326660vcz.72.1406733860138; Wed, 30 Jul 2014 08:24:20 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id cn9si1991801vcb.71.2014.07.30.08.24.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Jul 2014 08:24:20 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so2068748vcb.1 for ; Wed, 30 Jul 2014 08:24:20 -0700 (PDT) X-Received: by 10.220.118.136 with SMTP id v8mr5481447vcq.50.1406733860031; Wed, 30 Jul 2014 08:24:20 -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 tc5csp36037vcb; Wed, 30 Jul 2014 08:24:19 -0700 (PDT) X-Received: by 10.140.92.13 with SMTP id a13mr7210721qge.88.1406733859152; Wed, 30 Jul 2014 08:24:19 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j7si4422378qas.101.2014.07.30.08.24.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Jul 2014 08:24:19 -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]:51593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCVjm-0007HI-Lw for patch@linaro.org; Wed, 30 Jul 2014 11:24:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33769) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCVgK-0001om-PU for qemu-devel@nongnu.org; Wed, 30 Jul 2014 11:20:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XCVgC-00016b-Io for qemu-devel@nongnu.org; Wed, 30 Jul 2014 11:20:44 -0400 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:44792 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XCVgC-000169-B4 for qemu-devel@nongnu.org; Wed, 30 Jul 2014 11:20:36 -0400 Received: from localhost ([127.0.0.1] helo=zen.linaro.local) by socrates.bennee.com with esmtp (Exim 4.80) (envelope-from ) id 1XCVpp-0002Zs-NY; Wed, 30 Jul 2014 17:30:33 +0200 From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Wed, 30 Jul 2014 16:20:24 +0100 Message-Id: <1406733627-24255-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.0.3 In-Reply-To: <1406733627-24255-1-git-send-email-alex.bennee@linaro.org> References: <1406733627-24255-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: alex.bennee@linaro.org X-SA-Exim-Scanned: No (on socrates.bennee.com); SAEximRunCond expanded to false X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 88.198.71.155 Cc: peter.maydell@linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [Qemu-devel] [PATCH v2 2/5] target-arm: A64: fix TLB flush instructions 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 According to the ARM ARM we weren't correctly flushing the TLB entries where bits 63:56 didn't match bit 55 of the virtual address. This exposed a problem when we switched QEMU's internal TARGET_PAGE_BITS to 12 for aarch64. Signed-off-by: Alex Bennée Reviewed-by: Peter Maydell --- v2: - remove mangled ARM ARM quote diff --git a/target-arm/helper.c b/target-arm/helper.c index aa5d267..906940d 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1766,12 +1766,17 @@ static CPAccessResult aa64_cacheop_access(CPUARMState *env, return CP_ACCESS_OK; } +/* See: D4.7.2 TLB maintenance requirements and the TLB maintenance instructions + * Page D4-1736 (DDI0487A.b) + */ + static void tlbi_aa64_va_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) { /* Invalidate by VA (AArch64 version) */ ARMCPU *cpu = arm_env_get_cpu(env); - uint64_t pageaddr = value << 12; + uint64_t pageaddr = sextract64(value << 12, 0, 56); + tlb_flush_page(CPU(cpu), pageaddr); } @@ -1780,7 +1785,8 @@ static void tlbi_aa64_vaa_write(CPUARMState *env, const ARMCPRegInfo *ri, { /* Invalidate by VA, all ASIDs (AArch64 version) */ ARMCPU *cpu = arm_env_get_cpu(env); - uint64_t pageaddr = value << 12; + uint64_t pageaddr = sextract64(value << 12, 0, 56); + tlb_flush_page(CPU(cpu), pageaddr); }