From patchwork Wed Jun 7 17:11:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9772061 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA4C56034B for ; Wed, 7 Jun 2017 17:14:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B8BA26785 for ; Wed, 7 Jun 2017 17:14:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8ED98283B9; Wed, 7 Jun 2017 17:14:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1C9B126785 for ; Wed, 7 Jun 2017 17:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=sFMEzHLJo+CWf3OqUlmD6NJhkVChEDRVVGEndBxzsMQ=; b=TA39pfzNtykA85d+cr38U+TUZE lg77AO6YHILBMMr0AwC3qNQMfEMxiWKzCEc7MOLpn6foX/JpDD288Sd02jVsrUzOupf0BmMhKWPhS fCPehrBNV0q5ER8i+Ogu5vweqtXXjsPARRn4IezQZ2SIkD7UDIlUbwA13QXoWSClUI2GfmRYZZcau iMD5nPGO/S41lCJD5ulOzKDao9E/tAa3NF02lNLW11VDW3I/t3EMyZbBweo57FJxqizZ3Ir386JXi yderuL1AVjcESKmI/PZYfM/VnpcEbkuuA+bYCAjYyY2poPCfrh0Ls5Qg49PkX4Nylff0cUSXJuufP fa9m24kw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dIeX7-0006au-0p; Wed, 07 Jun 2017 17:14:13 +0000 Received: from mail-wm0-x235.google.com ([2a00:1450:400c:c09::235]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dIeVV-0004pX-0Z for linux-arm-kernel@lists.infradead.org; Wed, 07 Jun 2017 17:12:35 +0000 Received: by mail-wm0-x235.google.com with SMTP id n195so15645328wmg.1 for ; Wed, 07 Jun 2017 10:12:13 -0700 (PDT) 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=MbEVFP7IrvVKcLpxzz1RU+ubSF6bVpUOQ/AZVgWFXm4=; b=MODo6ZRR2HF4JMDNlzRdr4otohXfaby39zgIY1NTC+bGxEpMhF+dktKFB6ppDdQHeU OR6pJFeDFaVSOimwndYwES7Ljnpe285zLPaHLFxVB0pF6ykoeaEjt6ohGDcGeok05Fp2 CUaGEemNcMfHCOJ21MmiBZjx8g+M3TBJEwWsI= 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=MbEVFP7IrvVKcLpxzz1RU+ubSF6bVpUOQ/AZVgWFXm4=; b=id6SMrBWjiI2TBqK7pWpCc1c/Lsvuq639tDovvOyaNJ4RsrLU5UQGzFgaaazSu1XJJ s8W8hqEQPKLPAZgFniZV4dC6gJSCSOU1n88EuYMVnqyKFBuUz9oSYx6djONhtKWpdLFW 3tMRm6YBNz4KBU+eRR6VnJy9eePQrHQ/qBT8Dfip+YzF6W1Cd0yJeq6jLUyjZVJq49If wXPOW1EkZyJaostroTXqVEN/t+qesMo+CjAN6VGZxwy40EwyhZpvvT+wcC8u37kXouOo y2lsH12EBZouOkSI41lIDQfgXBpwkeIFTXK9oZWpBJcLayrYncDy2Xc6HHETBFX0EpiI 7ulg== X-Gm-Message-State: AODbwcCE1Kjq12CE5xN68/pxH0x3L7KM/BgAp/EJaOmNjWbd7kQqFz5w OwhwF2bUqhmMb6C/6F0Nmw== X-Received: by 10.80.172.98 with SMTP id w31mr19009213edc.120.1496855532215; Wed, 07 Jun 2017 10:12:12 -0700 (PDT) Received: from localhost.localdomain (xd93ddc2d.cust.hiper.dk. [217.61.220.45]) by smtp.gmail.com with ESMTPSA id c2sm966244edc.34.2017.06.07.10.12.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 10:12:11 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Subject: [PULL v2 6/6] arm: KVM: Allow unaligned accesses at HYP Date: Wed, 7 Jun 2017 19:11:52 +0200 Message-Id: <20170607171152.21874-7-cdall@linaro.org> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170607171152.21874-1-cdall@linaro.org> References: <20170607171152.21874-1-cdall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170607_101233_275857_23A05F63 X-CRM114-Status: GOOD ( 10.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoffer Dall , kvm@vger.kernel.org, Marc Zyngier , stable@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marc Zyngier We currently have the HSCTLR.A bit set, trapping unaligned accesses at HYP, but we're not really prepared to deal with it. Since the rest of the kernel is pretty happy about that, let's follow its example and set HSCTLR.A to zero. Modern CPUs don't really care. Cc: stable@vger.kernel.org Signed-off-by: Marc Zyngier Signed-off-by: Christoffer Dall --- arch/arm/kvm/init.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S index 570ed4a..5386528 100644 --- a/arch/arm/kvm/init.S +++ b/arch/arm/kvm/init.S @@ -104,7 +104,6 @@ __do_hyp_init: @ - Write permission implies XN: disabled @ - Instruction cache: enabled @ - Data/Unified cache: enabled - @ - Memory alignment checks: enabled @ - MMU: enabled (this code must be run from an identity mapping) mrc p15, 4, r0, c1, c0, 0 @ HSCR ldr r2, =HSCTLR_MASK @@ -112,8 +111,8 @@ __do_hyp_init: mrc p15, 0, r1, c1, c0, 0 @ SCTLR ldr r2, =(HSCTLR_EE | HSCTLR_FI | HSCTLR_I | HSCTLR_C) and r1, r1, r2 - ARM( ldr r2, =(HSCTLR_M | HSCTLR_A) ) - THUMB( ldr r2, =(HSCTLR_M | HSCTLR_A | HSCTLR_TE) ) + ARM( ldr r2, =(HSCTLR_M) ) + THUMB( ldr r2, =(HSCTLR_M | HSCTLR_TE) ) orr r1, r1, r2 orr r0, r0, r1 mcr p15, 4, r0, c1, c0, 0 @ HSCR