From patchwork Wed Jul 9 16:17:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Schopp X-Patchwork-Id: 33333 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1CA4B208CF for ; Wed, 9 Jul 2014 16:19:26 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id o8sf25684724qcw.11 for ; Wed, 09 Jul 2014 09:19:25 -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:subject:from:to:date:message-id :user-agent:mime-version:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=wggMIlaWCqawk1PHiIYfISiUuWfHMBt7EkFKg+0bp0U=; b=KHJDbutAIe25fSVoTbcbT0RMngDT5aR+0fQP6FQhkxpK5bdYObnhkZqHbqvVxP9eUA aSZ/cU8Hpt9JeGWJ7AL/U51ZTfakdxu0hLjFhCjGnmDnHwHKL+jnhs4t1SqrpPwSNAVI 9FPVVbzEug+pusyS7tgv0ECSecwkr8A7bfq82LMxSk10luewN7kszKwlGOo3YXaINHAZ tY/bQQCKFCiUsPlzyIZuAUm1VKqcScmyHGkZChLl2QUX1jAeqAADXBXe9sY0XMd3IHpx pyVvytFnnmnZOxACWBZItzh7xhAikF3/ig0pWsQQELsoA9tS9GdADqgb0QCpu8n2HsbZ uoBw== X-Gm-Message-State: ALoCoQmxlQE5tKD99XEYn6qI9tn5bBC1mV36Mp8shxa6PE3YwQFPbNvXL2JnTVRqabdGVfyx1Eq2 X-Received: by 10.236.222.162 with SMTP id t32mr17326823yhp.47.1404922765786; Wed, 09 Jul 2014 09:19:25 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.171 with SMTP id 40ls2579693qgx.9.gmail; Wed, 09 Jul 2014 09:19:25 -0700 (PDT) X-Received: by 10.58.182.234 with SMTP id eh10mr1260304vec.41.1404922765650; Wed, 09 Jul 2014 09:19:25 -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 y3si21741170vdx.29.2014.07.09.09.19.25 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 09:19:25 -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 hy10so7387003vcb.1 for ; Wed, 09 Jul 2014 09:19:25 -0700 (PDT) X-Received: by 10.220.203.134 with SMTP id fi6mr40585133vcb.18.1404922765532; Wed, 09 Jul 2014 09:19:25 -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 tc5csp60793vcb; Wed, 9 Jul 2014 09:19:25 -0700 (PDT) X-Received: by 10.67.12.171 with SMTP id er11mr1536967pad.132.1404922764724; Wed, 09 Jul 2014 09:19:24 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id dr10si7517822pdb.365.2014.07.09.09.19.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jul 2014 09:19:24 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4uYm-0007aI-HH; Wed, 09 Jul 2014 16:17:32 +0000 Received: from dns-bn1lp0143.outbound.protection.outlook.com ([207.46.163.143] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X4uYj-0007XR-Rd for linux-arm-kernel@lists.infradead.org; Wed, 09 Jul 2014 16:17:30 +0000 Received: from BLUPR02CA016.namprd02.prod.outlook.com (10.141.30.16) by DM2PR0201MB0926.namprd02.prod.outlook.com (25.160.216.12) with Microsoft SMTP Server (TLS) id 15.0.980.8; Wed, 9 Jul 2014 16:17:06 +0000 Received: from BN1BFFO11FD005.protection.gbl (2a01:111:f400:7c10::1:112) by BLUPR02CA016.outlook.office365.com (2a01:111:e400:879::16) with Microsoft SMTP Server (TLS) id 15.0.980.8 via Frontend Transport; Wed, 9 Jul 2014 16:17:05 +0000 Received: from atltwp02.amd.com (165.204.84.222) by BN1BFFO11FD005.mail.protection.outlook.com (10.58.144.68) with Microsoft SMTP Server id 15.0.980.11 via Frontend Transport; Wed, 9 Jul 2014 16:17:05 +0000 X-WSS-ID: 0N8GD8E-08-207-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 274D0D16086; Wed, 9 Jul 2014 11:17:01 -0500 (CDT) Received: from SATLEXDAG03.amd.com (10.181.40.7) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.2.328.9; Wed, 9 Jul 2014 11:17:47 -0500 Received: from joelaarch64.amd.com (10.180.168.240) by satlexdag03.amd.com (10.181.40.7) with Microsoft SMTP Server (TLS) id 14.2.328.9; Wed, 9 Jul 2014 12:17:02 -0400 Subject: [PATCH] arm64: fix VTTBR_BADDR_MASK From: Joel Schopp To: , , Date: Wed, 9 Jul 2014 11:17:04 -0500 Message-ID: <20140709161704.9623.92358.stgit@joelaarch64.amd.com> User-Agent: StGit/0.17.1-4-g4a0c1 MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(428002)(189002)(199002)(92566001)(54356999)(2201001)(47776003)(92726001)(229853001)(53416004)(85306003)(95666004)(4396001)(33646001)(77096002)(74502001)(107046002)(20776003)(19580395003)(81542001)(103116003)(86362001)(64706001)(83506001)(19580405001)(83322001)(85852003)(31966008)(83072002)(97746001)(50466002)(99396002)(44976005)(68736004)(97736001)(21056001)(46102001)(102836001)(76482001)(101416001)(87936001)(80022001)(74662001)(84676001)(105586002)(79102001)(2171001)(23676002)(81342001)(106466001)(77982001)(50986999)(71626003); DIR:OUT; SFP:; SCL:1; SRVR:DM2PR0201MB0926; H:atltwp02.amd.com; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 0267E514F9 Received-SPF: None (: amd.com does not designate permitted sender hosts) X-OriginatorOrg: amd4.onmicrosoft.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140709_091730_069354_09886D5A X-CRM114-Status: UNSURE ( 8.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [207.46.163.143 listed in list.dnswl.org] -0.7 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [207.46.163.143 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record Cc: Christoffer Dall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: joel.schopp@amd.com 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 The current calculation for VTTBR_BADDR_MASK masks only 39 bits and not all 40 bits. That last bit is important as some systems allocate from near the top of the available address space. This patch is necessary to run KVM on an aarch64 SOC I have been testing. Signed-off-by: Joel Schopp --- arch/arm64/include/asm/kvm_arm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index 3d69030..b39e93f 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h @@ -148,7 +148,7 @@ #endif #define VTTBR_BADDR_SHIFT (VTTBR_X - 1) -#define VTTBR_BADDR_MASK (((1LLU << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT) +#define VTTBR_BADDR_MASK (0xffffffffffLLU) /* bits 0-39 */ #define VTTBR_VMID_SHIFT (48LLU) #define VTTBR_VMID_MASK (0xffLLU << VTTBR_VMID_SHIFT)